Skip to content

ruby-modules: eliminate BUNDLE_PATH#81612

Closed
thefloweringash wants to merge 2 commits intoNixOS:stagingfrom
thefloweringash:bundler-2-compat
Closed

ruby-modules: eliminate BUNDLE_PATH#81612
thefloweringash wants to merge 2 commits intoNixOS:stagingfrom
thefloweringash:bundler-2-compat

Conversation

@thefloweringash
Copy link
Copy Markdown
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.

@ofborg ofborg bot added 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Mar 3, 2020
@thefloweringash thefloweringash changed the base branch from master to staging March 3, 2020 15:07
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
Copy Markdown
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
Copy Markdown
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

Labels

6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants