fix(web): validate library manifest target and identity #12351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12351"
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:03Z.
What
Validates browser library-manifest target and module identity before downloads. The main integration keeps the shared ZIP environment setup and all archive root, Windows-path and reserved-name test steps, together with this PR's worker-manifest test. Both main's tools/test_web.py archive invocations and the manifest test remain registered.
Tested
Updated head
20e26d034d623099ce35ed984c600a3d53b15ea4integrates recorded mainba627802e2210187d417deb64c8f2fed8e33011f. Windows and Linux: executed the current workflow's Node helper/manifest/directory-writer tests and all three archive scripts against the source archive module, using its pinned ZIP URL. Six browser module syntax checks and tools/test_web.py compilation pass. This validates the actual workflow commands and source modules; it is not a full WebAssembly converter build or browser conversion run. Current-main conventions, whitespace, script registration and main ancestry pass. New hosted runs remain pending until complete.Earlier implementation evidence and validation (historical revisions)
What
Validate the requested platform and release manifest before downloading a system-library archive. Require the target/hash-addressed archive path and bounded integer sizes to agree with the manifest producer. Keep the existing download, checksum and cancellation checks.
Update both pre-existing archive fixtures to derive their paths from the computed digest. Register
worker-manifest.test.mjsin a dedicated step of the existing path-filtered PR Web tests job, as well as the release-timetools/test_web.pycommand. The PR workflow now executes the manifest regressions without requiring generated WASM artifacts.Tested
Exact tested head:
24fbd54aa5bf5edcdf662c01b50900c23b94b67f; rebased onto current main785f7b35d9d26fbf09dc52f225b9d36ec83812b6. This is the explicit main snapshot observed for the final sync; subsequent upstream merges are not included in this claim.Windows: Python 3.14.3, Node 24.14.1, WinLibs GCC 15.2, CMake 4.3.1. WSL Ubuntu 26.04: Python 3.14.4, Node 22.22.1, GCC 15.2, CMake 4.2.3. Exact committed source archives were tested on the native Linux filesystem. All results below are local results at this head.
node --testcommands extracted from this head's.github/workflows/web-tests.yml: the existing 15 helper cases plusworker-manifest.test.mjspass (16 total, no failures/skips) on both OSes. All six production browser modules passnode --check.relinker_webtarget in WSL with Emscripten 6.0.3, Ninja Release andANYPS5_BUILD_WASM=ON, then run the completepython3 tools/test_web.py --build BUILDcommand: passed on Linux and Windows. Windows runs the same WSL-built WASM/JavaScript artifacts under native Windows Node; this is not a Windows-host Emscripten build.The final heads of #12351 (
24fbd54aa5bf5edcdf662c01b50900c23b94b67f) and #12353 (0e9dba02ccdea1a4cd2dd58efabbe820ffb03a75) merge cleanly. Their PR-workflow additions occupy separate steps and both registrations survive the merge; neither PR requires the other first. Previous combined-run evidence belongs to its original snapshot and is not substituted for these exact-head runs.No local macOS/older-Python runtime, full native system-library build, GPU, PS5 or game execution was performed. The archive boundary fixtures do not establish browser filesystem behavior on a real title. Hosted jobs for this new head will be evaluated after publication and are not counted as local passes.
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 MarcZX10 on 2026-10-28T11:10:11Z.
Review: APPROVED
Reviewed exact head
f0e88751b94a5e9533c7fdaf5fe23573b0c53758. The stricter manifest validation is paired with checksum-addressed fixtures in the pre-existing archive tests, and the new fixture covers malformed manifests, unsupported targets, valid downloads, checksum mismatch, size mismatch, and cancellation. I ran the exact five-file Node suite locally on Node 20.19.2: 16/16 passed. The hosted output-directory test and Ubuntu/Windows relinker plus ASan checks pass; macOS relinker jobs remain queued.The full
tools/test_web.pyintegration command reached the archive integration step but could not load the generatedrelinker_wasm.mjs, which is absent from this checkout; the 16 Node tests had already passed. I previously observed three intermittent child-process exits with null code and empty output, followed by 20 successful repetitions. I have not reproduced that failure in the current exact-head run, and I’m recording it as a test-stability follow-up rather than a blocker.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:37:36Z.
Review: COMMENTED
Re-reviewed exact head
24fbd54aa5bf5edcdf662c01b50900c23b94b67f. The updated fixtures now derive archive paths from their SHA-256 digests, and the workflow contains a dedicatednode --test demo/web/tests/worker-manifest.test.mjsstep; the regression is therefore included in PR CI independently of the WASM integration job. Locally on Node 20.19.2, that exact command passed 1/1; the existing four-file Web workflow command passed 15/15.node --check demo/web/worker.mjs,git diff --check upstream/main...HEAD, andpython3 tools/check_conventions.py --base upstream/mainalso passed. The refreshed hosted conventions, eligibility, and output-directory jobs are still pending, so I have not submitted a final approval on this head.