Repository navigation
Keep mirror settings readable by Bundler 4.0 - #10075
Merged
Merged
Conversation
Member
|
Thanks for the detailed report. I've fixed the plugin index on the read side in #10076 and #10077, so could you drop 89149df and keep only the mirror change here? With a gemrc on RubyGems < 4.1, the minimal serializer replaces Bundler's copy and dumps |
top-sigrid
force-pushed
the
pw/yaml-readable-by-bundler-4.0
branch
from
November 17, 2026 09:03
89149df to
302be3f
Compare
Contributor
Author
|
Thanks for looking into this so quickly. I dropped 89149df so this PR only has the mirror change now. Title and description are updated. Good point with the gemrc case, locally i had only checked without a gemrc. |
Member
|
Thanks for the quick update! I'll ship this in 4.1.1. |
This was referenced Nov 24, 2026
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.
What was the end-user or developer problem that led to this PR?
Bundler 4.1 writes
.bundle/configwith the fullGem::YAMLSerializer, which quotes every key containing:. Bundler 4.0 reads the config with the minimal serializer of RubyGems 3.5 to 4.0, which keeps those quotes as part of the key. So Bundler 4.0 silently ignores a mirror that Bundler 4.1 configured.Projects locked to different Bundler versions share the global config, because Bundler switches to the version in
BUNDLED WITH.Fixes #10073 together with #10076 and #10077, which fix the plugin index part on the read side.
What is your fix for the problem, implemented in this PR?
A
:in a key no longer forces quotes when the key starts with a letter and no:in it is followed by a space or ends it. Psych leaves keys like these unquoted too, and they can't be read as anything but the same string. Every other key with:keeps its quotes, for example1:20or2001-12-14 21:59:43, which Psych would read as a number and a time. Values keep their quotes too, since the minimal serializer strips those. This also applies to other files RubyGems writes, so hosts in~/.gem/credentialsare now written unquoted, as Psych writes them.A config that Bundler 4.1.0 has already written keeps its format until a Bundler with this change writes it again, e.g. on the next
bundle config set.I checked it end to end on Ruby 4.0.9 with a bundler gem built from this branch, using the reproduction from #10073:
The RubyGems tests pass, and the YAML tests also with
RUBYGEMS_USE_PSYCH=true. The related Bundler specs (settings, mirrors,bundle config, fetcher, compact index and dependency API installs) pass withRGV=.andRGV=system.Make sure the following tasks are checked