-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support setup --destdir option for bundler install #2106
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
Conversation
| mkdir_p bundler_spec.bin_dir | ||
| bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) } | ||
| bundler_bin_dir = File.join( | ||
| options[:destdir], Gem.default_dir, 'gems', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I searched in RubyGems source code, but could not find a method or
constant that returns this gems directory, it seems hardcoded at other
places too.
In Ruby source code a literal string is used too if I'm correct:
https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v2_4_2/tool/rbinstall.rb?revision=59899&view=markup#l724
| @@ -143,6 +143,22 @@ def test_install_default_bundler_gem | |||
| assert_path_exists 'default/gems/bundler-audit-1.0.0' | |||
| end if Gem::USE_BUNDLER_FOR_GEMDEPS | |||
|
|
|||
| def test_install_default_bundler_gem_with_destdir | |||
| Gem.instance_variable_set :@default_dir, nil | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fan of this code, but in Gem::TestCase.setup we have the
following:
@default_dir = File.join @tempdir, 'default'
Gem.instance_variable_set :@default_dir, @default_dir
I understand why it's done this way and don't think we should change
it. This makes testing --destdir complicated, and unless there is a
nicer solution, I concluded it might be acceptable to resort to using
Gem.instance_variable_set and use @tempdir as the value for
--destdir option.
|
Unfortunately I was too slow to finish this patch and missed 2.7.3 Without this, If you fix the problem for the gem specification, then you would get |
|
What issue is this trying to address? |
Restoring Please see this comment for a simple example of an error we may get: Since then I was able to make the build pass on windows: But it was laborious and I'm even less satisfied with the new code --- lib/rubygems/commands/setup_command.rb.orig
+++ lib/rubygems/commands/setup_command.rb
@@ -148,8 +148,6 @@ By default, this RubyGems will install g
remove_old_lib_files lib_dir
- install_default_bundler_gem
-
say "RubyGems #{Gem::VERSION} installed"
regenerate_binstubs if options[:regenerate_binstubs]
@@ -217,7 +215,6 @@ By default, this RubyGems will install g
@bin_file_names = []
executables = { 'gem' => 'bin' }
- executables['bundler'] = 'bundler/exe' if Gem::USE_BUNDLER_FOR_GEMDEPS
executables.each do |tool, path|
say "Installing #{tool} executable" if @verbose
Do you want me to open an issue about the Would a feature to disable installing bundler default gem and |
No description provided.