Don't update bundler to a prerelease unless asked for one - #9869
Merged
Conversation
`bundle update --bundler ">= <version>"` crashes with "comparison of NilClass with Bundler::StubSpecification failed" when the requirement is satisfied locally but by nothing on rubygems.org. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`bundle update --bundler` and `bundle lock --update --bundler` defaulted to `> 0.a`, so publishing 4.1.0.beta1 moved every project onto the beta. Default to `>= <running version>` and skip prerelease candidates unless the requirement mentions one, the same way `gem update --system` does. Anyone already running a prerelease keeps it, since the floor makes the default requirement a prerelease requirement in that case. #9867 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`bundle update --bundler --pre` did nothing: the self manager only looked at whether the requirement named a prerelease, so it never considered one and never restarted, leaving the flag silently ignored. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Auto switching restarts into whatever prerelease the lockfile names, so the requirement derived from the running version is a prerelease one and a bare `--bundler` keeps the prerelease. Naming the target explicitly is the way out, and nothing pinned that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both man pages said a bare `--bundler` picks the latest version, which no longer holds, and neither showed that a version or requirement can be passed. That argument is now the way to reach a prerelease. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 4.1.0.beta1 was published, a bare
bundle update --bundlerorbundle lock --update --bundlermoves the project onto the beta. The default requirement was> 0.a, and that.ais what tells the resolver andBundler::SelfManagerto consider prereleases.The default is now
>= <the running version>, the shapegem update --systemuses, and prerelease candidates are skipped unless the requirement names one or--preis given. A stable bundler therefore only moves to another stable release, while anyone already on a prerelease keeps it, since the floor is itself a prerelease requirement then. Naming a version, as in--bundler 4.0.20, is how someone whose lockfile is stuck on a beta gets back, and both man pages now say so.Two smaller fixes fell out:
find_latest_matching_speccompared a spec againstnilwhen nothing on rubygems.org satisfied the floor, and--prewas silently ignored for--bundler.Fixes #9867
Generated with Claude Code