fix(ci): follow host test dependency inputs #12159
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12159"
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 Queuse on 2026-10-28T00:16:05Z.
What
Source edits in an OBJECT library or test helper can leave a dependent host test unselected, so the Windows pull-request check returns success without attempting its link. Match each qualifying test against the original sources of its transitive CMake link-input dependencies, with cycle handling and controlled diagnostics for missing or invalid dependency records.
Changed-input traversal follows OBJECT, STATIC and INTERFACE libraries and native shared/module test helpers, skipping UTILITY/custom targets and shared/module product libraries. Build-order-only product changes no longer select host tests. Existing link-based qualification stays in place. This follows the check introduced by #11343 for #11287.
Tested
Current follow-up head
9d6c2de6f1: Windows/Python 3.12.10 and Ubuntu under WSL2/Python 3.14.4 each pass 15/15 selector tests. New controls reject order-only product/UTILITY source selection and malformed source paths; object/static/interface selection and cycles remain covered. A genuine Windows CMake/Ninja fixture confirms changed object input still selects and links its test, while changed shared-product and UTILITY inputs no longer select it. A private source combination with #12167 passes 23/23 selector tests on both platforms. These are selector/fixture checks, not a full product build or a tested combined PR head. Current conventions, whitespace and the canonical overlap scan pass (no reported overlap).The earlier 13-test, build and junction/symlink results below refer to preceding head
0e54f3d30b, not fresh runs on this follow-up.Windows 11, Python 3.12.10:
python tools/tests/test_mingw_host_only_test_targets.py- 13/13 passed.Ubuntu WSL, Python 3.14.4: the same selector suite - 13/13 passed.
Windows/WinLibs GCC 15.2.0 r7, Ninja, Release: relinker-only build passed;
mingw_host_only_test_targets,test_registrationandtest_script_registrationCTests passed 3/3.python tools/check_test_registration.py build/host-selector-relinker- 40 declared test executables, none unregistered.Real CMake/Ninja fixtures on Windows/MinGW and Ubuntu WSL: a changed OBJECT helper selects its dependent test, and an intentional unresolved helper symbol propagates a nonzero link result. Before this change the checker returned success without building that target.
New dependency-source regressions fail against the preceding main implementation. The dependency-record regression also failed before the diagnostic adjustment.
python tools/check_conventions.py --base origin/mainandgit diff --check origin/main...HEADpassed.python tools/pr_overlap.py --branch codex/fix-host-test-dependency-inputs checked 1,362 open PRs and reported no overlap.
Windows junction-backed TEMP and symlinked Ubuntu WSL TMPDIR: the selector suite passes 13/13 in each aliased directory, as well as in the normal temporary directories.
Full product, title and GPU tests were not run.
Hosted run 40666912678 passed the Windows host-only link check, all four relinker jobs and ASan on
9d6c2de6f1. Linux product, register-context and write-watch jobs were skipped. A fresh private combination with rebased #12167 head421ce3f49epasses 25/25 selector tests on Windows and Ubuntu WSL; it is not a published combined head.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-28T00:22:10Z.
Review: CHANGES_REQUESTED
Verified the behaviour change end-to-end on a real CMake/Ninja File API reply on macOS (Homebrew Python 3.13, cmake 4.x + Ninja), which fills the macOS side your Windows/WSL runs didn't cover.
Fix verified sound:
core/libs/testsexecutable linked against an OBJECT library: withcore/libs/src/helper.cppchanged, base printsNo changed host-only core/libs test executables require a link checkand exits 0 — the check returns success without attempting the link. Head selects the test.cmake --build, the link fails, andmainreportsCommand [...] returned non-zero exit status 1.— controlled diagnostic, exit 1, no traceback.ValueErrors fromtarget_reached_sources.check_conventions.py --base origin/mainPASS on the branch;pr_overlap.pyno overlap.Blocking: one new test fails on macOS (6 subTests) — CI impact.
test_invalid_dependency_entries_raise_controlled_errorsbuilds its source root asPath(self.temporary.name)without.resolve(). On macOS the temp dir lives under/var, a symlink to/private/var:host_only_test_targetsresolves the target's source dir ((source_root / target["paths"]["source"]).resolve()) and thenrelative_tothe unresolved root throws, so the target never qualifies and the new validation never runs — noValueErroris raised. Every other test in the file goes throughread_reply(), which returns a resolved root, so only this test diverges. Standalone proof on this machine: unresolved root → returns[]with no error; resolved root →ValueError: invalid dependency list: expected a list of objects.mingw_host_only_test_targetsis registered ungated when Python is found (rootCMakeLists.txt), and GitHub's macOS runners also use a/var/folders/...TMPDIR, so the macOS ctest lanes will run these 6 subTests into failure. With Python 3.12.10/3.14.4 on Windows/WSL there is no symlink, which is why it passes there.One-line fix, verified
Ran 13 tests ... OKon this Mac afterwards:(Routing the test through
self.fixture()+read_reply()like the rest of the file would work too.)Everything else is good to go — happy to approve as soon as the test's source root is resolved.
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T00:34:12Z.
Review: APPROVED
Fix verified at head
0e54f3d30bon macOS: the push is exactly the proposed one-line.resolve()on the test's source root (diff vs0edd9a1940is 1 file, 1 line).python3 tools/tests/test_mingw_host_only_test_targets.py→ 13/13 OK on macOS (was 7/13 withtest_invalid_dependency_entries_raise_controlled_errorsfailing 6/6 subTests via the /var → /private/var symlink mismatch).check_conventions.py --base upstream/main: PASS.The end-to-end evidence from my earlier review (base accepting without linking, head selecting + propagating the link failure, 0 false positives over 39 real targets) stands unchanged. Thanks for the quick fix.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T04:30:08Z.
Review: APPROVED
Reviewed
0e54f3d30bbaa7aec23c1e74089214d0e132142e— approve. Changed-source selection follows CMake target dependencies, validates unknown dependency IDs and terminates on cycles.Windows/Python 3.11: head 13 passed (13 total); author base 9 passed (9 total). Current tests against old production fail nine selection assertions. The existing host-only qualification remains separate from dependency reachability; this covers selector fixtures, not full product execution.
The inspected hosted Windows relinker job merged this exact head and completed successfully. This is not a full product or game build.