Fix bundle lock --add-checksums#8272
Merged
deivid-rodriguez merged 3 commits intomasterfrom Nov 25, 2024
Merged
Conversation
0da6796 to
969ea7d
Compare
Contributor
Author
|
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 |
Contributor
Author
|
@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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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