fix(tools): reject empty native web build artifacts #12352
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12352"
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 boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-28T10:31:21Z.
What
build_web.py --localconsidered zero-byterelinker_wasm.mjsor.wasmvalid and overwrote a previously useful site with an unusable build. Reject either empty native artifact before copying site sources, retaining the existing missing-file checks.Implementation basis: The local publish path already requires both native files before
copy_sources(). A zero-length module cannot supply the required native Web entry point; this adds the minimal nonempty prerequisite at that same preflight boundary.Reference sources at the starting main: tools/build_web.py.
Tested
Exact PR head:
668fb237cdad6d86fd056d40a58c77e411da819b; refreshed starting main:5ae16ad52b5ab6be84c135de0eadb97545616c26. This branch contains one independent commit.Windows: MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3, Node 24.14.1. WSL Ubuntu 26.04: GCC 15.2, CMake 4.2.3, Python 3.14.4, Node 22.22.1. Native builds use Ninja Release,
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ONandcmake --build BUILD --parallel 8. Focused CTest runs use-V --parallel 4on Windows and-V --parallel 8on WSL; test-registration and skip-policy audits pass.Command:
ctest --test-dir BUILD -R '^web_library_assets$|^web_release$' -V --parallel N.Run the real local CLI with missing/empty permutations and verify existing
app.mjs/.nojekyllsentinels remain unchanged. A nonempty fixture succeeds. The earlier argv-acceptance fixture now writes nonempty module bytes instead of touching empty files, preserving that test purpose. The old implementation fails the empty-artifact regression.Current-main integration: checked each branch's independent three-way merge against
3a40945e62b7e2543031d5da2b8e351ab603bc1a(all clean), then built and tested the actual merge of that main and all ten initial implementation heads at91a099a5c398b221b4a88a8f0e0f0b1068a2dbb9. On each OS, all 86 selected CTest groups and 30 Node tests passed. Slowest CTest group: 9.77s Windows / 4.26s WSL. This combined run supplements the independent head runs; it does not make another project a prerequisite. Main's newly merged release-note/cache/test-runner changes were preserved. No locally exercised final CTest group exceeded 30s.A final open-PR refresh examined 68 new/updated heads since screening. The only newly shared files belonged to #12338 (release-note symlink-loop diagnostics,
761fe2785b28082fda8ce5910cb0e7e4451329bf) and #12328 (separate fuzz-seed test registration,70993dbf30e355257458a9028785ac5a131fe033). Both merge cleanly with the tested current-main combination at9ca88c064583c44d0707810d2ec2873f2608489d. In that context the release-note suite and registration audits passed on both OSes, with all 70 trace cases and both CSV registrations preserved. These are focused integration checks, not whole external PR builds. Their behavior is distinct and introduces no ordering dependency.Pre-push review:
git diff --check, Python 3.9 grammar parsing of changed Python files, current-main conventions checker with this complete body, and production test registration audit. Officialtools/pr_overlap.py --branch BRANCH --jobs 2completed against all open PRs at its recorded snapshot. Its result wasNo overlap with open pull requests.No same behavior was identified in the open-PR/history review; no ordering dependency is required in this snapshot.Known limits: Nonempty bytes do not establish semantic JavaScript/WASM validity or matching artifact versions. Tests use fixture artifacts; supplemental combined Emscripten compilation and complete Web fixture tests are recorded below. macOS and an older Python runtime were not available locally; Python 3.9 syntax parsing is not runtime testing. No full system-library build, PS5 measurement or game run is claimed. Hosted checks are pending publication/maintainer workflow dispatch and are not counted as local passes.
Supplemental Web integration validation after initial publication: the existing
archive-root.test.mjsexposed a preexisting fixture path (linux-1234.zip) that no longer satisfied the producer's checksum-addressed naming contract. PR #12351 now updates only that fixture and itsarchive.test.mjscounterpart atf0e88751b94a5e9533c7fdaf5fe23573b0c53758, without changing production logic or weakening any assertions. The original failed hosted job is superseded only when its replacement completes.Using the repository CI's Emscripten 6.0.3, both that exact worker head and the current-main combination at
e7056168154f9377796ea7c6782494a8d652a0eewere built withemcmake cmake -DANYPS5_BUILD_WASM=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release, thencmake --build BUILD --target relinker_web --parallel 8. The combination consists of the tested main3a40945e62b7e2543031d5da2b8e351ab603bc1aand all ten published implementation heads, with #12351's fixture follow-up. Both completepython3 tools/test_web.py --build BUILDsuites passed under WSL Node 22.22.1 and Windows Node 24.14.1. Windows executes the same WASM/JavaScript binaries compiled in WSL; this is not a Windows-host Emscripten build. Real ZIP-library integration and actual WASM conversion exercise ZIP/folder inputs, Windows/Linux output, modules, original resources, permissions, streamed ZIP and directory output, batch roots and manifest download/rate-limit/error handling. Additional archive-root, Windows archive and reserved-path suites passed independently on both OSes. Network/library data and filesystem endpoints remain controlled fixtures; no PS5 or real game run is claimed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T10:50:03Z.
Review: APPROVED
Checked head
668fb237cdon macOS arm64 (Apple clang, CMake + Ninja Release,-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON, Python 3.13):tools.tests.test_build_web: 17 OK.tools/build_web.pyreverted to main, the new test fails. The twomissing=False(empty file) subtests fail withSystemExit not raised, as they should. The twomissing=Truesubtests also fail on main, but only because the empty-file subtest before each one rancopy_sources()and overwrote the sharedapp.mjsmarker. Missing files were already rejected on main, so those two failures come from the earlier subtest. That's fine as a regression signal, but if you want each subtest to fail only for its own case, rewrite the marker at the start of each subtest. Not blocking.st_size < 0, a guard that only covers.mjs, a guard that only covers.wasm,st_size <= 8, and dropping{name}from the message. The test catches all 5.3a40945e62: 270/270 build, ctest 378/378.check_conventions --base upstream/mainpasses, the merge-tree is clean, andpr_overlap --branchreports no overlap with open pull requests.Approving.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T10:53:53Z.
Review: APPROVED
Reviewed the early artifact checks and regression coverage. The exact-head
test_build_web.pyrun passed 17 tests with 1 platform skip; it verifies that empty or missing native artifacts are rejected before copying sources and that prior site output is preserved, while nonempty artifacts still build. Hosted Linux and Windows relinker checks and the refreshed conventions/labels checks pass. macOS relinker jobs remain pending.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T11:54:13Z.
Review: APPROVED
Reviewed
668fb237cdad6d86fd056d40a58c77e411da819b— approve. Empty native web artifacts are rejected before copying site sources, preserving an existing site on invalid build input.Windows/Python 3.11: head test_build_web.py: 16 passed, 1 skipped (17 total); base test_build_web.py: 15 passed, 1 skipped (16 total). The missing/empty artifact cases for both native files execute and fail against old production because it overwrites the existing marker. Nonempty success remains covered. No Emscripten compiler or live site publication is claimed.