Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Feb 21, 2025

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

I noticed that since #8489, we will print the following log message when Bundler is adding the current platform to the lockfile:

Found changes from the lockfile, re-resolving dependencies because your lockfile does not include the current platform, you added a new platform to your gemfile

while before it would print

Found changes from the lockfile, re-resolving dependencies because your lockfile does not include the current platform

I think the previous message is better because you're not explicitly adding anything.

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

Restore the previous message by not adding the local platform to the @new_platforms array when the addition is not explicit.

On top of that, I changed the message when the addition is explicit (bundle lock --add-platform) from

Found changes from the lockfile, re-resolving dependencies because you added a new platform to your gemfile

to

Found changes from the lockfile, re-resolving dependencies because you are adding a new platform to your lockfile

Finally, I also included a few changes to make adding and removing platforms more consistent.

Make sure the following tasks are checked

Current it says "you added a new platform to your gemfile", but that's
not actually the case here.
And make it consistent with platform additions.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/improve-platform-changes-error-message branch from d02c254 to ad657ce Compare February 21, 2025 10:55
This message is printed when running `bundle lock --add-platform`. This
command affects the lockfile, not the gemfile, and I think it's better
to use "You are adding" rather than "You added", because the addition is
happening during the current invocation (as opposed to other log
messages that talk about a change made to the Gemfile prior to running
the command).
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/improve-platform-changes-error-message branch from ad657ce to aba1e55 Compare February 21, 2025 11:30
@deivid-rodriguez deivid-rodriguez changed the title Improve log messages when lockfile platforms are added or removed Improve log messages when lockfile platforms are added Feb 21, 2025
@deivid-rodriguez deivid-rodriguez merged commit 1892fb9 into master Feb 24, 2025
92 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/improve-platform-changes-error-message branch February 24, 2025 12:48
deivid-rodriguez added a commit that referenced this pull request Mar 11, 2025
…orm-changes-error-message

Improve log messages when lockfile platforms are added

(cherry picked from commit 1892fb9)
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.

2 participants