ruby / ruby/rubygems

Lock normalization doesn't persist across updates

Open
#8,454 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

Describe the problem as clearly as you can

In this doc, it's mentioned that one should call normalize-lock before add-checksums.

https://bundler.io/blog/2024/12/19/bundler-v2-6.html#:~:text=Should%20I%20take%20any%20other%20steps%20before%20enabling%20this%20feature%3F

Which works great. However, if a gem in a new version adds new platforms, the bundle install doesn't renormalize, so you end up out of sync again.

Did you try upgrading rubygems & bundler?

Yes, on latest of both (2.6.3)

Post steps to reproduce the problem

Gemfile to start:

# frozen_string_literal: true

source 'https://rubygems.org'

gem 'nokogiri', '1.16.7'

Then run the following:

  • bundle install; bundle lock --add-platform ruby; bundle lock --normalize-platforms; bundle lock --add-checksums
  • commit those into git.
  • update nokogiri in the Gemfile turning that into:
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'nokogiri', '1.18.2'
  • run bundle install
  • commit that into git
  • then run bundle lock --normalize-platforms

Notice the lock is now now changed as new platforms were added by nokogiri, but not auto-added to the lock.

Which command did you run?

See above

What were you expecting to happen?

Once you normalize once per docs, it is kept up to date automatically (especially to avoid running into https://github.com/rubygems/rubygems/issues/8391 if someone installs from a different platform but already had

What actually happened?

New gem platforms were not auto-added to the lock

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Bundler lock workflow exercised by the reported commands, using the Gemfile and lockfile from the nokogiri 1.16.7 to 1.18.2 reproduction. Run bundle install, bundle lock --normalize-platforms, and the other listed lock commands; done means newly introduced gem platforms are automatically included after updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.