-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
Locking to a specific bundler version #123
Comments
From rubygems/rubygems#4123 (comment) it sounds like rubygems / bundler itself should take care of using the correct Bundler version (needs Ruby version > 2.5 though). What version of Ruby are you using @jdelStrother? Any public build you can share? |
Yes, that is correct although currently it only works if multiple versions are installed. Say, if your lock file has I think what's happening in this case is that As a workaround, you can specifiy
|
Also, for completeness, we had decided to remove the version switching logic from bundler/rubygems and I was planning to get to that after the 2.2.0 release, but this unintended incompatibilities make me hesitate a lot. My current proposal for rubygems/bundler would be that Regardless of what we end up doing in bundler/rubygems,maybe
so that users can customize this behaviour? |
Actually there's |
It looks like it just uses the major version (ie 1 or 2) from the lockfile : Lines 175 to 191 in 084885e
|
So far That said I was wondering recently for Ruby 2.7+ which ship Bundler 2 whether we should use the default Bundler gem and not try to Agreed on being able to say Not sure regarding Gemfile.lock, Bundler will already pick the same major version, so it won't guarantee the same exact versions. And most gems don't use a Gemfile.lock, so this wouldn't help most cases I think.
Bugs always happen, now it's important to fix them. If people never try the new releases, then there will be other issues, possibly discovered very late. In any case, the version switching logic currently accept same major, so it doesn't solve anything here. |
Might be a good idea, although again that only works with an existing Gemfile.lock. FWIW I'm not happy to need so much code in ruby/setup-ruby so Bundler actually works and to try to pick the "right" Bundler. |
On Ruby < 2.7, there is no Bundler 2 included, so I think the only reasonable default (no Gemfile.lock, no explicit So yeah, choosing a specific Bundler release seems the only solution for Ruby < 2.7. For Ruby 2.7+ we could choose to pick the Bundler shipped with it if it's the same major version, like we do for |
PR to allow using an exact version with the |
I can confirm it works already and that was good, because for some reason I haven't found yet, our Actions builds started to takes ~50 minutes to run |
I know we have already discussed this in the past, and we disagree here. In my opinion they are two different valid approaches, call it discoverability vs determinism. I want to fix bugs for people who are suffering from them, and to ship features to people that need them. But I don't want to unexpectedly get in the middle at all for people for whom bundler is working just fine. By making sure a known working version of bundler is used if we can, I expect to not get in the middle suddenly when we release new version. People might experience issues, yeah, but when they choose to upgrade, not when we choose to release.
Of course, bundler auto managing its own version would only apply when there's an existing lockfile. Otherwise we'd run the latest as usual. If we implement this, I expect you, and heroku, to be able to eventually remove their own logic for finding "the right bundler". |
Most likely because it started compiling some gem from source instead of using a precompiled binary. |
Supported and released in https://github.com/ruby/setup-ruby/releases/tag/v1.59.0 |
Yes, the ~50 minutes thing sounds like what @eregon says, and it's an issue I think we've introduced in the latest bundler. We expected it to choose precompiled gems more smartly, and it seems to be doing the oppossite and not using the version with the precompiled binaries. 😞 I'm currently investigating this thing. I'll get back to it on Monday. |
Thanks so much for that @eregon! That's super helpful for me ❤️ |
@deivid-rodriguez is Bundler compiling when the output says I got the following output from setup-ruby when I cancelled a workflow that had been running for ~30 minutes:
|
I believe it doesn't. |
Nope, it sounds like a really slow resolution happening on the new version :/. Can you share the Gemfile? |
@deivid-rodriguez Not really, it is a private project, using private gems (using private GitHub repos). I'll try to reproduce it somehow. |
@dentarg I created a PR that I think should fix this. Can you try rubygems/rubygems#4134? Thanks!! |
@deivid-rodriguez Yes, rubygems/rubygems#4134 seems to solve the issue! I tested it using docker, details below(The repo does not have a Using Bundler 2.2.0
Using rubygems/rubygems#4134
(GitHub authentication business left out from the above.) |
Wow,that's awesome, thanks so much for verifying this!! I'll ship this fixes ASAP. |
I can verify that rubygems/rubygems#4134 indeed solves the problem. 👍 |
Thanks for verifying that @nesrual, it makes me happy :) |
It seems like we can only specify Bundler 1 or 2. Any chance of being able to supply a more specific version? We're having some issues with Bundler 2.2 (rubyjs/libv8#310) so want to lock to 2.1.4 for now
The text was updated successfully, but these errors were encountered: