Brew installs both applications and their dependencies. When brew is added to the PATH, it also puts all those dependencies on your PATH.
For the most part, this does not cause issues. The OS usually uses absolute paths for binaries and dependencies. But for some programs, they will rely on PATH and may not be compatible with what brew provides.
Ideally, I think brew should fix this by only adding what you explicitly install to your PATH. When you launch it, it should launch a wrapper script that updates PATH with the homebrew dependencies. Though that wouldn’t exactly work for those who install a shell like zsh since then that would inherit the brew libraries anyway.
Or instead of changing PATH at all, use a fancy linking mechanism like Nix.
Universal Blue does some path tinkering to fix this, not sure how though. KDE Linux also has their own workaround, where they instead prioritize system dependencies over brews so that it’s brew that would break instead of the OS.
Brew installs both applications and their dependencies. When brew is added to the PATH, it also puts all those dependencies on your PATH.
For the most part, this does not cause issues. The OS usually uses absolute paths for binaries and dependencies. But for some programs, they will rely on PATH and may not be compatible with what brew provides.
Ideally, I think brew should fix this by only adding what you explicitly install to your PATH. When you launch it, it should launch a wrapper script that updates PATH with the homebrew dependencies. Though that wouldn’t exactly work for those who install a shell like zsh since then that would inherit the brew libraries anyway.
Or instead of changing PATH at all, use a fancy linking mechanism like Nix.
Universal Blue does some path tinkering to fix this, not sure how though. KDE Linux also has their own workaround, where they instead prioritize system dependencies over brews so that it’s brew that would break instead of the OS.
Little more info from KDE:
Thanks for the info, I really appreciate it!
So far, I will say that I haven’t run into any issues but it’s interesting to learn about some of the pitfalls/limitations too.
It’s all about trade offs, I guess!