-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
bundler: 1.17.3 -> 2.1.4 #81442
bundler: 1.17.3 -> 2.1.4 #81442
Conversation
@GrahamcOfBorg test redmine.mysql |
@manveru did you have any success using the bundlerEnv, etc, with this change? As I understand it, nix's ruby infrastructure doesn't yet handle bundler 2. Hopefully the changes required are minimal. The first thing I've found is that bundler seems to append a
It doesn't add the suffix when I applied this horrible hack to see if there were further problems, and so far things appear to be working. diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix
index 0812ff590a5..c7b021bee67 100644
--- a/pkgs/development/ruby-modules/bundled-common/default.nix
+++ b/pkgs/development/ruby-modules/bundled-common/default.nix
@@ -107,7 +107,10 @@ let
postBuild = genStubsScript (defs // args // {
inherit confFiles bundler groups;
binPaths = envPaths;
- }) + lib.optionalString (postBuild != null) postBuild;
+ }) + lib.optionalString (postBuild != null) postBuild + ''
+ mkdir $out/${ruby.gemPath}/${ruby.rubyEngine}
+ ln -s .. $out/${ruby.gemPath}/${ruby.rubyEngine}/${ruby.version.libDir}
+ '';
meta = { platforms = ruby.meta.platforms; } // meta; I'd really like to spend some time to look at this properly, but I find my hands full at the moment. Thank you for working on this. |
I haven't used bundlerEnv other than for testing such changes in quite a while, so excuse me if I'm not really up to speed on what's happening in Bundler-land. I checked that Ruby could find the gems when they are required, and that Looking into this a bit more, we might be able to shift to using the I really can't promise I'll have the time or motivation required to migrate this, but at this point I'm not sure we can stick with older Bundler for much longer anyway, and I would much prefer having a simpler setup. |
It seems like removing |
@GrahamcOfBorg test redmine.mysql |
@manveru you’re missing a source of gems in the bin stub generator, which is breaking asciidoctor which is required for the test-vm closure. In my PR I set nixpkgs/pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb Lines 37 to 38 in 75473a4
This is enough to start the test vm, but redmine itself fails due to requiring bundler 1.x. This is probably the auto switch feature added in bundler2. Changing the bundler version in the lock file like so: diff --git a/pkgs/applications/version-management/redmine/Gemfile.lock b/pkgs/applications/version-management/redmine/Gemfile.lock
index 806847a298e..66326b28235 100644
--- a/pkgs/applications/version-management/redmine/Gemfile.lock
+++ b/pkgs/applications/version-management/redmine/Gemfile.lock
@@ -225,4 +225,4 @@ DEPENDENCIES
yard
BUNDLED WITH
- 1.16.3
+ 2.1.4 And now the redmine tests pass. It seems like we have two options:
The first is less complex but is harsher on out of tree consumers which still specify bundler 1.x in their gemfiles. The second is an easier upgrade path, but getting away from bundler 1’s mysterious breakage is what started this. |
I’ve done some more digging, but haven’t reached the bottom of this yet. The bundle version switching logic happens in rubygems (!!). When activating the “bundler” gem it will check for a Gemfile.lock (among other things) and use the version specified there. This logic will only apply to stubs that activate an ambient bundler like So to be compatible with version switching, we can provide both bundler 1.x and 2.x in the default I’ll keep digging. |
@thefloweringash I updated all the |
@GrahamcOfBorg test redmine.mysql |
Nevermind, the bin stubs are still broken... setting Will work on a fix. |
So this makes |
@GrahamcOfBorg test redmine.mysql |
@manveru I upgraded an existing ping @NixOS/nixos-release-managers |
cherry picked to release branch! |
@manveru Is it expected that we get this sudo warning from bundler when using bundlerEnv? Is there anything we can do about it?
|
I have the same issue here, I did not find any way to silence those warning. I have the feeling that's something directly in bundler that would requires some tweaks in it to silence this message. |
Motivation for this change
Bundler in a wrappedRuby was broken. Bundler is pretty outdated, so this might fix other issues too (and cause more... who knows :)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)