Repository navigation
fix(linux): resolve venv symlink chain when generating desktop entry - #96685
aardbij26-ship-it wants to merge 1 commit into
Conversation
uv venvs chain bin/python3 -> python -> uv-managed python. The desktop entry generator compared the shebang path against sys.executable's directory as raw strings, so the uv-managed interpreter was prefixed explicitly — an Exec line that runs without venv activation and dies on ModuleNotFoundError: hermes_cli (NousResearch#90292). Compare resolved paths instead, so the venv symlink chain is recognized as the running interpreter and the entry stays a plain 'hermes desktop' launch. Adds a regression test for the symlinked-venv case.
|
Fresh confirmation — this fix resolves the exact scenario reported here. EnvironmentArch Linux, git install, Hermes Agent v0.20.6, uv-managed venv at How it manifested
That bare interpreter has none of the venv's site-packages (e.g. Root causeMatches this PR: VerificationApplying exactly this approach (compare resolved paths so the venv symlink chain is recognized as the running interpreter) makes With that entry:
This also matches the approach noted in #94051 / the second comment on #90292 (keep the venv symlink intact). Happy to test candidate branches on this machine (Arch + uv venv symlink). |
Problem
On Linux installs using a uv-managed venv, the generated desktop entry has a non-runnable
Execline, so launching Hermes from the dock/menu icon silently fails. Fixes #90292.Root cause
uv venvs chain their interpreter symlinks:
venv/bin/python3 -> python -> uv-managed python._needs_interpreter()compared the shebang path againstsys.executable's directory as raw strings, so the uv-managed interpreter was not recognized as the running interpreter and got prefixed explicitly:That interpreter runs without venv activation and dies on
ModuleNotFoundError: No module named 'hermes_cli'— silently, sinceTerminal=false.Fix
Compare resolved paths instead of raw strings, so the venv symlink chain is recognized as the running interpreter and the entry stays a plain
hermes desktoplaunch.Test
Adds
test_exec_leaves_symlinked_venv_shebang_alonecovering the uv-venv symlink chain case. Full suite: 16 passed, 2 skipped.