-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bundler-only runs #548
base: master
Are you sure you want to change the base?
Conversation
Could you clarify what's the use-case? It does look like a lot of changes and complications, so it would need a really good use case (without good workarounds) to be worth it. |
@@ -79,7 +81,21 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock | |||
const floatVersion = common.floatVersion(rubyVersion) | |||
|
|||
if (bundlerVersion === 'default') { | |||
if (common.isBundler2dot2Default(engine, rubyVersion)) { | |||
if (systemRubyUsed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't pass systemRubyUsed
to bundler.js, it should just work if we pass the correct rubyVersion
.
So we'd ask the RUBY_VERSION of the system ruby early on, and use that for rubyVersion
.
We'd just skip downloading, extracting and adding to PATH if the input is system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basing it on rubyVersion
isn't quite correct as:
- Ubuntu image doesn't ship with any Bundler
- macOS 11 image ships with a default Ruby 2.7 but with Bundler 2.4.
The logic used here for system Ruby is generic enough however that we could replace the existing common.isBundler2dot2Default
logic here and thus avoid the systemRubyUsed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu image doesn't ship with any Bundler
Which Ubuntu image? IIRC ubuntu-22.04
ships with some Ruby version in PATH by default from the toolcache, and that has Bundler.
macOS 11 image ships with a default Ruby 2.7 but with Bundler 2.4.
That's rather weird, updating to latest Bundler but not latest Ruby. It is what it is though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which Ubuntu image? IIRC
ubuntu-22.04
ships with some Ruby version in PATH by default from the toolcache, and that has Bundler.
This is what I get with ubuntu-22.04
: https://github.com/Bo98/workflow-test/actions/runs/7118996527/job/19383150052
macOS and Ubuntu runners do not use a toolcache Ruby by default. They use ones from system package managers.
Windows does use a toolcache Ruby by default (though badly broken for native gem builds on windows-2022).
#489 lists some, but for me specifically I need to conditionally use a custom-compiled Ruby while keeping the standard bundler install. Workaround would be to just copy the bundler caching logic here into a personal local action for my own use. I suppose it in part comes from If this is too much then that's fine - I'll figure something else out. |
I only see Docker there and I wonder if actions even work at all within Docker images.
I think one way would be to install your custom-compiled Ruby under the toolcache. |
I can't move the install but maybe could maybe nuke the toolcache and symlink? Seems very hacky but I can give it a try. |
#489
Seems to work across all macOS and Ubuntu runners.
Cache key has an extra
RUBY_PLATFORM
when using system Ruby as that can vary depending on how Ruby is compiled. For example, on macOS you could have a Ruby compiled for an older Darwin version than the one you are currently running on.