tooling: report unreadable layouts in verify_build #2463
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2471"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by louisdibiasi on 2026-11-25T17:40:39Z.
Malformed XML or a layout missing required attributes currently raises a traceback and exits 1, the same status used for a failed payload check. Report these cases as usage errors instead, without writing an integrity report.
The regression check exercises malformed XML and missing chunk and file-group attributes through the CLI. Existing valid layout and torrent checks remain in the same test.
Tests:
python -B tests/layout_chunks_check.py(passed)python -B tests/bidi_controls_check.py(passed)git diff --check(passed before commit)AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:02:31Z.
Four mutations caught, two survive — and the survivors are both cases the fixture's three layouts cannot reach
Baseline:
tests/layout_chunks_check.py→layout chunk summary ok, exit 0.exceptinverify_build.pyexcept ()(nothing caught)ET.ParseErrordropped from the tupleKeyErrordropped from the tupleOSErrordropped from the tuple{type(exc).__name__}and{exc!a}Why those two survive, from reading the fixture rather than guessing
check_unreadable_layout_is_a_usage_errorbuilds three layouts —<Package>, a<Package><Chunk/></Package>witha missing field, and a chunk without a
FileGroup— and assertsreturncode == 2,"layout.xml" in run.stderr,no
Traceback, and no report file. Those three coverParseError(case 1) andKeyError(cases 2 and 3). None ofthem produces an
OSError, and none of them looks at the part of the message after the file name:So
OSErroris in the tuple on principle rather than because a case needs it, and thetype(exc).__name__: {exc!a}suffix — which is the part that makes the message actionable — is unasserted. A reader of this PR learns that an
unreadable layout is a usage error, but not that the error says which kind.
Two cheap ways to close it, either is enough:
<Package>case,assert "ParseError" in run.stderr— one line,and it distinguishes "readable message" from "any message that mentions the file".
layout.xmlas a directory, orchmod 0on POSIXonly, and assert the same three things — that is the only way
OSErrorgets exercised.I would take (1); (2) is platform-dependent and this check is in the cross-platform list.
What the caught rows establish
Dropping
ET.ParseErrororKeyErrorindividually each turns the check red, so the tuple is not decorative: thethree fixture layouts really do exercise two of the four members, and losing either makes a malformed layout escape
as an uncaught exception. And
except ()(nothing caught) fails, which means the assertion onTracebackis doingits job rather than being satisfied by accident.
AI-assisted; the five mutations were run locally on Windows 11 build 26300.9974.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:11:32Z.
Review: COMMENTED
Review of head
c798b8e9: sound.compare_layoutis now wrapped, soOSError,ET.ParseErrorandKeyErrorbecome a usage error (exit 2). No report is written before the check.excepttoOSErroronly makestests/layout_chunks_check.pyfail on the first case (exit 1 with a traceback). The new test guards the change.Commands run:
python3 -B tests/layout_chunks_check.py(pass)python3 tests/docs_links_check.py(pass)python3 tests/bidi_controls_check.py(pass)git diff --check origin/main...HEAD(clean)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:16:07Z.
Win2025 WARP receipt for head
ac4cd6b0after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
ac4cd6b0a024a3bf9004e42f5907b86e30670852:tests/layout_chunks_check.pyok (1.2s)sccache: 0/8 hits; wall17.5sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:16:43Z.
Win2025 WARP receipt for head
ac4cd6b0after updating with main (dev + release).Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
ac4cd6b0a024a3bf9004e42f5907b86e30670852:--preset dev):cmake --build --preset dev -- -j 2):0.00s(configure0.00s)ctest --preset dev -R '^layout_chunk_summary$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.16s:layout_chunk_summary1.00s)/O2(--preset release):cmake --build --preset release -- -j 2):0.00s(configure0.00s)ctest --preset release -R '^layout_chunk_summary$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.20s:layout_chunk_summary1.03s)tests/layout_chunks_check.pyok (0.9s)sccache: 0/12 hits; wall15.3sAI-assisted; commands listed were executed locally.