"brew upgrade" does not check dynamic library links #12190
Comments
I think this is a bug, too. It is annoying because most of the times I get this issue is with bigger programs that take much more to compile, like octave, for example. |
Note that this is usually only a problem when libraries cross a major version boundary; otherwise the dylib names remain the same and upgrades can be done underneath other software. We go to some lengths to make sure we don't have to recompile all reverse dependencies every time a formula is updated, so my suggestion would be that someone write an external command that walks the installed kegs, looking for broken linkages, and then prints a list of formula that need to be recompiled. Note that broken linkage may also indicate that a dependency is just plain missing, so that would need to be treated separately. Once this command is working well the functionality could potentially be ported into |
@jacknagel We can/should really fix this with install_name_tool if possible I think. |
|
This is a bit confusing yes, for example: just updated qt but this is not visible within python through pyqt, which still points at previous version. |
Actually this is not directly related to I can see this:
Looking at the keg_fix_install_names code, it looks like we only fix files with the |
@jacknagel thanks for referencing the libmpc issue. You are right this is the correct place to track this issue. |
Does ist help if we use opt_prefix? |
Is there a temporary fix for this while we await a built-in fix? I'm trying to regain the ability to use the SQLite module in python. |
You'll have to rebuild python against the updated sqlite. |
For people who come across this issue, note that the problem being discussed here is not related to directory names changing; that has been addressed by linking keg-only things via The issue here is when the actual names of the dynamic libraries change (e.g. libfoo.1.dylib to libfoo.2.dylib). This is a much more difficult problem to solve. |
Thanks; |
When the dynamic libraries change we need to relink really as that normally indicates an API (or at least ABI) change. |
I just ran into #17312 which brought me here. 17 of my virtualenvs do not work anymore :( |
The options you used to brew software is stored in a a json file in each Cellar. You can use brew info for that
Is that what you look for? Sorry for breaking your venvs. Won't happen too often. Making sqlite keg_only was the right decision, though. |
Hi @samueljohn. Sure, I can write a script to take care of the rest. No worries about the virtualenvs. Already recreated them :) |
This also seems to break builds of Removing & reinstalling both sqlite & python32 fail to solve the problem. The only way I could work around it was by adding the SQLite libs to my
|
@mitchellrj try removing the DYLD_LIBRARY_PATH sqlite entry and instead do a |
@rburhum That works but as stated above, sqlite should be keg only and there are good reasons for keeping it that way. |
Just wanted to make sure you have exactly the same issue I have :) |
We probably need to apply the fixes from |
Just to add another element to this discussion, I just However, when you run a
Edit: Of course, recompiling |
I think this is a problem that needs to fix. Took a look at how other parties dealt with this situation. Macports support port version, so they manually bump the ports that got affected and forces user to update, which basically works as a rebuild. There's also some mechanisms to trigger port with broken links to rebuild, at least when a binary package (as bottles in homebrew) is affected when its dependencies has upgraded. Gentoo's portage system also does this kind of checking for broken links, and will trigger rebuild for reverse-dependencies that are affected. I guess the mechanism is not hard, just need to check its reverse-dependencies. And also there is |
The more I have thought about it the more I am convinced that we need to go the "formula revision" route rather than trying to check dynamic library links. I the the latter approach is too error-prone (we are bound to miss some things here and there) and will also be horrendously slow, as the lack of a central database means we have to walk the lib and bin directories of every reverse dependency. |
@jacknagel A silly, brew2 level approach I might try would be to have each formula keep all it's dependencies inside it's Cellar. |
So here's a partial implementation of formula revisions: https://github.com/jacknagel/homebrew/compare/rev The presentation-layer things work, and incrementing the revision number of a formula will trigger upgrades, etc. However the main problem is that we cannot upgrade a package "in place", because the prefix contains just the version and not the revision. I'm not quite sure how to address that yet. |
Am I being stupid here or does this only become a problem if you |
With the advent of |
Arr, yes. Seems like a good fix then. |
Made some tangible progress: https://github.com/jacknagel/homebrew/compare/rev The revision is now encoded in the name of the keg as I chose to do it this way because it is much simpler than trying to temporarily move a keg while a new one with the same version is built, then either removing it or moving it back depending on the outcome of the build. It also keeps all version comparison code working as-is. It does mean that there can be false positives for version numbers that match |
A prime example of what this fixes is the recent issues with pango; in that case, icu4c was updated and the library version changed, breaking things linked against it, including harfbuzz, which in turn broke updates to pango. |
Is this feature still being worked on? It seems like sqlite gets updated frequently, and so whenever I
I can of course fix it by reinstalling:
But, it’s still a pain and it would be nice if the necessary changes happened automatically. |
My GDAL installation just broke for the same reason:
Thanks @mbostock, that little brew command just saved me from a headache. |
#19920 has been merged. |
nginx also get this problem. After I updated
brew info nginx
|
@truebit |
@MikeMcQuaid Thanks for your reply. So it's because |
@truebit The binaries have been updated; |
For future reference,
This shows that the library is linked dynamically, which means it is not necessary to recompile nginx, only openssl. |
brew -v
0.9
When homebrew upgrade updated formulars it does not check if another program is linked against the old version of this formular.
For example, I installed imagemagick a while ago and last week "brew upgrade" updated libtiff to version 4. But ImageMagick is still linked against libtiff 3 which was deleted (by cleanup) or unlinked (by upgrade).
So ImageMagick does not work anymore:
This is a general problem. I had a similar problem with ffmpeg and x264. So brew has to check for broken library links after the upgrade. The only solution is to remove and install the program again to link against the new version.
The text was updated successfully, but these errors were encountered: