diff options
| author | xel1uz <16402913+xel1uz@users.noreply.github.com> | 2026-11-25 08:10:38 +0100 |
|---|---|---|
| committer | xel1uz <16402913+xel1uz@users.noreply.github.com> | 2026-11-25 08:10:38 +0100 |
| commit | f85de7d9535ef41a6b071d8f9c7f11cbf9180517 (patch) | |
| tree | 8b71163bc83afd0611bc2797115929f9cb356771 /runtime/test/code_hooks_test.cpp | |
| parent | 42537e7b6f84c233ac009b924d3a25d2a1178197 (diff) | |
gen_gdk_runtime_classes: write --out atomically
Write the generated JSON to a temporary file in the destination directory, then atomically replace the output. Remove the temporary file on write errors and preserve output permissions.
Before: with 128 synthetic classes and an existing 14-byte output, `bash -c 'trap "" XFSZ; ulimit -f 1; python3 -I tools/gen_gdk_runtime_classes.py /home/hampa/.hermes/profiles/mikuling/cache/scratch/gdk-atomic-repro/docs --out /home/hampa/.hermes/profiles/mikuling/cache/scratch/gdk-atomic-repro/out.json'` returned 1 (Errno 27, File too large); output grew to 1024 bytes (partial JSON).
After: the same command returned 1, left the 14-byte sentinel unchanged, and left no temporary file. Tests against upstream/main: 1 failed, 2 passed; against the fix: 3 passed.
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions