diff options
| author | Mike Dalessio <mike.dalessio@gmail.com> | 2024-04-15 13:17:54 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-04-17 18:17:12 +0000 |
| commit | 98c84ef42c61b84c1745bbc5a1ceff1ce00999d9 (patch) | |
| tree | cbc733f1283ea8249750ce2fb4842db05f871860 /lib | |
| parent | 814dedcee248667802b98ea1ba89cbeac171044f (diff) | |
[rubygems/rubygems] Excluding local platform from lockfile should not affect musl vs gnu case
This case is for not locking things like `arm-darwin-23` when the
lockfile already includes `arm-darwin`, so that we don't infinitely keep
redundant versioned platforms in the lockfile when not necessary.
We detect this with `Gem::Platform#===`. For example,
`Gem::Platform.new("arm-darwin-23") === Gem::Platform.new("arm-darwin")`
but they're not `==`.
However, in the case of `-musl` vs `-gnu`, those act as the platform
"version", but `===` is not commutative for them. This is explained in
`===` docs.
We only want to exclude the local platform in situations when
`Gem::Platform#===` is actually commutative.
https://github.com/rubygems/rubygems/commit/8099c4face
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/spec_set.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 96e1403bf7..2933d28450 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -65,7 +65,7 @@ module Bundler platforms.concat(new_platforms) - less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform } + less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform } platforms.delete(Bundler.local_platform) if less_specific_platform platforms |
