Skip to content

Commit 1c1fa59

Browse files
committed
Abort rebuild when a running process was launched from vendor/llama.cpp/build/
Enumerates Get-Process for any EXE whose .Path lives under the build tree and throws with a PID list before any destructive op runs. Closes the foot-gun where forgetting to stop llama-server.exe before ./rebuild_llama.cpp.ps1 left the tree half-deleted by Remove-Item ./vendor/llama.cpp/build on Windows, after CMakeLists.txt patches and submodule reset had already mutated state.
1 parent 7356db0 commit 1c1fa59

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- [Build] Abort rebuild when a running process was launched from vendor/llama.cpp/build/
12+
1013
### Changed
1114
- [Vendor] Bump Qwen-Fixed-Chat-Templates submodule to 5983684 (chat_template-v13)
1215
- [Presets] Switch all Qwen 3.6 entries to chat_template-v13.jinja

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Binaries land in `./vendor/llama.cpp/build/bin/Release/`. Conda env `llama.cpp`
3333
- **`requirements_override.txt` layers on top of upstream `vendor/llama.cpp/requirements.txt`.** It pins `torch` to a CUDA 12.6 wheel, adds `tiktoken` (missing upstream, required for GLM), pins `transformers==5.3.0`, and narrows `numpy` to resolve an `opencv-python-headless` conflict. When bumping any of these, verify both constraints still hold.
3434
- **`server.ps1` reads GGUF metadata** by shelling out to `vendor/llama.cpp/gguf-py/gguf/scripts/gguf_dump.py`. Upstream has moved this path before (CHANGELOG 1.24.0) — if server startup fails with "Failed to extract model details", check the path first.
3535
- **`server.ps1 -additionalArguments` splits on whitespace** and re-pairs tokens into key/value flags. Values that contain spaces will not survive this parser.
36+
- **Rebuild aborts on running build-tree processes.** Before any destructive op, `rebuild_llama.cpp.ps1` checks `Get-Process` for any EXE under `vendor/llama.cpp/build/` and throws with the PID list. Catches the forgot-to-stop-`llama-server.exe` case.
3637

3738
## Presets
3839

rebuild_llama.cpp.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ Write-Host "BLAS accelerator: ${blasAccelerator}" -ForegroundColor "DarkYellow"
127127
Write-Host "Build target: ${buildTargetInformation}" -ForegroundColor "DarkYellow"
128128
Write-Host "Parallel build jobs: ${parallelJobs}" -ForegroundColor "DarkYellow"
129129

130+
# Fail fast if any running process was launched from the build tree. The
131+
# Remove-Item ./vendor/llama.cpp/build below would otherwise partially-delete
132+
# the tree on Windows. Common trigger: forgetting to stop llama-server.exe.
133+
$buildRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot 'vendor\llama.cpp\build'))
134+
$blockers = Get-Process |
135+
Where-Object { $_.Path -and $_.Path.StartsWith($buildRoot, [StringComparison]::OrdinalIgnoreCase) }
136+
if ($blockers) {
137+
$list = ($blockers | ForEach-Object { " PID $($_.Id) $($_.Path)" }) -join "`n"
138+
throw "Processes hold files under ${buildRoot}:`n${list}`nStop them and re-run."
139+
}
140+
130141
$openBLASVersion = "0.3.30"
131142

132143
if (-not(Test-Path -Path "./vendor/OpenBLAS/OpenBLAS-${openBLASVersion}-x64.zip")) {

0 commit comments

Comments
 (0)