Skip to content
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-modules: eliminate BUNDLE_PATH #81612

Closed

Conversation

thefloweringash
Copy link
Member

Newer versions of bundler use a "ruby scope" when installing into a
custom path (set via BUNDLE_PATH). For example, ruby 2.7 with bundler
2 will install gems into "$BUNDLE_PATH/ruby/2.7.0". This is not
compatible with setting bundler's path to $GEM_HOME, which contains
gems directly.

The ruby infrastructure doesn't need to direct bundler where to
install gems, only where to find already installed gems. The simplest
configuration that works with all current versions of ruby and bundler
is to stop using bundler's path, and rely on GEM_HOME and GEM_PATH.

Motivation for this change

Make the ruby infrastructure nixpkgs compatible with bundler 2.

Related PRs and issues: #81442, #78242

I have not tested this beyond a few simple tests.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Newer versions of bundler use a "ruby scope" when installing into a
custom path (set via BUNDLE_PATH). For example, ruby 2.7 with bundler
2 will install gems into "$BUNDLE_PATH/ruby/2.7.0". This is not
compatible with setting bundler's path to $GEM_HOME, which contains
gems directly.

The ruby infrastructure doesn't need to direct bundler where to
install gems, only where to find already installed gems. The simplest
configuration that works with all current versions of ruby and bundler
is to stop using bundler's `path`, and rely on GEM_HOME and GEM_PATH.
@manveru
Copy link
Contributor

manveru commented Mar 3, 2020

I really like that approach, I'm just worrying this will break if a user has set BUNDLE_PATH in their environment, since this won't remove it. So maybe it'd be safest to actively delete it from the env?

@thefloweringash
Copy link
Member Author

This is now part of #81442, which is still in progress. Closing.

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.

None yet

2 participants