mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba761ba8ff |
@@ -203,10 +203,10 @@ if the [virtual environment](https://github.com/actions/virtual-environments) is
|
||||
* Make sure to use the same operating system and version.
|
||||
* Make sure to use the same version of libssl.
|
||||
* Make sure that the operating system has `libyaml-0` installed
|
||||
* The environment variable `RUNNER_TOOL_CACHE` must be set to same value as on GitHub-hosted runners
|
||||
(`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS, `C:\hostedtoolcache\windows` on Windows).
|
||||
* That directory must be writable by the `runner` user.
|
||||
* The runner software is running as user `runner` with a home directory of `/home/runner`, or you have created a symlink for the home directory of whatever user that the runner is running as to `/home/runner`.
|
||||
* The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS,
|
||||
`C:/hostedtoolcache/windows` on Windows) must be writable by the `runner` user.
|
||||
This is necessary since the Ruby builds embed the install path when built and cannot be moved around.
|
||||
* `/home/runner` must be writable by the `runner` user.
|
||||
|
||||
In other cases, please use a system Ruby or [install Ruby manually](https://github.com/postmodern/chruby/wiki#installing-rubies) instead.
|
||||
|
||||
|
||||
@@ -63,11 +63,21 @@ export function shouldExtractInToolCache(engine, version) {
|
||||
return engine === 'ruby' && !isHeadVersion(version)
|
||||
}
|
||||
|
||||
export function getToolCacheRubyPrefix(version) {
|
||||
const toolCache = process.env['RUNNER_TOOL_CACHE']
|
||||
if (!toolCache) {
|
||||
throw new Error('$RUNNER_TOOL_CACHE must be set')
|
||||
function getPlatformToolCache(platform) {
|
||||
// Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
|
||||
if (platform.startsWith('ubuntu-')) {
|
||||
return '/opt/hostedtoolcache'
|
||||
} else if (platform.startsWith('macos-')) {
|
||||
return '/Users/runner/hostedtoolcache'
|
||||
} else if (platform.startsWith('windows-')) {
|
||||
return 'C:/hostedtoolcache/windows'
|
||||
} else {
|
||||
throw new Error('Unknown platform')
|
||||
}
|
||||
}
|
||||
|
||||
export function getToolCacheRubyPrefix(platform, version) {
|
||||
const toolCache = getPlatformToolCache(platform)
|
||||
return path.join(toolCache, 'Ruby', version, 'x64')
|
||||
}
|
||||
|
||||
|
||||
+16
-6
@@ -27714,7 +27714,7 @@ async function install(platform, engine, version) {
|
||||
|
||||
let rubyPrefix
|
||||
if (common.shouldExtractInToolCache(engine, version)) {
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(version)
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
|
||||
} else {
|
||||
rubyPrefix = `${drive}:\\${base}`
|
||||
}
|
||||
@@ -32167,11 +32167,21 @@ function shouldExtractInToolCache(engine, version) {
|
||||
return engine === 'ruby' && !isHeadVersion(version)
|
||||
}
|
||||
|
||||
function getToolCacheRubyPrefix(version) {
|
||||
const toolCache = process.env['RUNNER_TOOL_CACHE']
|
||||
if (!toolCache) {
|
||||
throw new Error('$RUNNER_TOOL_CACHE must be set')
|
||||
function getPlatformToolCache(platform) {
|
||||
// Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
|
||||
if (platform.startsWith('ubuntu-')) {
|
||||
return '/opt/hostedtoolcache'
|
||||
} else if (platform.startsWith('macos-')) {
|
||||
return '/Users/runner/hostedtoolcache'
|
||||
} else if (platform.startsWith('windows-')) {
|
||||
return 'C:/hostedtoolcache/windows'
|
||||
} else {
|
||||
throw new Error('Unknown platform')
|
||||
}
|
||||
}
|
||||
|
||||
function getToolCacheRubyPrefix(platform, version) {
|
||||
const toolCache = getPlatformToolCache(platform)
|
||||
return path.join(toolCache, 'Ruby', version, 'x64')
|
||||
}
|
||||
|
||||
@@ -52901,7 +52911,7 @@ async function install(platform, engine, version) {
|
||||
async function downloadAndExtract(platform, engine, version) {
|
||||
let rubyPrefix
|
||||
if (common.shouldExtractInToolCache(engine, version)) {
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(version)
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
|
||||
} else if (windows) {
|
||||
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export async function install(platform, engine, version) {
|
||||
async function downloadAndExtract(platform, engine, version) {
|
||||
let rubyPrefix
|
||||
if (common.shouldExtractInToolCache(engine, version)) {
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(version)
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
|
||||
} else if (windows) {
|
||||
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ export async function install(platform, engine, version) {
|
||||
|
||||
let rubyPrefix
|
||||
if (common.shouldExtractInToolCache(engine, version)) {
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(version)
|
||||
rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
|
||||
} else {
|
||||
rubyPrefix = `${drive}:\\${base}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user