From ee5764de2c47ddbfc02d2b72fb242cc4b5bc713d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 22 Apr 2022 17:06:58 +0200 Subject: [PATCH] Give more details on why the shipped Bundler is used in some cases --- bundler.js | 11 ++++++++--- dist/index.js | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bundler.js b/bundler.js index 21e2929..eafab3a 100644 --- a/bundler.js +++ b/bundler.js @@ -85,14 +85,19 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru } // Workaround for truffleruby 22.0 + latest Bundler, use shipped Bundler instead: https://github.com/oracle/truffleruby/issues/2586 - const useShippedBundler2 = common.isHeadVersion(rubyVersion) || (engine.startsWith('truffleruby') && rubyVersion.startsWith('22.0')) + const truffleruby22workaround = engine.startsWith('truffleruby') && rubyVersion.startsWith('22.0') + const useShippedBundler2 = common.isHeadVersion(rubyVersion) || truffleruby22workaround if (useShippedBundler2 && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) { // Avoid installing a newer Bundler version for head versions as it might not work. // For releases, even if they ship with Bundler 2 we install the latest Bundler. - console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) + if (truffleruby22workaround) { + console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (workaround for https://github.com/oracle/truffleruby/issues/2586 on truffleruby 22.0)`) + } else { + console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (head versions do not always support the latest Bundler release)`) + } } else if (engine.startsWith('truffleruby') && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) { - console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`) + console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion} (required for truffleruby < 21.0)`) } else { const gem = path.join(rubyPrefix, 'bin', 'gem') // Workaround for https://github.com/rubygems/rubygems/issues/5245 diff --git a/dist/index.js b/dist/index.js index a2b86b8..1998daf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -99,14 +99,19 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi } // Workaround for truffleruby 22.0 + latest Bundler, use shipped Bundler instead: https://github.com/oracle/truffleruby/issues/2586 - const useShippedBundler2 = common.isHeadVersion(rubyVersion) || (engine.startsWith('truffleruby') && rubyVersion.startsWith('22.0')) + const truffleruby22workaround = engine.startsWith('truffleruby') && rubyVersion.startsWith('22.0') + const useShippedBundler2 = common.isHeadVersion(rubyVersion) || truffleruby22workaround if (useShippedBundler2 && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) { // Avoid installing a newer Bundler version for head versions as it might not work. // For releases, even if they ship with Bundler 2 we install the latest Bundler. - console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) + if (truffleruby22workaround) { + console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (workaround for https://github.com/oracle/truffleruby/issues/2586 on truffleruby 22.0)`) + } else { + console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (head versions do not always support the latest Bundler release)`) + } } else if (engine.startsWith('truffleruby') && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) { - console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`) + console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion} (required for truffleruby < 21.0)`) } else { const gem = path.join(rubyPrefix, 'bin', 'gem') // Workaround for https://github.com/rubygems/rubygems/issues/5245