mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Use the proper ABI version for caching gems of truffleruby-head
* Previously the commit was used.
This commit is contained in:
+14
-11
@@ -183,18 +183,21 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|||||||
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine === 'ruby' && common.isHeadVersion(version)) {
|
if (common.isHeadVersion(version)) {
|
||||||
// CRuby dev versions do not change the ABI version when the ABI changes, so append the commit to the ABI version
|
if (engine !== 'jruby') {
|
||||||
let revision = '';
|
// CRuby dev versions do not change the ABI version when the ABI changes, so use the commit as the ABI version
|
||||||
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
|
let print_abi = engine === 'ruby' ? 'print RUBY_REVISION' : "print RbConfig::CONFIG['ruby_version']"
|
||||||
silent: true,
|
let abi = ''
|
||||||
listeners: {
|
await exec.exec('ruby', ['-e', print_abi], {
|
||||||
stdout: (data) => {
|
silent: true,
|
||||||
revision += data.toString();
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
abi += data.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
key += `-ABI-${abi}`
|
||||||
key += `-revision-${revision}`
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key += `-${lockFile}`
|
key += `-${lockFile}`
|
||||||
|
|||||||
+14
-11
@@ -197,18 +197,21 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|||||||
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine === 'ruby' && common.isHeadVersion(version)) {
|
if (common.isHeadVersion(version)) {
|
||||||
// CRuby dev versions do not change the ABI version when the ABI changes, so append the commit to the ABI version
|
if (engine !== 'jruby') {
|
||||||
let revision = '';
|
// CRuby dev versions do not change the ABI version when the ABI changes, so use the commit as the ABI version
|
||||||
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
|
let print_abi = engine === 'ruby' ? 'print RUBY_REVISION' : "print RbConfig::CONFIG['ruby_version']"
|
||||||
silent: true,
|
let abi = ''
|
||||||
listeners: {
|
await exec.exec('ruby', ['-e', print_abi], {
|
||||||
stdout: (data) => {
|
silent: true,
|
||||||
revision += data.toString();
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
abi += data.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
key += `-ABI-${abi}`
|
||||||
key += `-revision-${revision}`
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key += `-${lockFile}`
|
key += `-${lockFile}`
|
||||||
|
|||||||
Reference in New Issue
Block a user