fix(ci): follow host test dependency inputs #12159

Merged
Queuse merged 3 commits from upstream-pr/12159 into main 2026-11-05 00:12:29 +00:00
Queuse commented 2026-10-28 00:16:05 +00:00 (Migrated from github.com)

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_registration and test_script_registration CTests 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/main and git diff --check origin/main...HEAD passed.

  • 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 head 421ce3f49e passes 25/25 selector tests on Windows and Ubuntu WSL; it is not a published combined head.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5043098377 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12159). Originally posted by [Queuse](https://github.com/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. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - 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_registration` and `test_script_registration` CTests 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/main` and `git diff --check origin/main...HEAD` passed. - 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](https://github.com/boykopovar/AnyPS5/actions/runs/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 head `421ce3f49e` passes 25/25 selector tests on Windows and Ubuntu WSL; it is not a published combined head. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
rooklz commented 2026-10-28 00:22:10 +00:00 (Migrated from github.com)

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:

  • Reproduced the gap on a real reply with a core/libs/tests executable linked against an OBJECT library: with core/libs/src/helper.cpp changed, base prints No changed host-only core/libs test executables require a link check and exits 0 — the check returns success without attempting the link. Head selects the test.
  • Link propagation: with an unresolved symbol in the helper, base still exits 0 (silent pass on a broken link); head attempts cmake --build, the link fails, and main reports Command [...] returned non-zero exit status 1. — controlled diagnostic, exit 1, no traceback.
  • False-positive check for the new strict dependency validation: BFS-walked every target of a genuine relinker-only codemodel reply of this tree (39 targets: 36 executables, static/shared libs, utility) — zero ValueErrors from target_reached_sources.
  • The 3 new behaviour tests fail against the base implementation as intended (they pin the new selection).
  • check_conventions.py --base origin/main PASS on the branch; pr_overlap.py no overlap.

Blocking: one new test fails on macOS (6 subTests) — CI impact.

test_invalid_dependency_entries_raise_controlled_errors builds its source root as Path(self.temporary.name) without .resolve(). On macOS the temp dir lives under /var, a symlink to /private/var: host_only_test_targets resolves the target's source dir ((source_root / target["paths"]["source"]).resolve()) and then relative_to the unresolved root throws, so the target never qualifies and the new validation never runs — no ValueError is raised. Every other test in the file goes through read_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_targets is registered ungated when Python is found (root CMakeLists.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 ... OK on this Mac afterwards:

-        source_root = Path(self.temporary.name)
+        source_root = Path(self.temporary.name).resolve()

(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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5676268926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12159#pullrequestreview-5676268926). Originally posted by [rooklz](https://github.com/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:** - Reproduced the gap on a real reply with a `core/libs/tests` executable linked against an OBJECT library: with `core/libs/src/helper.cpp` changed, base prints `No changed host-only core/libs test executables require a link check` and exits 0 — the check returns success without attempting the link. Head selects the test. - Link propagation: with an unresolved symbol in the helper, base still exits 0 (silent pass on a broken link); head attempts `cmake --build`, the link fails, and `main` reports `Command [...] returned non-zero exit status 1.` — controlled diagnostic, exit 1, no traceback. - False-positive check for the new strict dependency validation: BFS-walked every target of a genuine relinker-only codemodel reply of this tree (39 targets: 36 executables, static/shared libs, utility) — zero `ValueError`s from `target_reached_sources`. - The 3 new behaviour tests fail against the base implementation as intended (they pin the new selection). - `check_conventions.py --base origin/main` PASS on the branch; `pr_overlap.py` no overlap. **Blocking: one new test fails on macOS (6 subTests) — CI impact.** `test_invalid_dependency_entries_raise_controlled_errors` builds its source root as `Path(self.temporary.name)` without `.resolve()`. On macOS the temp dir lives under `/var`, a symlink to `/private/var`: `host_only_test_targets` resolves the target's source dir (`(source_root / target["paths"]["source"]).resolve()`) and then `relative_to` the unresolved root throws, so the target never qualifies and the new validation never runs — no `ValueError` is raised. Every other test in the file goes through `read_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_targets` is registered ungated when Python is found (root `CMakeLists.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 ... OK` on this Mac afterwards: ```diff - source_root = Path(self.temporary.name) + source_root = Path(self.temporary.name).resolve() ``` (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.
rooklz commented 2026-10-28 00:34:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T00:34:12Z.

Review: APPROVED


Fix verified at head 0e54f3d30b on macOS: the push is exactly the proposed one-line .resolve() on the test's source root (diff vs 0edd9a1940 is 1 file, 1 line).

  • python3 tools/tests/test_mingw_host_only_test_targets.py → 13/13 OK on macOS (was 7/13 with test_invalid_dependency_entries_raise_controlled_errors failing 6/6 subTests via the /var → /private/var symlink mismatch).
  • That test in isolation: ok, 0 subtest failures — the new dep-id validation now runs past qualification on macOS.
  • Fix is platform-neutral (resolve() is a no-op on non-symlinked roots, so Linux/Windows behaviour is unchanged).
  • 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5676343758 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12159#pullrequestreview-5676343758). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-28T00:34:12Z. **Review:** APPROVED --- Fix verified at head `0e54f3d30b` on macOS: the push is exactly the proposed one-line `.resolve()` on the test's source root (diff vs `0edd9a1940` is 1 file, 1 line). - `python3 tools/tests/test_mingw_host_only_test_targets.py` → **13/13 OK** on macOS (was 7/13 with `test_invalid_dependency_entries_raise_controlled_errors` failing 6/6 subTests via the /var → /private/var symlink mismatch). - That test in isolation: ok, 0 subtest failures — the new dep-id validation now runs past qualification on macOS. - Fix is platform-neutral (resolve() is a no-op on non-symlinked roots, so Linux/Windows behaviour is unchanged). - `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.
THEMANnt commented 2026-10-28 04:30:08 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677803391 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12159#pullrequestreview-5677803391). Originally posted by [THEMANnt](https://github.com/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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12159
No description provided.