Skip to content

Commit a6f2286

Browse files
committed
Use the proper ABI version for caching gems of truffleruby-head
* Previously the commit was used.
1 parent c84889b commit a6f2286

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

bundler.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,21 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
183183
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
184184
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
185185

186-
if (engine === 'ruby' && common.isHeadVersion(version)) {
187-
// CRuby dev versions do not change the ABI version when the ABI changes, so append the commit to the ABI version
188-
let revision = '';
189-
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
190-
silent: true,
191-
listeners: {
192-
stdout: (data) => {
193-
revision += data.toString();
186+
if (common.isHeadVersion(version)) {
187+
if (engine !== 'jruby') {
188+
// CRuby dev versions do not change the ABI version when the ABI changes, so use the commit as the ABI version
189+
let print_abi = engine === 'ruby' ? 'print RUBY_REVISION' : "print RbConfig::CONFIG['ruby_version']"
190+
let abi = ''
191+
await exec.exec('ruby', ['-e', print_abi], {
192+
silent: true,
193+
listeners: {
194+
stdout: (data) => {
195+
abi += data.toString();
196+
}
194197
}
195-
}
196-
});
197-
key += `-revision-${revision}`
198+
});
199+
key += `-ABI-${abi}`
200+
}
198201
}
199202

200203
key += `-${lockFile}`

dist/index.js

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)