mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1801] [CLOSED] fix(setup): discard damaged llama.cpp source archives #3681
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3681
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1801
Author: @hulkbig
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:fix/llama-source-corrupt-archive-1797📝 Commits (1)
cdb17c7fix(setup): discard damaged llama.cpp source archives📊 Changes
2 files changed (+184 additions, -4 deletions)
View changed files
📝
setup.py(+12 -4)➕
tools/test_setup_llama_archive.py(+172 -0)📄 Description
Title
Issue: Fixes #1797
Summary
A damaged cached llama.cpp source ZIP can keep its
.donemark afterget_llama_cpp()raisesBadZipFile. Every later setup run then reuses the same bad archive. Remove that archive and its mark so the next run can download it again.Kept as a draft: CUDA/HIP/SYCL builds have not been run, so the backend-build requirement in AGENTS.md has not been met. The applicability of that requirement to this installer-only change still needs clarification before requesting review.
What changed
zipfile.BadZipFileonly around opening and extracting the llama.cpp source archive, and reusedrop_archive()for that exact ZIP and its.donemark.OSError, warn about manual cleanup without replacing the original archive error.The download strategy, retries, source pin, archive member filtering, successful extraction path, and engine/backend code are unchanged. This does not add checksums or change archive-security policy.
Related: #1126 changes the same function to use
safe_extract(), but its current implementation does not remove this damaged source cache. These changes address different behavior; any future integration must preserve that safe-extraction work. #424 covers the analogous engine-archive path.Extra Notes
Local validation on Linux x86_64 (kernel 6.18.44), Python 3.12.14, at
cdb17c717260bdb9122099bac055df82ef197f0e:get_llama_cpp()/download(file://...)reproduction: two calls on unchanged basefb58e0dkeep reusing the bad ZIP and mark. With the fix, the first call removes them and the second installs a valid local archive. Network calls are prohibited in these regressions.python tools/test_setup_llama_archive.py -v: 10 tests passed. The same final suite fails on the unchanged base.python tools/test_setup_golden.py -v: 4 passed, including saved-configuration byte consistency.tools.test_setup_pins.Engine;tools.test_setup_engine_hashclassesArchiveVerification,DigestLookup,WhereTheHashComesFrom,Wiring; andWhatARefusalDoesToTheCaller.test_the_cuda_and_amd_paths_both_verify.python tools/test_setup_choices.py -v: 39 passed, 1 environment error (RotationalDisk.test_sysfs: missing/sys/block), identical on base and patch.python -m py_compile setup.py tools/test_setup_llama_archive.py,git diff --check, and exact-base patch replay checks passed.Validation limits: no CUDA/HIP/SYCL build, Windows run, GPU/model execution, or real remote llama.cpp download. Three existing adjacent checks with unmocked HEAD requests were excluded from the final offline selection. An earlier broad engine-hash run made release-asset HEAD requests, received HTTP 404, and was interrupted; the full suite is not reported as passing. No online CI success is assumed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.