Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Fix another silent rubygems issue #7493

Merged
1 commit merged into from
Dec 16, 2019
Merged

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Dec 16, 2019

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

The problem was that we still have some issues where using the gem script on a bundler context is silenced.

What was your diagnosis of the problem?

My diagnosis was that bundle exec adds -rbundler/setup to RUBYOPT which silences rubygems output, and that we need to reset rubygems UI after that so that if we end up shelling out to gem, it is not silent. The previous approach worked for loading the gem script in-process, but didn't work in other case.

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

My fix is to reset rubygems UI right after bundler/setup.

Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem independently of the rubygems version being run, but we can probably also fix this more cleanly inside the gem script by adding something like Gem::DefaultUserInteraction.ui = Gem::ConsoleUI.new at the top of the script.

Fixes #7490.

We might be shelling out to rubygems in a `bundle exec` context. In the
case where we don't shell out to the `gem` binstub directly, the
previous trick wouldn't work.

Instead, reset the rubygems ui right after `bundler/setup`, so that if
we end up shelling out to rubygems, it will use its default shell
(non-silent).

The best place to fix this would probably be right inside the `gem`
script, but even if we fix it there, we'll need workarounds for previous
rubygems versions inside `bundler` so I think this is good for now.
@deivid-rodriguez
Copy link
Member Author

@doudou Does this work for you?

@doudou
Copy link

doudou commented Dec 16, 2019

@doudou Does this work for you?

Seems to work, yes. Thanks !

@deivid-rodriguez
Copy link
Member Author

Thanks for confirming! I'll get this in and try to get a bug fix release as soon as possible.

@bundlerbot merge

@deivid-rodriguez deivid-rodriguez added this to the 2.1.1 milestone Dec 16, 2019
ghost pushed a commit that referenced this pull request Dec 16, 2019
7493: Fix another silent rubygems issue r=deivid-rodriguez a=deivid-rodriguez

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

The problem was that we still have some issues where using the `gem` script on a `bundler` context is silenced.

### What was your diagnosis of the problem?

My diagnosis was that `bundle exec` adds `-rbundler/setup` to RUBYOPT which silences `rubygems` output, and that we need to reset `rubygems` UI after that so that if we end up shelling out to `gem`, it is not silent. The previous approach worked for loading the `gem` script in-process, but didn't work in other case.

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

My fix is to reset rubygems UI right after `bundler/setup`.

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem independently of the rubygems version being run, but we can probably also fix this more cleanly inside the `gem` script by adding something like `Gem::DefaultUserInteraction.ui = Gem::ConsoleUI.new` at the top of the script.

Fixes #7490.


Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Dec 16, 2019

Build succeeded

@ghost ghost merged commit 8ce0824 into master Dec 16, 2019
@ghost ghost deleted the fix_another_silent_rubygems_issue branch December 16, 2019 20:43
@doudou
Copy link

doudou commented Dec 17, 2019

Thanks for confirming! I'll get this in and try to get a bug fix release as soon as possible.

@bundlerbot merge

Hi ...

Would you maybe have an ETA on how fast the point release might get out ? It's pretty bad for us.

@deivid-rodriguez
Copy link
Member Author

Next day or two.

deivid-rodriguez pushed a commit that referenced this pull request Dec 17, 2019
7493: Fix another silent rubygems issue r=deivid-rodriguez a=deivid-rodriguez

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

The problem was that we still have some issues where using the `gem` script on a `bundler` context is silenced.

### What was your diagnosis of the problem?

My diagnosis was that `bundle exec` adds `-rbundler/setup` to RUBYOPT which silences `rubygems` output, and that we need to reset `rubygems` UI after that so that if we end up shelling out to `gem`, it is not silent. The previous approach worked for loading the `gem` script in-process, but didn't work in other case.

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

My fix is to reset rubygems UI right after `bundler/setup`.

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem independently of the rubygems version being run, but we can probably also fix this more cleanly inside the `gem` script by adding something like `Gem::DefaultUserInteraction.ui = Gem::ConsoleUI.new` at the top of the script.

Fixes #7490.

Co-authored-by: David Rodríguez <[email protected]>
(cherry picked from commit f54ae4f)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gem content NAME outputs nothing after upgrading to 2.1.0
2 participants