-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add overwrite-exec option to Install/Update #2338
Conversation
Thanks for the PR @MSP-Greg! I Prefer Maybe we can add a better test too that checks functionality and not only to test the flag is being passed. |
@bronzdoc @duckinator @jrochkind So to confirm, you want the option to be named I purposely did not want that, as I have written two tests that check the option as pertains to exec's. |
I have no opinion what the arg should be called, and my specific issue/use case was about the "overwrite executable" thing -- I don't know enough about the other things that might be asked to know if "answer yes to everything" is a good idea or not. I'd have to leave those to people who understand the whole system better. For |
My follow up asked two yes/no questions. I'll leave it at that...
|
I'm against to merge this strongly. Its root cause is https://bugs.ruby-lang.org/issues/5060. I try to fix this problem with Ruby 2.6.0. |
FULL.STOP The original issue was a clear & simple use case that I had previously come across. In this PR, I proposed a solution matching the use case. Obviously, since it's an option, it's not changing default behavior. Two people suggested that it should be expanded to Then, it's suggested that the issue lies in ruby. But then it's suggested that the issue may also be affected by Feel free to ping me once the solution to the original issue has been determined... Greg |
I gotta admit I don't understand what's going on -- I don't really understand why it was asking the interactive y/n in the first place. But I know it's really annoying not to be able to put "gem install bundler" in a non-interactive batch script. If I understand right, it would not be asking the interactive y/n for But I think it would still be asking that interactive y/n in some cases? After all, it is in the code, so there must be some cases where it's triggered. If that's true, I still think an option to avoid it, so you can safely |
That makes two of us... From the doc on Gem::Installer#check_executable_overwrite - 'If filename exists and @bin_dir is Gem.default_bindir (/usr/local) the user is consulted.', that encompassed many/most of the gem executables if they're not installed to |
If you type 'y', the original file under the |
Are you referring to bundler, or any gem with an exec? Regardless, I don't think I've seen the behavior you describe. I essentially have a duplicate of Appveyor's environment. At present, all Ruby versions are fully updated. I tried removing, installing old, installing again, jump thru any hoop I cold think of, and I couldn't get the 'overwrite exec' prompt. Recently I worked with several repos on Appveyor scripts, and many updated rake. I needed to add the I mentioned it here or in the issue, but in general.
Would this PR be acceptable if the option name was changed to match that (and also left as an install/update option)? |
Aha, I get it, thanks @hsbt . So you will generally get this prompt if you are overwriting a non-ruby file, generally. Because of the way bundler is installed as a rubygems default now (and rubygems is installed as a ruby default), in this case it applies to /usr/local/bin/bundler. But maybe you aren't supposed to be here. I still think it might be useful to allow batch execution of |
Just looking at rbinstall.rb again, and thinking of this also involving bundler...
Ok, but if that's fixed, will it be backported to all ruby versions currently in use on Travis & Appveyor? For at least a while, there should to be an option that will be picked up when those versions have RubyGems updated, as both Travis & Appveyor seem to update RubyGems as needed. |
…bles. It resolved the conflict issues when invoking `gem i rdoc` and the binstub issues with Bundler and Rails. [Bug #5060][ruby-core:38257][Fix GH-2023] * rubygems/rubygems#2338 * heroku/heroku-buildpack-ruby#829 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
…bles. It resolved the conflict issues when invoking `gem i rdoc` and the binstub issues with Bundler and Rails. [Bug ruby#5060][ruby-core:38257][Fix rubyGH-2023] * rubygems/rubygems#2338 * heroku/heroku-buildpack-ruby#829 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This issue was fixed at Ruby 2.6. And We should choose the approaches used by |
Description:
Add
--overwrite-exec
option to gem install/update, allowing use from scripts without UI promptTasks:
I will abide by the code of conduct.