Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.36k stars 9.73k forks source link

`brew doctor` spews a list of portable-ruby paths for no apparent reason #3184

Closed chdiza closed 7 years ago

chdiza commented 7 years ago

A brew update went just fine. A subsequent brew doctor spewed the following (in addition to normal output). What good is a list of files and directories, without any associated messages?

portable-ruby/2.3.3/
portable-ruby/2.3.3/.brew/
portable-ruby/2.3.3/.brew/portable-ruby.rb
portable-ruby/2.3.3/bin/
portable-ruby/2.3.3/bin/erb
portable-ruby/2.3.3/bin/gem
portable-ruby/2.3.3/bin/irb
portable-ruby/2.3.3/bin/rdoc
portable-ruby/2.3.3/bin/ri
portable-ruby/2.3.3/bin/ruby
portable-ruby/2.3.3/ChangeLog
portable-ruby/2.3.3/COPYING

... And so on, the entire contents of the portable-ruby folder. No "these are unlinked" message or anything of the sort. The rest of the normal output was that I'm ready to brew.

Here's config:

HOMEBREW_VERSION: 1.3.3-2-g7d720e8
ORIGIN: https://github.com/Homebrew/brew
HEAD: 7d720e8fac6975aa402bf69361507982fbfc49ff
Last commit: 5 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 625b75eb11710dd77e67d11de728dcc110eb260c
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/hb
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit arrandale
Homebrew Ruby: 2.3.3 => /usr/local/hb/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.14.1 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
macOS: 10.12.6-x86_64
Xcode: 9.0
CLT: 9.0.0.0.1.1504363082
X11: N/A
chdiza commented 7 years ago

No such spurious output happens on subsequent doctor runs, but it should still be fixed so as not to suprise/confuse people when they update.

MikeMcQuaid commented 7 years ago

Do you have anything that might make tar or Homebrew always output verbosely?

chdiza commented 7 years ago

HOMEBREW_VERBOSE is set, but it seems like that still shouldn't cause that output. I have no tar settings.

chdiza commented 7 years ago

(Or rather, it should cause such output unless there is some accompanying clue as to what brew is doing. E.g., "Installing vendored ruby", or some such.)

chdiza commented 7 years ago

Wait, what am I saying? doctor shouldn't be installing anything or moving anything.

chdiza commented 7 years ago

Ah, this might be relevant: I didn't actually brew update, contrary to my initial post. I git pulled the main repo and then the homebrew-core tap separately (that's my usual practice).

The big list of files has now happened on two different machines. On the second machine, right after the git pull in the homebrew-core tap was completed, I did brew log to see what has changed. This hung for a while, and then I saw:

Error: Another active Homebrew vendor-install-ruby process is already in progress.
Please wait for it to finish or terminate it to continue.
Error: Failed to install vendor Ruby.

This was surprising, because other than the error message, there was nothing at all to indicate that any kind of vendor-install process was taking place or was about to take place.

It was also surprising because the second of those error messages was false---vendor ruby did indeed get installed, as far as I can tell.

Then I tried brew doctor, thinking I goofed my system. Out came the list of every file and directory in the vendor-ruby path. As before, a second run of doctor on that machine failed to produce the list.

chdiza commented 7 years ago

Here's another seemingly relevant bit. If simply start from scratch and just git clone --depth 1 https://github.com/Homebrew/brew, then I see:

remote: Counting objects: 1124, done.
remote: Compressing objects: 100% (1032/1032), done.
remote: Total 1124 (delta 118), reused 380 (delta 50), pack-reused 0
Receiving objects: 100% (1124/1124), 1.20 MiB | 1.80 MiB/s, done.
Resolving deltas: 100% (118/118), done.
portable-ruby/2.3.3/
portable-ruby/2.3.3/.brew/
portable-ruby/2.3.3/.brew/portable-ruby.rb
portable-ruby/2.3.3/bin/
portable-ruby/2.3.3/bin/erb
portable-ruby/2.3.3/bin/gem
... etc, etc, the rest of all files under portable-ruby

Strange.

chdiza commented 7 years ago

That seems to show it's got nothing to do with HOMEBREW_VERBOSE, since it was a plain git command I ran. Also, it's weird that this plain git command would somehow know that my machine is 10.12 and therefore needs the vendored ruby. (I thought the vendored ruby was only supposed to be conditionally downloaded on non-High Sierra machines).

ilovezfs commented 7 years ago

Sounds like something in your profile, since it's obviously not git itself.

chdiza commented 7 years ago

One way to reproduce the spew:

$ cd /usr/local
$ git clone --depth 1 https://github.com/Homebrew/brew homebrew
$ cd bin
$ ln -s ../homebrew/bin/brew .
$ brew --version
portable-ruby/2.3.3/
portable-ruby/2.3.3/.brew/
portable-ruby/2.3.3/.brew/portable-ruby.rb
portable-ruby/2.3.3/bin/
portable-ruby/2.3.3/bin/erb
portable-ruby/2.3.3/bin/gem
... etc, etc, the rest of all files under portable-ruby

That's with no ~/.gitconfig.

chdiza commented 7 years ago

There's nothing special about brew --version; the first invocation of brew, whatever the subcommand AFAICT, causes the barfage.

chdiza commented 7 years ago

Since this now appears to have nothing to do with doctor, it's OK with me if someone wants to change the title of the issue.

Also, if HOMEBREW_VERBOSE is unset, then (a) the huge list isn't shown, but (b) there is still no indication whatsoever that brew is working to install the portable-ruby. I think a "Please wait while brew downloads and installs its own private ruby" or something like that would be great. (Maybe even showing the progress bar for downloading the portable-ruby bottle.)

And the while the huge list shouldn't be shown regardless of HOMEBREW_VERBOSE, even if it were still shown the user would at least know what those paths are and why they're being displayed if some informative message like the above example were emitted.

MikeMcQuaid commented 7 years ago

This will improve the messaging: https://github.com/Homebrew/brew/pull/3189