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

fix silently removing non-local-platform gems #7

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/bundler/multilock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,18 @@ def write_lockfile(lockfile_definition, lockfile, install:, dependency_changes:
previous_ui_level = Bundler.ui.level
Bundler.ui.level = "warn"
begin
# this is a horrible hack, to fix what I consider to be a Bundler bug.
# basically, if you have multiple platform specific gems in your
# lockfile, and that gem gets unlocked, Bundler will only search
# locally to find them. But non-platform-local gems are _never_
# installed locally. So just find the non-platform-local gems
# in the lockfile (that we know are there from a prior remote
# resolution), and add them to the locally installed spec list.
definition.send(:source_map).locked_specs.each do |spec|
next if spec.match_platform(Bundler.local_platform)

spec.source.specs.add(spec)
end
definition.resolve_with_cache!
rescue GemNotFound, SolveFailure
definition = orig_definition
Expand Down