Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

PR #63 follow-up: move the unpacked llama.cpp to third_party/llama.cpp itself, retrying a locked move

Niko1221f0861199027d
diff --git a/setup.py b/setup.py
index 4439f6173..6d8af4a99 100644
--- a/setup.py
+++ b/setup.py
@@ -419,9 +419,18 @@ def get_llama_cpp():
f.extractall(tmp)
top = next(tmp.iterdir())
shutil.rmtree(llama, ignore_errors=True)
- # pathlib.Path.replace() can fail on Windows with PermissionError
- # when file handles or AV locks persist; use shutil.move instead.
- shutil.move(str(top), str(llama.parent))
+ # PR #63: on Windows a rename can fail with PermissionError while an antivirus scanner still holds a file of the
+ # fresh unpack; shutil.move falls back to copy-and-delete, and a few retries let the scanner finish. The target
+ # is `llama` itself - moving into its parent would keep the zip's `llama.cpp-<sha>` folder name.
+ for attempt in range(5):
+ try:
+ shutil.move(str(top), str(llama))
+ break
+ except PermissionError:
+ if attempt == 4:
+ raise
+ shutil.rmtree(llama, ignore_errors=True) # a partial copy from the failed attempt
+ time.sleep(2)
shutil.rmtree(tmp, ignore_errors=True)
z.unlink(missing_ok=True)
z.with_name(z.name + ".done").unlink(missing_ok=True)