mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1667] build_dstorage_history: write the history report atomically #1680
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1680
Loading…
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/ubiquitarianism/leonida/pull/1667
Author: @xel1uz
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/build-dstorage-history-atomic-out📝 Commits (1)
f0239cfbuild_dstorage_history: write the history report atomically📊 Changes
2 files changed (+170 additions, -2 deletions)
View changed files
➕
tests/test_build_dstorage_history.py(+142 -0)📝
tools/build_dstorage_history.py(+28 -2)📄 Description
Item ID:
BUILD-DSTORAGE-HISTORY-ATOMIC-OUT(new item; the coordination issue #14 is at GitHub's 2,500-comment cap, so the claim lives here)Claimed as:
BUILD-DSTORAGE-HISTORY-ATOMIC-OUT- a failed--outwrite truncates an existing file and leaves a partial one behind. Reproduced on42537e7b.What and why
The report was written with
Path.write_text(json.dumps(...)), which truncates the destination before any serialization happens: a report that fails part-way leaves a partial JSON and the previous history is already gone, while the caller only sees the write error.The JSON now goes to a temporary file in the destination directory and is moved into place with
os.replaceonce it is written; a failure removes the temp file and leaves the existing report untouched.Tested
pytest tests/test_build_dstorage_history.py -qwith the tool at42537e7b: 1 failed, 2 passed - the failure istest_failed_write_preserves_existing_report.With this branch: 3 passed.
Repro with
RLIMIT_FSIZE=128andSIGXFSZignored: the build returns 1 (File too large), and the report went 30 -> 128 bytes on the original while staying 30 bytes here, with no temp file left.git diff --checkclean;python3 -I scripts/check_no_game_data.pyclean on the changed files.GPUs tested: n/a - CPU only, no Vulkan device involved.
AI-assisted: Yes.
Checklist
main(42537e7b) and merges cleanly.docs/design.md- not applicable, no translator change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.