Closed brandondrew closed 5 years ago
On the subject of expectations I should add the broader expectations I had of using Homebrew:
readline
before, and because of that never upgrade it unless I'm prepared to deal with the fallout and reinstall everything broken by it. However in this case there was no warning that readline
was going to be upgraded followed by a confirmation.I worked around this issue by symlinking from the old path to the new library.
š» ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
But this issue is not about losing awk, it's about the much broader problem of an upgrade to one thing breaking another, and if there is any way Homebrew can avoid letting that happen.
So I think there is some confusion here. We have two versions of "awk" in homebrew-core, called awk
(non-GNU version) and gawk
(GNU version). You have gawk
installed, but you typed brew upgrade awk
, which you don't have installed, and brew
said as much: Error: awk not installed
.
You're therefore using an old version of gawk
which was not updated in the readline
7 -> 8 transition.
Our continuous integration infrastructure tests for breakage like this (c.f. https://github.com/Homebrew/homebrew-core/pull/35778), so link errors like the one you are describing shouldn't be seen assuming you're keeping Homebrew updated. For example, my copy of gawk
properly links against readline 8:
$ otool -L $(brew --prefix gawk)/bin/awk
/usr/local/opt/gawk/bin/awk:
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
/usr/local/opt/readline/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/local/opt/mpfr/lib/libmpfr.6.dylib (compatibility version 7.0.0, current version 7.1.0)
/usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 14.0.0, current version 14.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
brew upgrade gawk
should fix your issues. Feel free to reopen if it doesn't.
What brew upgrade
command did you run to upgrade those? I can't see that from your output. I'm not sure how I understand how you've ended up in a state that you've upgraded some apps and not others.
@MikeMcQuaid that was mentioned briefly in the "What Happened" section:
The only thing that may need some explanation is the
update
script, which basically just pipes the output ofbrew outdated
throughfzf
to make it easy to choose which things to update.
Here's a slightly more verbose explanation:
If you look at the transcript, you'll see update
. This is a script that lets me use fzf
to select from the output of brew outdated
, and it gives me brew info
for the currently selected item to help me decide what to update. Once I go through the list and select what I want to update, it displays them and asks for confirmation (as seen in the output above). It lets me use the command line and do everything from the keyboard, but doesn't require enormous amounts of typing long lists of items to upgrade (or cutting and pasting, which seems really weird to do in a terminal).
@jonchang
Yes, you're correct: in this case awk
turned out to be a symlink to gawk
. I didn't realize that at the time I filed the report.
But I want to repeat: this is not about awk or gawk. It's about the fact that upgrading one thing can break another. That is certainly something I don't expected to be a danger of Homebrew. It would be a very significant anti-feature if that's "just the way it is".
I don't know if I'm reading too much into your answer, but it seems plausible that you're assuming that everytime anyone upgrades anything with Homebrew, they are expected to upgrade everything. If that's the case, that is also (in my opinion) a gigantic anti-feature. I sincerely hope that is not a foundational premise of the way Homebrew has been built. It would certainly not be a decision I would be in favor of.
If you look at the transcript, you'll see
update
. This is a script that lets me usefzf
to select from the output ofbrew outdated
, and it gives mebrew info
for the currently selected item to help me decide what to update.
There's a non-zero possibility there's a bug in your script. In future if you're pasting command output please always include only brew
commands you've run and not scripts; it's nearly impossible to figure out how to reproduce a problem without seeing commands.
You've also not provided your brew config
or brew doctor
output which furthermore means that we cannot figure out how to reproduce this.
everytime anyone upgrades anything with Homebrew, they are expected to upgrade everything
This isn't required but it is recommended. In general cases of broken linkage like this we do detect and handle it so there's something else going on here. This isn't getting widely reported so it's likely something specific to your setup and you've not provided enough information for us to help you further.
brew
command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all potentially relevant issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
In a nutshell:
libreadline
, in this case)libreadline
(such asawk
)awk
) broke.What happened (include command output)
The entire story can be seen here. (The only thing that may need some explanation is the
update
script, which basically just pipes the output ofbrew outdated
throughfzf
to make it easy to choose which things to update.)Command output
What you expected to happen
I expected
awk
to display its help. (Of course--help
was just for sake of example. What I really expect is for all my scripts and shell functions using awk to keep working, but they are all broken now, so this is a very frustrating problem.)What makes it every stranger is that awk doesn't seem to be installed by Homebrew (at least brew upgrade awk failed as though it was not a Homebrew utility).
Step-by-step reproduction instructions (by running
brew
commands)