Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Jan 30, 2024

What was the end-user or developer problem that led to this PR?

Since Bundler 2.5.0, we automatically lock all possible "RUBY" platforms (not windows, not java) where the resolve we found for the current platform is also valid.

I added some code though to avoid locking too many platforms in darwin, where no platform specific gems for each darwin version are release, so it's enough to lock x86_64-darwin rather than the exact running platform (things like x86_64-darwin-19).

However, this code had a bug where the current platform would also be incorrectly removed when it's x86_64-linux-musl.

What is your fix for the problem, implemented in this PR?

Musl support in RubyGems introduced an exception in Gem::Platform#=== commutativity and turns out the order should be the opposite to the one I was using to not get this case wrong.

Fixes #7432.

Make sure the following tasks are checked

end
end

it "does not add current platform if there's a more specific one already locked" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a less specific platform is locked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did not explain this case correctly. In order to avoid too many platforms from being locked (case of x86_64-darwin-18, x86_64-darwin-19, x86_64-darwin-20, etc), I made it so that if one of the resolved platforms (say, x86_64-darwin) is compatible with the current platform but less specific, then we we'll keep that and don't add the current specific platform. I will reword it to make it clear!

@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/musl branch 2 times, most recently from 1f1579c to 0bfabf5 Compare January 31, 2024 12:55
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review January 31, 2024 17:39
@deivid-rodriguez deivid-rodriguez merged commit 10ac625 into master Jan 31, 2024
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/musl branch January 31, 2024 19:07
@flavorjones
Copy link
Contributor

@deivid-rodriguez Thanks so much for fixing this! ❤️

@Andarina

This comment was marked as spam.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

on musl systems, bundler does not include the relevant musl native gem platform in the lock file

5 participants