fix(install): rm symlink before writing hermes launcher to prevent venv corruption#24850
Closed
luyao618 wants to merge 1 commit into
Closed
fix(install): rm symlink before writing hermes launcher to prevent venv corruption#24850luyao618 wants to merge 1 commit into
luyao618 wants to merge 1 commit into
Conversation
…nv corruption When ~/.local/bin/hermes is a symlink pointing into the venv (left by a previous install), `cat > $command_link_dir/hermes` follows the symlink and overwrites the real Python entry-point with the bash launcher template. The launcher then exec's itself in an infinite loop. Add `rm -f` before the redirect so any existing file or symlink is removed first, ensuring the redirect always creates a fresh regular file. Fixes NousResearch#24834
Collaborator
Contributor
|
Superseded by #25734, which merged @Tranquil-Flow's earlier #21513 with the same one-line |
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
When
~/.local/bin/hermesis a symlink pointing into the venv (state left by an earlier install),cat > $command_link_dir/hermesfollows the symlink and overwrites the real Python entry-point with the bash launcher template. The launcher thenexecs itself in an infinite loop andhermeshangs forever.Changes
rm -f "$command_link_dir/hermes"before thecat >redirect inscripts/install.shso any existing file or symlink is removed first, ensuring the redirect always creates a fresh regular file.How to test
ln -sf ~/.hermes/hermes-agent/venv/bin/hermes ~/.local/bin/hermesscripts/install.shhermes --helpworks (no hang)~/.local/bin/hermesis a regular file, not a symlink~/.hermes/hermes-agent/venv/bin/hermesis still the Python console-scriptRelated
Fixes #24834