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

bundle upgrade after bundler update unnecessarily adds version-specific current platform to lock file #6232

Closed
owst opened this issue Jan 4, 2023 · 2 comments · Fixed by #6233

Comments

@owst
Copy link

owst commented Jan 4, 2023

Describe the problem as clearly as you can

We upgraded bundler and then upgraded a gem, we unexpectedly saw a version-specific platform added to the lock file.

Example, given Gemfile:

source 'https://rubygems.org'

gem 'nokogiri', "~> 1"
gem 'sorbet'

and Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    mini_portile2 (2.6.1)
    nokogiri (1.12.0)
      mini_portile2 (~> 2.6.1)
      racc (~> 1.4)
    nokogiri (1.12.0-x86_64-darwin)
      racc (~> 1.4)
    nokogiri (1.12.0-x86_64-linux)
      racc (~> 1.4)
    racc (1.6.2)
    sorbet (0.5.10601)
      sorbet-static (= 0.5.10601)
    sorbet-static (0.5.10601-universal-darwin-14)
    sorbet-static (0.5.10601-universal-darwin-15)
    sorbet-static (0.5.10601-universal-darwin-16)
    sorbet-static (0.5.10601-universal-darwin-17)
    sorbet-static (0.5.10601-universal-darwin-18)
    sorbet-static (0.5.10601-universal-darwin-19)
    sorbet-static (0.5.10601-universal-darwin-20)
    sorbet-static (0.5.10601-universal-darwin-21)
    sorbet-static (0.5.10601-universal-darwin-22)
    sorbet-static (0.5.10601-x86_64-linux)

PLATFORMS
  ruby
  x86_64-darwin
  x86_64-linux

DEPENDENCIES
  nokogiri (~> 1)
  sorbet

BUNDLED WITH
   2.3.12

We can update bundler with bundle update --bundler, which applies this diff to Gemfile.lock:

diff --git a/Gemfile.lock b/Gemfile.lock
index 9ed5406..6f7cfeb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -33,4 +33,4 @@ DEPENDENCIES
   sorbet
 
 BUNDLED WITH
-   2.3.12
+   2.4.2

If we then bundle update --conservative nokogiri we see this diff:

diff --git a/Gemfile.lock b/Gemfile.lock
index 6f7cfeb..7fb035c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,13 +1,9 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    mini_portile2 (2.6.1)
-    nokogiri (1.12.0)
-      mini_portile2 (~> 2.6.1)
+    nokogiri (1.13.10-x86_64-darwin)
       racc (~> 1.4)
-    nokogiri (1.12.0-x86_64-darwin)
-      racc (~> 1.4)
-    nokogiri (1.12.0-x86_64-linux)
+    nokogiri (1.13.10-x86_64-linux)
       racc (~> 1.4)
     racc (1.6.2)
     sorbet (0.5.10601)
@@ -24,8 +20,8 @@ GEM
     sorbet-static (0.5.10601-x86_64-linux)
 
 PLATFORMS
-  ruby
   x86_64-darwin
+  x86_64-darwin-21
   x86_64-linux
 
 DEPENDENCIES

I understand that the ruby platform was removed due to sorbet being in our lockfile and #5807 but I'm not sure why x86_64-darwin-21 was added given that x86_64-darwin is already present.

What were you expecting to happen?

Nokogiri to be updated and (due to #5807) the ruby platform be removed from the lock file.

What actually happened?

Nokogiri was updated, the ruby platform was removed from the lock file but unexpectedly the x86_64-darwin-21 platform was added.

If not included with the output of your command, run bundle env and paste the output below

Environment

Bundler       2.4.2
  Platforms   ruby, x86_64-darwin-21
Ruby          2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd) [x86_64-darwin-21]
  Full Path   /Users/owenstephens/.rbenv/versions/2.7.6/bin/ruby
  Config Dir  /Users/owenstephens/.rbenv/versions/2.7.6/etc
RubyGems      3.3.26
  Gem Home    /Users/owenstephens/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0
  Gem Path    /Users/owenstephens/.gem/ruby/2.7.0:/Users/owenstephens/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0
  User Home   /Users/owenstephens
  User Path   /Users/owenstephens/.gem/ruby/2.7.0
  Bin Dir     /Users/owenstephens/.rbenv/versions/2.7.6/bin
Tools
  Git         2.38.1
  RVM         not installed
  rbenv       rbenv 1.2.0
  chruby      not installed

Bundler Build Metadata

Built At          2023-01-01
Git SHA           2cd3ed45bf
Released Version  true
@owst
Copy link
Author

owst commented Jan 5, 2023

Great, thanks for the fast fix @deivid-rodriguez!

@deivid-rodriguez
Copy link
Member

No problem, thanks for report this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants