Skip to content

Conversation

@hsbt
Copy link
Member

@hsbt hsbt commented Apr 18, 2024

What was the end-user or developer problem that led to this PR?

The current --default option is confused for RubyGems users.

This option is special behavior for default gems. But I'm not sure why it only generate executable, not copy library files and other processes.

What is your fix for the problem, implemented in this PR?

It leads complicated environment and there is no merit for them. I don't allow that users install gem as default gems from core maintainer's view.

Finally, I'll show deprecated message and removed code about this option from rubygems.

Closes #7005.

Make sure the following tasks are checked

@hsbt hsbt force-pushed the deprecate-default-option branch 6 times, most recently from 0f34a74 to dc83e45 Compare April 18, 2024 09:13
@deivid-rodriguez
Copy link
Contributor

@hsbt I agree with this approach. The --default option is problematic and causes broken installs. The easiest option would be to remove it and consider default gems fixed. Is this ready for review?

@hsbt
Copy link
Member Author

hsbt commented Apr 25, 2024

👌 It's ready for review now.

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now this PR is deprecating the flag, but changing the behavior by making the flag a noop and install the gem normally, correct?

I believe this may be acceptable, because I don't see how the current implementation is helpful. However, we currently document exactly what the flag does, so may be potentially useful for someone, and the more conservative approach would be to first deprecate the flag without changing behavior, and then remove everything.

I think the latter option is preferable, but open to do it differently.

)
installer.install
File.delete installer.spec_file
installer.write_default_spec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will install a full copy of bundler in the standard $GEM_HOME. I don't think it's a problem per se, but it makes Bundler inconsistent with other default gems with executables provided with Ruby (for example, irb, which includes a placeholder gem directory with just the executable).

We could try to iterate on this but perhaps for now it's better to not use Gem::Installer at all here and create the files necessary (executables, and gemspec) manually, to keep the exact same folder structure gem update --system creates now.

"Add the gem's full specification to",
"specifications/default and extract only its bin") do |v,_o|
options[:install_as_default] = v
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use deprecate_option here, to also give a runtime deprecation message? The way it is right now, I think it only appears as deprecated in documentation.

@hsbt hsbt self-assigned this Jun 18, 2024
@simi
Copy link
Contributor

simi commented Jul 31, 2024

🤔 It seems it was never finished feature (according to #566).

@hsbt hsbt force-pushed the deprecate-default-option branch from dc83e45 to 30f3881 Compare August 1, 2024 08:52
@simi
Copy link
Contributor

simi commented Aug 1, 2024

@headius is it ok to remove? Isn't that something JRuby specific? 🤔

@headius
Copy link
Contributor

headius commented Aug 1, 2024

Wow, this goes back a ways.

When I originally added default gem support, I had intended --default to basically perform an install directly into the Ruby standard library location. Unfortunately I never finished that work and others who were more aware of how CRuby organizes its libraries were not available to help me fill in the blanks.

As it is now – a partially-implemented feature – it's obviously not very useful.

It would have been nice to get it fully working, but even then it's not something that should be user-facing; what we really want is something that can be used by Ruby implementers to install default gems into the standard library. CRuby and JRuby both have their own custom scripts to do this. TruffleRuby just copies out of the CRuby repository. None of these approaches are great.

I think it's fine to remove --default from RubyGems, but perhaps in its stead @hsbt and @nobu and I need to work on making our default gem installation logic more standard and shared.

@headius
Copy link
Contributor

headius commented Aug 1, 2024

it's not something that should be user-facing

This may not entirely be true; there are probably users that would like to alter or update the "default" gems in their Ruby installs, and currently there's no way to do that without manually manipuating those gems' files. But I'm not sure what that functionality should look like.

@hsbt hsbt force-pushed the deprecate-default-option branch 5 times, most recently from aab2062 to 72b0e36 Compare January 16, 2025 07:24
@hsbt hsbt force-pushed the deprecate-default-option branch from 72b0e36 to 9e8100a Compare April 10, 2025 07:03
@hsbt hsbt force-pushed the deprecate-default-option branch from 9e8100a to 6004b8c Compare June 27, 2025 04:58
@hsbt hsbt force-pushed the deprecate-default-option branch from 6004b8c to be47f6d Compare October 16, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot load such file -- /Users/jedrek/.rvm/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/bundler-2.4.19/exe/bundle (LoadError)

4 participants