fix(update): add --clear flag to uv venv rebuild to prevent Windows bricking #37881#37965
Closed
kyssta-exe wants to merge 1 commit into
Closed
fix(update): add --clear flag to uv venv rebuild to prevent Windows bricking #37881#37965kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
…ricking When 'hermes update' triggers a venv rebuild on Windows, the running python.exe inside the venv is locked by the OS, so shutil.rmtree() silently fails to fully remove the directory. The subsequent 'uv venv' command then fails with 'A directory already exists', leaving the venv in a half-deleted state (pyvenv.cfg gone, python.exe still present) which bricks the CLI with ModuleNotFoundError. Adding --clear to the uv venv command makes it handle any leftover directory gracefully, regardless of what rmtree managed to remove. Fixes NousResearch#37881
Contributor
Author
|
Closing in favor of a clean PR with proper base. The branch was pushed from an outdated fork, causing 4000+ file diffs. |
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.
When
hermes updatetriggers a venv rebuild on Windows, the running python.exe inside the venv is locked by the OS, soshutil.rmtree()silently fails to fully remove the directory. The subsequentuv venvcommand then fails withA directory already exists, leaving the venv in a half-deleted state (pyvenv.cfg gone, python.exe still present) which bricks the CLI with ModuleNotFoundError.Fix: Adding
--clearto theuv venvcommand makes it handle any leftover directory gracefully, regardless of what rmtree managed to remove. This is a one-line change inhermes_cli/managed_uv.py.Before:
After:
Fixes #37881