Fix tc.find() calls to use the proper name on self-hosted

This commit is contained in:
Benoit Daloze
2023-03-05 14:56:02 +01:00
parent ddde3938f5
commit d03a71de6e
4 changed files with 19 additions and 12 deletions
+7 -4
View File
@@ -264,15 +264,18 @@ function getDefaultToolCachePath() {
} }
} }
export function getToolCacheRubyPrefix(platform, engine, version) { export function engineToToolCacheName(engine) {
const toolCache = getToolCachePath() return {
const name = {
ruby: 'Ruby', ruby: 'Ruby',
jruby: 'JRuby', jruby: 'JRuby',
truffleruby: 'TruffleRuby', truffleruby: 'TruffleRuby',
"truffleruby+graalvm": 'TruffleRubyGraalVM' "truffleruby+graalvm": 'TruffleRubyGraalVM'
}[engine] }[engine]
return path.join(toolCache, name, version, os.arch()) }
export function getToolCacheRubyPrefix(platform, engine, version) {
const toolCache = getToolCachePath()
return path.join(toolCache, engineToToolCacheName(engine), version, os.arch())
} }
export function toolCacheCompleteFile(toolCacheRubyPrefix) { export function toolCacheCompleteFile(toolCacheRubyPrefix) {
Generated Vendored
+10 -6
View File
@@ -289,6 +289,7 @@ __nccwpck_require__.r(__webpack_exports__);
__nccwpck_require__.d(__webpack_exports__, { __nccwpck_require__.d(__webpack_exports__, {
"createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile),
"drive": () => (/* binding */ drive), "drive": () => (/* binding */ drive),
"engineToToolCacheName": () => (/* binding */ engineToToolCacheName),
"floatVersion": () => (/* binding */ floatVersion), "floatVersion": () => (/* binding */ floatVersion),
"getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch),
"getRunnerToolCache": () => (/* binding */ getRunnerToolCache), "getRunnerToolCache": () => (/* binding */ getRunnerToolCache),
@@ -620,15 +621,18 @@ function getDefaultToolCachePath() {
} }
} }
function getToolCacheRubyPrefix(platform, engine, version) { function engineToToolCacheName(engine) {
const toolCache = getToolCachePath() return {
const name = {
ruby: 'Ruby', ruby: 'Ruby',
jruby: 'JRuby', jruby: 'JRuby',
truffleruby: 'TruffleRuby', truffleruby: 'TruffleRuby',
"truffleruby+graalvm": 'TruffleRubyGraalVM' "truffleruby+graalvm": 'TruffleRubyGraalVM'
}[engine] }[engine]
return path.join(toolCache, name, version, os.arch()) }
function getToolCacheRubyPrefix(platform, engine, version) {
const toolCache = getToolCachePath()
return path.join(toolCache, engineToToolCacheName(engine), version, os.arch())
} }
function toolCacheCompleteFile(toolCacheRubyPrefix) { function toolCacheCompleteFile(toolCacheRubyPrefix) {
@@ -68280,7 +68284,7 @@ function getAvailableVersions(platform, engine) {
async function install(platform, engine, version) { async function install(platform, engine, version) {
let rubyPrefix, inToolCache let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) { if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version) inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) { if (inToolCache) {
rubyPrefix = inToolCache rubyPrefix = inToolCache
} else { } else {
@@ -68494,7 +68498,7 @@ async function install(platform, engine, version) {
let rubyPrefix, inToolCache let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) { if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version) inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) { if (inToolCache) {
rubyPrefix = inToolCache rubyPrefix = inToolCache
} else { } else {
+1 -1
View File
@@ -20,7 +20,7 @@ export function getAvailableVersions(platform, engine) {
export async function install(platform, engine, version) { export async function install(platform, engine, version) {
let rubyPrefix, inToolCache let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) { if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version) inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) { if (inToolCache) {
rubyPrefix = inToolCache rubyPrefix = inToolCache
} else { } else {
+1 -1
View File
@@ -49,7 +49,7 @@ export async function install(platform, engine, version) {
let rubyPrefix, inToolCache let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) { if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version) inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) { if (inToolCache) {
rubyPrefix = inToolCache rubyPrefix = inToolCache
} else { } else {