mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #424] [CLOSED] fix(setup): drop an engine archive that fails to unpack #2634
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#2634
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/424
Author: @alphastorm
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:fix/unreadable-engine-archive📝 Commits (1)
0d844d1fix(setup): drop an engine archive that fails to unpack📊 Changes
2 files changed (+21 additions, -2 deletions)
View changed files
📝
setup.py(+6 -2)📝
tools/test_setup_pins.py(+15 -0)📄 Description
Follow-up to #399, which was closed as covered by 0.1.32. 0.1.32's
drop_archivedoes cover #397's refused archives. One case from #399 is still open ataeb35be(0.1.33): an archive that fails to unpack.When the downloaded engine archive is not a zip, or is a damaged one,
get_prebuiltraisesBadZipFilebut keepsengine/<asset>and its.donemark.download()trusts the mark, so every later run prints "Strata engine already downloaded" and fails on the same file. This goes on after the right archive is published, until someone deletes the file by hand. On the update path the caller catches the error ("updating the engine failed (File is not a zip file)") and starts the installed engine, so the engine is never updated.Change
setup.py(get_prebuilt): onzipfile.BadZipFilefrom unpacking, the archive and its mark are dropped (drop_archive), and the error propagates as before. AnOSErrorwhile unpacking (a full disk, a path that is too long) still keeps the archive, because downloading it again would not help.Behavior changes
BadZipFile). The next run downloads the archive again instead of failing on the same file.Tests (
python -m unittest tools.test_setup_pins, no network)Engine.test_an_archive_that_does_not_unpack_is_not_keptrunsget_prebuiltwith the realdownload()over a--prebuiltfolder. The folder first holds a file that is not a zip, then the right archive. Onaeb35bethe second run raisesBadZipFileagain. With the change, the second run installs the engine.serve/test_*.py,tools/test_*.py: 27 modules, 346 tests, 9 skipped) with and without the change, withSTRATA_GGUF_PYset fortools.test_iq_pack. The results are the same, except for the new test, which errors without the change.tools.test_setup_goldenfails the same 46 subtests in both runs. The cause is on non-Windows hosts: thereEXEisstrata, so the test's path normalization also turns the log namestrata-<quant>.loginto<EXE>-<quant>.log. These runs used Python 3.13.15 on macOS arm64. ruff and pyright report nothing new in the changed files.Also checked
PREBUILT_URLandPREBUILT_TAG_URLpatched, realdownload()). The release first serves an HTML page, then the right archive. Onaeb35be, every run after the first sends oneHEAD, prints "Strata engine already downloaded" and fails withBadZipFile. With the change, the next run downloads and installs the engine, and the run after that sends no request.Not run: Windows, a GPU, or a real release download.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.