Repository navigation
fix: make Linux/WSL terminals, venvs and package management work end to end - #622
Open
tusharbana-ansys wants to merge 3 commits into
Open
tusharbana-ansys wants to merge 3 commits into
tusharbana-ansys wants to merge 3 commits into
Conversation
…nome-terminal (#591) - Add find_linux_terminal() to detect gnome-terminal, konsole, xfce4-terminal, mate-terminal, tilix, xterm, or x-terminal-emulator via shutil.which - Raise a clear NoLinuxTerminalError with actionable guidance when none are found, instead of silently doing nothing (the root cause of #591 on WSL, which ships no terminal emulator by default) - Rewrite execute_linux_command to use subprocess argv lists instead of os.system, fixing a latent shell-quoting bug - Surface terminal-launch failures to the user via show_error() in installed_table.py (Console/launch actions), uninstall.py (uninstall flow), and create_virtual_environment.py (venv creation), instead of failing silently or showing a misleading success dialog after a failure - Fix find_miniforge_linux() silently failing to detect system conda (invalid shell pipe passed to subprocess without shell=True) - Fix Ubuntu prerequisites (docs + installer.sh) requiring the full gnome desktop metapackage instead of just gnome-terminal - Add regression tests for terminal detection and the no-terminal error path
Contributor
Author
|
Although automated tests have passed, I am still testing this manually on each supported distro. Please do not merge yet. |
Member
|
Sounds good! Keep me posted. Once it's ready to review and tested manually I will review :) |
- Launch terminals with the user's environment: restore LD_LIBRARY_PATH from
LD_LIBRARY_PATH_ORIG so commands do not load the frozen app's bundled
libraries (this broke ssl in Python builds and system tools).
- Suggest the distro's package manager (apt-get/dnf) when no terminal exists.
- Package management on Linux:
- create venvs with `uv venv --seed` and install pip and uv into them;
- update pip/uv with the venv's interpreter, bootstrapping pip with
ensurepip for venvs created by older versions;
- for base Pythons, target the selected interpreter (`--python`) instead
of `--system`, which picked the OS Python, and put its bin first on PATH.
- Report a failed venv creation instead of a false success and remove the
empty folder so the same name can be retried.
- installer_CentOS.sh: use dnf (or yum), require mesa-libGL, mesa-libEGL and
xcb-util-cursor, detect installed groups correctly, fall back to the
development-tools group ID on dnf5, and fail instead of reporting success
when dependency or package installation fails.
- Docs: list the extra RHEL/Fedora packages and use the dnf5-compatible group
ID for Fedora.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #591.
On Linux, and especially WSL, most actions failed silently because the app only ever launched
gnome-terminal. This PR adds terminal detection with clear errors. It also fixes Linux bugs found while testing end to end: library leaks into terminals, package installs targeting the wrong Python, venvs created withoutpip/uv, and an RHEL/Fedora installer that reported false success.Fixes
Terminal launching (
linux_functions.py)gnome-terminal. Supported:gnome-terminal,konsole,xfce4-terminal,mate-terminal,tilix,xterm,x-terminal-emulator.subprocessargument lists instead ofos.system(), which also fixes shell-quoting issues.NoLinuxTerminalErrorwith an install hint for the distro (sudo apt-get install xtermorsudo dnf install xterm).LD_LIBRARY_PATH, not the frozen app's bundled one. Before, commands in these terminals loaded the app's own OpenSSL and other libraries, which brokesslin Python built from source and could break system tools. This also affectedgnome-terminalin v0.6.3.Error reporting
installed_table.py).uninstall.py).<venv>/bin/pythonexists and removes the empty folder so the same name can be reused (create_virtual_environment.py).Package management on Linux (
linux_functions.py,installed_table.py)uv pip --python <path>) instead of--system.--systempicked the OS Python: on Ubuntu 22.04 it installed into the OS Python, and on Ubuntu 24.04 and Fedora it failed with "externally managed". The interpreter'sbinfolder now comes first onPATH.uv venv --seed, andpipanduvare installed into them. Before, venvs had neither, souv pip ...failed with "command not found".pipanduvare updated with the venv's own interpreter. Before, the command tried to run the venv folder itself. Venvs created by older versions getpipviaensurepip.Other
find_miniforge_linux(): readCONDA_PYTHON_EXEfrom the environment. A shell pipe passed withoutshell=Truemeant system conda was never detected.Installers and docs
linux/debian/installer.sh, docs: requiregnome-terminalinstead of the fullgnomedesktop, and add a note thatxtermis enough on WSL.installer_CentOS.sh(also shipped asinstaller_Fedora.sh):dnf, falling back toyum; exit with an error if neither exists;mesa-libGL,mesa-libEGLandxcb-util-cursor, without which the app can't open its window;group list --installed, and fall back to thedevelopment-toolsgroup ID, which dnf5 (Fedora 41+) requires;development-toolsgroup ID.Testing
LD_LIBRARY_PATHhandling for both launch modes. All 23 tests pass, and all pre-commit hooks pass.LD_LIBRARY_PATHssl; venvs (including conda); JupyterLab; full installer run with dnf5Out of scope (existing behavior)
gnome-terminalcan fail with "Could not connect" when the WSL user session hasn't started its message bus;wsl --shutdownfixes it.