From d8ff979dcbc0981b88eaf0d3c061b39bcdcb370a Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Tue, 25 Jun 2024 15:42:00 -0600 Subject: [PATCH] fix an issue on initial sync that doesn't know to include intermediate gems --- lib/bundler/multilock.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/bundler/multilock.rb b/lib/bundler/multilock.rb index 912b9b9..b76cdff 100644 --- a/lib/bundler/multilock.rb +++ b/lib/bundler/multilock.rb @@ -512,6 +512,14 @@ def write_lockfile(lockfile_definition, previous_ui_level = Bundler.ui.level Bundler.ui.level = "warn" begin + # force a remote resolution if intermediate gems are missing + if definition.instance_variable_get(:@locked_spec_with_missing_deps) || + definition.instance_variable_get(:@locked_spec_with_invalid_deps) || + definition.instance_variable_get(:@missing_lockfile_dep) || + definition.instance_variable_get(:@invalid_lockfile_dep) + raise SolveFailure + end + # 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