fix: Windows git 'unable to write loose object' + venv pip path
- Set 'git config windows.appendAtomically false' in hermes update command (win32 only) and in install.ps1 after cloning. Fixes the 'fatal: unable to write loose object file: Invalid argument' error on Windows filesystems. - Fix venv pip fallback path: Scripts/pip on Windows vs bin/pip on Unix - Gate .env encoding fix behind _IS_WINDOWS (no change to Linux/macOS)
This commit is contained in:
parent
5749f5809c
commit
16274d5a82
2 changed files with 14 additions and 2 deletions
|
|
@ -789,6 +789,14 @@ def cmd_update(args):
|
||||||
print(" curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash")
|
print(" curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# On Windows, git can fail with "unable to write loose object file: Invalid argument"
|
||||||
|
# due to filesystem atomicity issues. Set the recommended workaround.
|
||||||
|
if sys.platform == "win32":
|
||||||
|
subprocess.run(
|
||||||
|
["git", "config", "windows.appendAtomically", "false"],
|
||||||
|
cwd=PROJECT_ROOT, check=False, capture_output=True
|
||||||
|
)
|
||||||
|
|
||||||
# Fetch and pull
|
# Fetch and pull
|
||||||
try:
|
try:
|
||||||
print("→ Fetching updates...")
|
print("→ Fetching updates...")
|
||||||
|
|
@ -832,7 +840,7 @@ def cmd_update(args):
|
||||||
env={**os.environ, "VIRTUAL_ENV": str(PROJECT_ROOT / "venv")}
|
env={**os.environ, "VIRTUAL_ENV": str(PROJECT_ROOT / "venv")}
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
venv_pip = PROJECT_ROOT / "venv" / "bin" / "pip"
|
venv_pip = PROJECT_ROOT / "venv" / ("Scripts" if sys.platform == "win32" else "bin") / "pip"
|
||||||
if venv_pip.exists():
|
if venv_pip.exists():
|
||||||
subprocess.run([str(venv_pip), "install", "-e", ".", "--quiet"], cwd=PROJECT_ROOT, check=True)
|
subprocess.run([str(venv_pip), "install", "-e", ".", "--quiet"], cwd=PROJECT_ROOT, check=True)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -462,9 +462,13 @@ function Install-Repository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Fix Windows git "unable to write loose object file" error.
|
||||||
|
# Must be set before any git operations that write objects.
|
||||||
|
Push-Location $InstallDir
|
||||||
|
git config windows.appendAtomically false
|
||||||
|
|
||||||
# Ensure submodules are initialized and updated
|
# Ensure submodules are initialized and updated
|
||||||
Write-Info "Initializing submodules (mini-swe-agent, tinker-atropos)..."
|
Write-Info "Initializing submodules (mini-swe-agent, tinker-atropos)..."
|
||||||
Push-Location $InstallDir
|
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
Pop-Location
|
Pop-Location
|
||||||
Write-Success "Submodules ready"
|
Write-Success "Submodules ready"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue