Fix: Improve Fedora Atomic/Silverblue support#177
Conversation
|
Hi, sorry for the delay. Feel free to ask any question |
| which python3 | ||
| else | ||
| pipx install --global --force dist/*.tar.gz | ||
| FW_FANCTRL_BIN="$(which fw-fanctrl 2>/dev/null || true)" |
There was a problem hiding this comment.
I do not believe that using which to guess the installation path of the fw-fanctrl bin is a good idea.
Can you check if pipx gives a way to identify the installation directory and use that instead?
There was a problem hiding this comment.
No worries, I was just copying the usage elsewhere in the same if statement.
I've changed the check, if the issue is detected with homebrew installed python then the venv advice is given.
| > First, ensure `pipx` is available. If you use Homebrew: | ||
| > ```bash | ||
| > brew install pipx | ||
| > ``` | ||
| > Otherwise, layer it via rpm-ostree (requires a reboot): | ||
| > ```bash | ||
| > rpm-ostree install pipx && systemctl reboot | ||
| > ``` | ||
| > Then install fw-fanctrl. If using Homebrew, pass your PATH so sudo can find `pipx`: | ||
| > ```bash | ||
| > sudo env PATH="$PATH" ./install.sh --prefix-dir "/var/usrlocal/" --pipx | ||
| > ``` | ||
| > Otherwise: | ||
| > ```bash | ||
| > sudo ./install.sh --prefix-dir "/var/usrlocal/" --pipx | ||
| > ``` | ||
| > **Homebrew Python + SELinux**: if you use Homebrew, the installer will warn you if the pipx venv uses Homebrew's Python (under `/home/linuxbrew`), which SELinux blocks systemd from executing. To fix it: | ||
| > ```bash | ||
| > sudo /usr/bin/python3 -m venv /opt/fw-fanctrl-venv | ||
| > sudo /opt/fw-fanctrl-venv/bin/pip install fw-fanctrl | ||
| > sudo ln -sf /opt/fw-fanctrl-venv/bin/fw-fanctrl /var/usrlocal/bin/fw-fanctrl | ||
| > sudo systemctl restart fw-fanctrl | ||
| > ``` |
There was a problem hiding this comment.
While this is helpful for atomic distribution users, we try to keep the installation documentation as distro agnostic as possible (1 or 2 small comments are the exception).
There was a problem hiding this comment.
I've dropped the README changes in favour of issue detection and advice in script.
c961154 to
70c711d
Compare
leopoldhub
left a comment
There was a problem hiding this comment.
Hi, this is way more aligned with what I had in mind
I am not really familiar with pipx itself or SELinux, so I have some questions (cf. The comments bellow)
Also, I believed that those changes might become obsolete when moving to the Nuitka bin install in #182, but I will merge this PR first as the last edit before the new version so that people who want to stuck with the python install will have pipx working as intended
| fi | ||
|
|
||
| if [ "$NO_PIP_INSTALL" = false ]; then | ||
| if [ "$NO_PIP_INSTALL" = false ] && [ "$PIPX" = false ]; then |
There was a problem hiding this comment.
Would be nice to detect if pipx is installed if $PIPX = true
There was a problem hiding this comment.
Restructured pip/pipx detection into a single $NO_PIP_INSTALL block — verifies pipx is available when --pipx is set, same as pip.
| else | ||
| pipx install --global --force dist/*.tar.gz | ||
| FW_FANCTRL_BIN="$(pipx environment --value PIPX_BIN_DIR --global 2>/dev/null || true)" | ||
| if [ -n "$FW_FANCTRL_BIN" ]; then |
There was a problem hiding this comment.
What if it failed?
The pipx package is still installed
There was a problem hiding this comment.
Added a fallback to PYTHON_SCRIPT_INSTALLATION_PATH — if pipx environment fails, we check the path the services will actually use.
| pipx install --global --force dist/*.tar.gz | ||
| FW_FANCTRL_BIN="$(pipx environment --value PIPX_BIN_DIR --global 2>/dev/null || true)" | ||
| if [ -n "$FW_FANCTRL_BIN" ]; then | ||
| FW_FANCTRL_BIN="$FW_FANCTRL_BIN/fw-fanctrl" |
There was a problem hiding this comment.
This variable is not used to populate the systemd services
Is that the intended behaviour ?
There was a problem hiding this comment.
Intentional — FW_FANCTRL_BIN is only used for the shebang warning. Services are populated from PYTHON_SCRIPT_INSTALLATION_PATH (set via --prefix-dir), which matches where pipx installs.
07c0fd1 to
0cbf921
Compare
…to find binary - restructure pip/pipx detection into a single conditional block - use pipx environment --value PIPX_BIN_DIR --global to find the installed binary path, falling back to PYTHON_SCRIPT_INSTALLATION_PATH if that fails - verify the binary exists before reading the shebang - warn if pipx venv uses Homebrew Python under /home (SELinux issue) with inline fix instructions
0cbf921 to
966c1f3
Compare
This PR fixes installation on Fedora Atomic desktops (Silverblue, Kinoite, etc.) where pip is not available and pipx is used instead.
Bug fix: --pipx still required pip
The installer checked for pip unconditionally before reaching the pipx check, so --pipx would always fail with Missing python package 'pip'! on systems without pip. The check now only runs when pip is actually going to be used.
Warning: Homebrew Python + SELinux
On Fedora Atomic with Homebrew installed, pipx creates a venv using Homebrew's Python, which lives under /home/linuxbrew. SELinux labels this path user_home_t, which systemd's init_t cannot read — causing the service to silently fail with exit code 203/EXEC. The installer now detects this after install and warns the user with instructions to fix it.
README
Expanded the Fedora Atomic section with: