-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homebrew's path setting conflict with host binaries #687
Comments
Perhaps we can start by putting homebrew's paths last so the host binaries always take precedence?
|
Ok I followed this advice and replaced:
with
This ends up with:
Which solves the problem, but then the issue gets flipped, if something installed via brew installs a dependency that also happens to be on the host the host's version will take precedence, which could be a problem. |
Or maybe there's something we can pass along to flatpak itself to ignore the homebrew paths entirely? |
I've run into similar issues. In my case, I was ok with brew paths before system, but not before I think this is generally the problem with "competing" package managers. Brew is pretty great, but it sometimes installs unexpected dependencies, which can lead to issues, masking host installed commands, etc. Ultimately, I'm not sure if there is a generic solution, it seems somewhat "user choice". But if the worst offenses are solved by flatpak only using system path rather than user path, that's a start. |
I haven't used flatpak much but it seems like flatpak override https://man7.org/linux/man-pages/man1/flatpak-override.1.html could help:
There's a |
Tagging @ljrk0 as they have opinions on this. |
Heyhey, thank you for tagging me!
I think this is very close to a real solution to the problem, except that it's flipped: Instead of adding the homebrew (or any other package manager's output) PATH to the environment and then stripping it from the Flatpak environment, one can just not add the PATH to the default/login environment (which is what Flatpak re-uses). Instead, the terminal emulator (or the chosen interactive shell) explicitly adds the utilities to the PATH. BackgroundOn login, the users login shell (chosen through When a terminal emulator starts it will also inherit this environment as it's just another application. In addition, it will start an interactive shell, either the same shell set-up as login shell, or a different one, changed in the profile settings of the terminal emulator. Subsequently, this shell will source all files relevant for interactive use, in case of bash Side note: IdeaJust as one can configure one owns terminal emulator to use a different shell for interactive use than the login shell, one could add PATHs to the environment as part of the terminal emulator profile settings. Environments changed this way would only affect shells started in this terminal emulator. One can extend this concept and even add multiple profiles with different shells and different PATHs for different utilities available. Basically this is simply an extension to the recommendation of changing your preferred shell through the terminal emulator rather than Variation #1The whole concept is closely related to virtual environments, e.g., as seen in python-venv. These tools simply ship a different version Python and libraries in a location that is not "enabled" or "visible" by default, but sourcing A variation to this proposal would be to do this CLI only and have semantics similar to Of course, the terminal emulator could be made aware of this and a hybrid option would offer the CLI tool for "unaware" terminal emulators/sessions (e.g., through SSH) but also allowing terminal emulators to launch "directly" into the "homebrew profile" or even different profiles for different purposes. Think Variation #2The simplest proposal with no need to develop new code is to simply rely on the shell's ability to distinguish b/w login and interactive shell. To recap:
Further, it is common to "chainload" # Add homebrew tools to PATH in interactive mode only
[[ $- == *i* ]] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" Further ThoughtsOf course homebrew may be used to install tools that also install |
Solved and shipped, thanks folks!!!! |
I was curious about how this was fixed but none of the commits jumped out at me - I'm guessing this was fixed as part of the 2.0 release #947 |
Both my steam and discord flatpaks were erroring out. Discord wouldn't launch at all and steam was giving "invalid SSL certificate" error in the store page.
This led me to look at what I had installed: https://bbs.archlinux.org/viewtopic.php?id=252390
I found a copy of
p11-kit
in my homebrew installation. The problem is that this version of p11-kit takes precedence over the host, causing the error. Removing it fixed everything and all my flatpaks are working again.Not sure how we should proceed but if this is the case there's probably a bunch of other stuff that could break if the homebrew version of a package takes precedence over the system one.
The text was updated successfully, but these errors were encountered: