-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby: Gemfile.lock lockfile maintenance removes locked platforms #14156
Comments
In general, Renovate's approach with Renovate's lock file maintenance is:
If |
I am already working on a PR. I also will investigate a bit how new that flag in bundler is. Are there any constraints on what bundler versions must be supported? |
We try to keep supporting older versions of package managers if there's little impact to us, but otherwise if it's a burden then we fall back to supporting whatever the package manager's own support or LTS policy is. |
I am first trying to get a reproducible test case, but I never worked with jest or snapshots. I'll open a PR and try to add everything there. |
The bundler manager drops the Gemfile.lock before doing lock file maintenance but bundler stores additional platforms for resolving only in the lock file, such as `x86_64-darwin-20`. These additional platforms and the resolved gems for these platforms are lost when the lock file deleted. The newly generated platform will only contain the `x86_64-linux` (or whatever the current platform is when renovate is run). This commit stops the manager from removing the lock file and instead calls `bundler lock --update` to update the existing lock file in-place. Fixes renovatebot#14156
I created #14159 with the necessary changes, and tested in a real repository. I wasn't able to find any test to extend, to ensure the platforms in the Gemfile.lock are preserved. |
🎉 This issue has been resolved in version 31.80.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The platform was removed by renovatebot. See [1]. [1]: renovatebot/renovate#14156
How are you running Renovate?
WhiteSource Renovate hosted app on github.com
If you're self-hosting Renovate, tell us what version of Renovate you run.
No response
Please select which platform you are using if self-hosting.
No response
If you're self-hosting Renovate, tell us what version of the platform you run.
No response
Was this something which used to work for you, and then stopped?
It used to work, and then stopped
Describe the bug
Renovatebot seems to remove additional platforms from the Gemfile.lock when doing lockfile maintenance.
See the following example PR: https://github.com/jgraichen/test-renovate-gemfile-platform/pull/2/files
This does not happen on regular version bumps: https://github.com/jgraichen/test-renovate-gemfile-platform/pull/3/files
I saw that in a few projects. Platforms were removed at least since Feb 7, and it appears to have worked at least before Jan 31:
I'd suspect that #14005 changed the behavior. This is quite an issue for multi-platform ruby projects, as renovate basically removes all platforms on every Gemfile.lock maintenance.
With bundler, extra platforms can be added by developers (e.g.
bundle lock --add-platform x86_64-darwin-19
). The lock file will contain all resolved gems for all platforms, as they can have different dependencies.For example, see here. The "ruby" platform (no native gems) has more dependencies, as it will need to compile nokogiri (libxml bindings) locally. Other platforms, such as x86_64-linux, can download the precompiled gems from rubygems.org.
As far as I understood #14005, this restores the behavior of removing the Gemfile.lock before running
bundle lock
again. Unfortunately, this will throw away all added platforms and will generate new Gemfile.lock for only the local platform (x86_64-linux as renovate is running on Linux).When doing lock file maintenance with a Gemfile.lock, the lock file probably should not be deleted. Instead,
bundle lock --update
(without arguments) can be used to update all gems in an existing Gemfile.lock. That will not install any gems, but only update the lock file.Relevant debug logs
Logs
Copied from (https://app.renovatebot.com/dashboard).
Have you created a minimal reproduction repository?
I have linked to a minimal reproduction repository in the bug description
The text was updated successfully, but these errors were encountered: