-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix bundle lock --add-checksums
#8272
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
Conversation
0da6796 to
969ea7d
Compare
|
Requiring re-resolving just to add checksums to the lockfile felt a bit wrong, so I'm trying what I feel is a better approach. |
969ea7d to
b413118
Compare
All we need is to setup remote or local sources appropriately.
I always found the `resolve_if_necessary` method pretty confusing because by reading it, it suggests that resolution always happens, and the point is whether that needs to be local or remote. This commit tries to make that more clear.
Due to a typo in the spec, the issue was not caught initially. If Bundler does not need to re-resolve, `bundle lock` is a noop so Bundler does not add checksums. To fix the issue, we do something similar to what `bundle install` does, just without actually installation. First set the domain (local or remote) according to whether a re-resolve is necessary, and then materialize lazy specifications into real specifications, so that checksums are actually fetched from each source.
b413118 to
84b6f4e
Compare
|
Seeing this exact same behavior (no checksums) with Bundler 2.6.5 when trying Does it require specific support on the gemserver itself such that it wouldn't work with onprem gemservers perhaps? |
|
Switched to official |
|
@joshgoebel The first issue may be due to missing support in gemstash, maybe? It's currently being worked on rubygems/gemstash#392. As per the second, I'm not sure, if gems are coming from rubygems.org, they should have checksums. Can you share a way to reproduce? |
What was the end-user or developer problem that led to this PR?
bundle lock --add-checksumsdoes not add checksums if the lockfile is completely in sync with the Gemfile. If Bundler does not need to re-resolve,bundle lockis a noop so Bundler cannot add checksums. Due to a typo in the spec, the issue was not caught initially, because the typo was making Bundler re-resolve.What is your fix for the problem, implemented in this PR?
We need to make sure to force a re-resolve when
--add-checksumsflag is given.Fixes #8270.
Make sure the following tasks are checked