Skip to content

Commit

Permalink
fix syncing embedded gems with different paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ccutrer committed Jun 26, 2024
1 parent ea4392e commit b93be94
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/bundler/multilock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ def after_install_all(install: true)

dependency_changes ||= spec != parent_spec

if spec.source != parent_spec.source
parent_spec = parent_spec.dup
parent_spec.source = spec.source
end
parent_spec
end

Expand Down
28 changes: 28 additions & 0 deletions spec/bundler/multilock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,34 @@
end
end

it "maintains consistency across local gem's lockfiless when one is included in the other" do
with_gemfile(<<~RUBY) do
lockfile("local_test/Gemfile.lock",
gemfile: "local_test/Gemfile")
gem "local_test", path: "local_test"
gem "net-smtp", "0.3.2"
RUBY
create_local_gem("local_test", <<~RUBY)
spec.add_dependency "net-smtp", "~> 0.3"
RUBY

invoke_bundler("install")

replace_lockfile_pin("local_test/Gemfile.lock", "net-smtp", "0.3.3")

# write_gemfile(<<~RUBY)
# lockfile("local_test/Gemfile.lock",
# gemfile: "local_test/Gemfile")

# gem "net-smtp", "~> 0.3.2"
# RUBY

invoke_bundler("install")
expect(File.read("local_test/Gemfile.lock")).to include("0.3.2")
end
end

it "syncs from a parent lockfile" do
with_gemfile(<<~RUBY) do
lockfile do
Expand Down

0 comments on commit b93be94

Please sign in to comment.