Skip to content
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

Make sure specs are fetched from the right source when materializing #4562

Merged
merged 5 commits into from
Apr 28, 2021

Conversation

deivid-rodriguez
Copy link
Member

What was the end-user or developer problem that led to this PR?

Sometimes, the dependency names initially set for each source will end up not matching that actual dependency names that got fetched from each source. We fix this issue by fetching any missing specs for the source set for each spec before materializing it, to make sure they will actually be found in the source.

However, unless this "double check" is the very last manipulation of the source, it can happen that other manipulations of the source (like source.local! or source.remote!) "cancel" the extra fetches.

This is a bit of a mess right now, but I expect to improve it so that the dependency names to be fetched from each source are set correctly from the beginning, so that we no longer need to do all this dance before materializing.

What is your fix for the problem, implemented in this PR?

For now I move the extra fetching of missing dependency names to be the last manipulation of the source before materialization to fix this issue. But I expect to completely remove the need for these manipulations by accurately setting the dependency names to be fetched from each source beforehand in the future.

Fixes #4553.

Make sure the following tasks are checked

The eventual behaviour change of `bundle update` wouldn't happen until
after bundler 3.
This cuts down the time to run this file on my machine by ~20 seconds.
Currently, `source.remote!` and `source.local!` reset the memoized specs
of the source, which means that remote specs are picked again from the
originally fetched specs. That means that if double checking made any
additions over that, they are cancelled unless this "double checking" is
that last thing we do.
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review April 26, 2021 13:43
@deivid-rodriguez deivid-rodriguez merged commit 4547a68 into master Apr 28, 2021
@deivid-rodriguez deivid-rodriguez deleted the bundle_update_gem_not_found_in_source branch April 28, 2021 06:36
deivid-rodriguez added a commit that referenced this pull request May 3, 2021
…_source

Make sure specs are fetched from the right source when materializing

(cherry picked from commit 4547a68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Could not find pkg-version in any of the sources" after upgrading to >= 2.2.14
2 participants