Commit Graph

20 Commits

Author SHA1 Message Date
6861c7d36c tools/classify_carve.py: normalize head case, accept argv, and check resolved report path upfront 2026-11-26 20:25:22 +08:00
8d296d8158 classify_carve: close mkstemp fd on fdopen error and restore mode before unlink 2026-11-24 20:53:08 +08:00
18fc40ce48 Merge PR #9587 2026-11-23 17:08:32 -05:00
bb0ca26c09 fix: accept UTF-8 BOM in carve indexes 2026-11-24 10:30:44 +13:00
fe132ae8b2 classify_carve: catch RecursionError and unreadable root, and preserve symlinked types.json 2026-11-23 22:22:28 +01:00
d90444f21e classify_carve: the usage line names tools/classify_carve.py (EGEN-CLASSIFYCARVE-USAGE) (#6752)
Squash-merged after diff review of PR #6752
2026-11-23 10:47:35 -06:00
77938c99ed classify_carve: make directory error actionable 2026-11-22 14:39:03 -06:00
bfcf319c5d classify_carve: refuse a directory report path 2026-11-22 14:30:37 -06:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
89cf18645e Merge pull request #1428 from Dominik 2026-11-22 06:38:01 -05:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
42537d6987 classify_carve, spirv_stubs: -h/--help prints usage instead of being read as a path
Both tools parse sys.argv by hand, so --help was taken as the input folder:
classify_carve reported '--help: does not exist' (exit 2) and spirv_stubs
'missing --help/index.json' (exit 1). -h and --help now print the usage to
stdout and exit 0 without touching the file system. Tests cover both flags
on both tools and fail on the previous code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:22:32 +00:00
7098db5525 Merge pull request #1120 from KanameS 2026-11-22 02:47:47 -05:00
82cbfaa2d0 classify_carve: write the size stats the docstring describes
The module docstring has said types.json holds counts and size stats, but
only files and bytes were written. Each per-class entry, overall and per
archive, now also has min, max and median: the smallest, largest and
median (lower middle for an even count) file size in bytes. The existing
keys, their values and the printed summary are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 14:12:42 +07:00
a1c943f8af Report writers: published files get the umask's bits, not mkstemp's 0600
awc_manifest, rsc8_audio and classify_carve stage their report in a 0600
temp file and os.replace it, so on POSIX the report ended up 0600.
rbf0_tree had its own copy of the umask(0)/umask(mask) read that file_mode
replaced (#750). All four now use file_mode.published_mode, and
tests/test_file_mode.py covers them with the other writers.
2026-11-22 12:11:24 +05:30
d771bd88e2 classify_carve.py: a missing argument or a bad carve root is one line
main() read sys.argv[1] directly: no argument was an IndexError, a
missing root a FileNotFoundError from os.listdir and a file a
NotADirectoryError, all as tracebacks. A second argument was silently
ignored and the run went ahead. Now a wrong argument count prints the
usage line, and a missing or non-folder root names the path; both exit
2 before types.json is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:50:48 +01:00
1842b429ce classify_carve.py: report malformed indexes without replacing the census 2026-11-22 01:01:59 +01:00
31925ff0c6 classify_carve.py: preserve reports when a write fails 2026-11-22 00:23:40 +01:00
4f1ff7d85b Replace local drive paths with placeholders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:59:05 -05:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:22:16 -05:00