fix(build): skip the core/libs relinker CLI tests when ANYPS5_RELINKER_CLI is OFF #12068

Merged
dantdmdarealguy merged 1 commit from upstream-pr/12068 into main 2026-10-29 23:28:21 +00:00
dantdmdarealguy commented 2026-10-27 18:37:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-27T18:37:17Z.


What

On main, a test build without the native relinker command line fails to generate. This happens on Windows and on Linux:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF
...
CMake Error at core/libs/prx/libSceSystemService/CMakeLists.txt:29 (add_test):
  Error evaluating generator expression:
    $<TARGET_FILE:relinker>
  No target "relinker"
CMake Error at core/libs/prx/libkernel/CMakeLists.txt:142 (add_test):
CMake Error at core/libs/prx/libkernel/CMakeLists.txt:2184 (add_test):   (Windows, twice)
CMake Error at core/libs/prx/libkernel/CMakeLists.txt:254 (add_dependencies):  (Linux)
  The dependency target "relinker" of target "guest_runtime_lifecycle_tests" does not exist.
CMake Error at core/libs/prx/libSceAgcDriver/CMakeLists.txt:3100 (add_dependencies):  (Linux)
CMake Generate step failed.  Build files cannot be regenerated correctly.

core/relinker/CMakeLists.txt defines the relinker executable only when ANYPS5_RELINKER_CLI is ON. Its own command line tests come after the if(NOT ANYPS5_RELINKER_CLI) return(), so they drop out with it. Five tests registered in core/libs also run the relinker command line, but nothing guards them: exec_arguments, loadexec_arguments, guest_timed_join_import_libkernel_{sys,web} (Windows), guest_runtime_lifecycle and agc_driver_guest_memory_lifetime_converted (Linux). The option can't guard them in place, because it was declared in core/relinker, which the root CMakeLists.txt adds after core/libs.

The change:

  • declares ANYPS5_RELINKER_CLI in the root CMakeLists.txt next to ANYPS5_BUILD_WASM, before core/libs. The WASM branch still forces the option OFF, and core/relinker no longer declares it.
  • adds AND ANYPS5_RELINKER_CLI to the existing conditions around those five registrations (the Python3_FOUND / Python3_Interpreter_FOUND checks).

The default build (option ON) registers exactly the same tests as before. No CI job builds the option OFF with tests. #11455 (open) adds -DANYPS5_RELINKER_CLI=OFF to the BUILD.md option table as a user-facing flag. No title is involved: this fixes a broken build configuration.

Tested

Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, on 2ee8e9751a. Linux: Arch Linux on WSL2, GCC 16.1.1, glibc 2.43, Release, no Vulkan device. ctest --parallel 2 --timeout 300 with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 SDL_AUDIODRIVER=dummy on Windows, and ANYPS5_NO_SHADER_CACHE=1 SDL_AUDIODRIVER=dummy on Linux.

  • Rebased onto main 14332cd8d0: the Windows configure with -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF generates, and every $<TARGET_FILE:relinker> / relinker dependency under core/libs on that head is inside an ANYPS5_RELINKER_CLI condition.
  • -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF on main: generate fails on Windows (4 errors, above) and on Linux (6 errors). With this change it generates on both.
    • Windows: full build 0 errors (the same 40 warnings as the default build), libs builds, and ctest passes 2478 of 2479. The one failure is hardware_oracle, which fails here because of the LLVM ld.lld on PATH. patched_libraries reports 368 patched libraries loaded, 0 failed.
    • Linux: full build 0 errors, ctest passes 2362 of 2366. The 4 failures are the AGC tests that fail without a Vulkan device on main too (#11638).
    • tools/check_test_registration.py: 0 built and not run on Windows (1439 executables) and Linux (1435).
  • Default build (option ON):
    • The generated CTestTestfile.cmake files are identical to main on Windows and Linux. Paths were normalised, and the only difference is backtrace line numbers.
    • Windows: ctest -R "^(exec_arguments|loadexec_arguments|guest_timed_join_import_libkernel_sys|guest_timed_join_import_libkernel_web)$|patched_libraries" passes 5 of 5 (368 patched libraries loaded, 0 failed). check_test_registration.py reports 1469 test executable(s), 0 built and not run as recorded, none new.
    • On main the same build passes 2667 of 2668 in full ctest. The exception is one intermittent agc_driver_pm4_rewind_trace failure, which passes 5 of 5 alone and is unrelated.
  • There is no new ctest. The failure happens at CMake generate time, and a test that configures the tree takes about 3 minutes here, past the 30 s limit. The before and after configure output above is the evidence.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py --branch fix/relinker-cli-off-test-registrations reports no conflicting lines, but it couldn't compare 86 PRs that conflict with main. Of those, I checked the ones that touch these lines:
    • #11051 changes the loadexecLibraries line directly below the guarded if, so it is an adjacent-line conflict for whichever merges second.
    • #6713, #9793 and #10861 add $<TARGET_FILE:relinker> tests inside core/relinker, after its existing return(), so they are unaffected.
    • #11366 forces the option OFF only together with ANYPS5_RELINKER_ONLY, which skips core/libs.
  • The libSceAgcDriver edit only removes the Linux agc_driver_guest_memory_lifetime_converted registration when the option is OFF. The default registration is unchanged, and Windows doesn't register that test, so I ran no GPU validation runs.

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, some AI assistance was used
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5039211340 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12068). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-27T18:37:17Z. --- ### What On `main`, a test build without the native relinker command line fails to generate. This happens on Windows and on Linux: ``` cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF ... CMake Error at core/libs/prx/libSceSystemService/CMakeLists.txt:29 (add_test): Error evaluating generator expression: $<TARGET_FILE:relinker> No target "relinker" CMake Error at core/libs/prx/libkernel/CMakeLists.txt:142 (add_test): CMake Error at core/libs/prx/libkernel/CMakeLists.txt:2184 (add_test): (Windows, twice) CMake Error at core/libs/prx/libkernel/CMakeLists.txt:254 (add_dependencies): (Linux) The dependency target "relinker" of target "guest_runtime_lifecycle_tests" does not exist. CMake Error at core/libs/prx/libSceAgcDriver/CMakeLists.txt:3100 (add_dependencies): (Linux) CMake Generate step failed. Build files cannot be regenerated correctly. ``` `core/relinker/CMakeLists.txt` defines the `relinker` executable only when `ANYPS5_RELINKER_CLI` is ON. Its own command line tests come after the `if(NOT ANYPS5_RELINKER_CLI) return()`, so they drop out with it. Five tests registered in `core/libs` also run the relinker command line, but nothing guards them: `exec_arguments`, `loadexec_arguments`, `guest_timed_join_import_libkernel_{sys,web}` (Windows), `guest_runtime_lifecycle` and `agc_driver_guest_memory_lifetime_converted` (Linux). The option can't guard them in place, because it was declared in `core/relinker`, which the root `CMakeLists.txt` adds after `core/libs`. The change: - declares `ANYPS5_RELINKER_CLI` in the root `CMakeLists.txt` next to `ANYPS5_BUILD_WASM`, before `core/libs`. The WASM branch still forces the option OFF, and `core/relinker` no longer declares it. - adds `AND ANYPS5_RELINKER_CLI` to the existing conditions around those five registrations (the `Python3_FOUND` / `Python3_Interpreter_FOUND` checks). The default build (option ON) registers exactly the same tests as before. No CI job builds the option OFF with tests. #11455 (open) adds `-DANYPS5_RELINKER_CLI=OFF` to the BUILD.md option table as a user-facing flag. No title is involved: this fixes a broken build configuration. ### Tested Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, on `2ee8e9751a`. Linux: Arch Linux on WSL2, GCC 16.1.1, glibc 2.43, Release, no Vulkan device. `ctest --parallel 2 --timeout 300` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 SDL_AUDIODRIVER=dummy` on Windows, and `ANYPS5_NO_SHADER_CACHE=1 SDL_AUDIODRIVER=dummy` on Linux. - Rebased onto `main` 14332cd8d0: the Windows configure with `-DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF` generates, and every `$<TARGET_FILE:relinker>` / `relinker` dependency under `core/libs` on that head is inside an `ANYPS5_RELINKER_CLI` condition. - `-DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF` on `main`: generate fails on Windows (4 errors, above) and on Linux (6 errors). With this change it generates on both. - Windows: full build 0 errors (the same 40 warnings as the default build), `libs` builds, and `ctest` passes 2478 of 2479. The one failure is `hardware_oracle`, which fails here because of the LLVM `ld.lld` on PATH. `patched_libraries` reports `368 patched libraries loaded, 0 failed`. - Linux: full build 0 errors, `ctest` passes 2362 of 2366. The 4 failures are the AGC tests that fail without a Vulkan device on `main` too (#11638). - `tools/check_test_registration.py`: `0 built and not run` on Windows (1439 executables) and Linux (1435). - Default build (option ON): - The generated `CTestTestfile.cmake` files are identical to `main` on Windows and Linux. Paths were normalised, and the only difference is backtrace line numbers. - Windows: `ctest -R "^(exec_arguments|loadexec_arguments|guest_timed_join_import_libkernel_sys|guest_timed_join_import_libkernel_web)$|patched_libraries"` passes 5 of 5 (`368 patched libraries loaded, 0 failed`). `check_test_registration.py` reports `1469 test executable(s), 0 built and not run as recorded, none new`. - On `main` the same build passes 2667 of 2668 in full `ctest`. The exception is one intermittent `agc_driver_pm4_rewind_trace` failure, which passes 5 of 5 alone and is unrelated. - There is no new ctest. The failure happens at CMake generate time, and a test that configures the tree takes about 3 minutes here, past the 30 s limit. The before and after configure output above is the evidence. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py --branch fix/relinker-cli-off-test-registrations` reports no conflicting lines, but it couldn't compare 86 PRs that conflict with `main`. Of those, I checked the ones that touch these lines: - #11051 changes the `loadexecLibraries` line directly below the guarded `if`, so it is an adjacent-line conflict for whichever merges second. - #6713, #9793 and #10861 add `$<TARGET_FILE:relinker>` tests inside `core/relinker`, after its existing `return()`, so they are unaffected. - #11366 forces the option OFF only together with `ANYPS5_RELINKER_ONLY`, which skips `core/libs`. - The `libSceAgcDriver` edit only removes the Linux `agc_driver_guest_memory_lifetime_converted` registration when the option is OFF. The default registration is unchanged, and Windows doesn't register that test, so I ran no GPU validation runs. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes, some AI assistance was used
MarcZX10 commented 2026-10-27 18:44:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T18:44:26Z.

Review: APPROVED


Reviewed exact head b10f3d89150919c0ff730ebfc07959773d0d4929. Moving the option declaration to the root makes it available to core/libs; the relinker-dependent test registrations/dependencies are gated, while the default-ON path remains unchanged by inspection.\n\nValidation here: a fresh Linux CMake configure with BUILD_TESTING=ON and ANYPS5_RELINKER_CLI=OFF completed and generated successfully. ctest -N found none of the six relinker CLI tests that must be omitted in this mode; git diff --check and current-base conventions passed. Hosted Linux/Windows builds are still pending; I did not claim they passed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672528895 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12068#pullrequestreview-5672528895). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T18:44:26Z. **Review:** APPROVED --- Reviewed exact head `b10f3d89150919c0ff730ebfc07959773d0d4929`. Moving the option declaration to the root makes it available to `core/libs`; the relinker-dependent test registrations/dependencies are gated, while the default-ON path remains unchanged by inspection.\n\nValidation here: a fresh Linux CMake configure with `BUILD_TESTING=ON` and `ANYPS5_RELINKER_CLI=OFF` completed and generated successfully. `ctest -N` found none of the six relinker CLI tests that must be omitted in this mode; `git diff --check` and current-base conventions passed. Hosted Linux/Windows builds are still pending; I did not claim they passed.
MarcZX10 commented 2026-10-27 20:43:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T20:43:25Z.

Review: DISMISSED


The option declaration and conditional registrations look correct, and the reported OFF/default configurations cover the relevant behavior. I independently confirmed this head merges cleanly with current main. The overlap bot flags open #11051, however, and a pairwise merge-tree of the exact current heads conflicts in core/libs/prx/libSceSystemService/CMakeLists.txt. Please coordinate which one lands first and declare the required Depends on/order, or rebase after the other lands, so the default test registration is preserved. No independent defect found in this PR's CMake logic.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5674050193 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12068#pullrequestreview-5674050193). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T20:43:25Z. **Review:** DISMISSED --- The option declaration and conditional registrations look correct, and the reported OFF/default configurations cover the relevant behavior. I independently confirmed this head merges cleanly with current main. The overlap bot flags open #11051, however, and a pairwise merge-tree of the exact current heads conflicts in core/libs/prx/libSceSystemService/CMakeLists.txt. Please coordinate which one lands first and declare the required Depends on/order, or rebase after the other lands, so the default test registration is preserved. No independent defect found in this PR's CMake logic.
THEMANnt commented 2026-10-28 10:45:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T10:45:38Z.

Review: COMMENTED


Reviewed b10f3d89150919c0ff730ebfc07959773d0d4929 — comment; merge validation remains incomplete. CLI-dependent core/libs tests and fixture dependencies are guarded when ANYPS5_RELINKER_CLI is OFF, with the option declared before library configuration.

Evaluated every changed CMake guard for Windows/Linux with CLI ON/OFF, using the submitted blocks and recording target/test operations. Candidate OFF branches contain no relinker references; baseline blocks retain the references, and candidate ON paths remain enabled where applicable. This is CMake control-flow validation, not a full system-library build or a native execution of those guest tests. Hosted Build succeeded on this head, but the publication-time refresh now reports a conflict with main. Please resolve it and rerun the affected configuration checks before final approval; the conflict alone is not a demonstrated code defect.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681381564 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12068#pullrequestreview-5681381564). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T10:45:38Z. **Review:** COMMENTED --- Reviewed `b10f3d89150919c0ff730ebfc07959773d0d4929` — comment; merge validation remains incomplete. CLI-dependent core/libs tests and fixture dependencies are guarded when ANYPS5_RELINKER_CLI is OFF, with the option declared before library configuration. Evaluated every changed CMake guard for Windows/Linux with CLI ON/OFF, using the submitted blocks and recording target/test operations. Candidate OFF branches contain no relinker references; baseline blocks retain the references, and candidate ON paths remain enabled where applicable. This is CMake control-flow validation, not a full system-library build or a native execution of those guest tests. Hosted Build succeeded on this head, but the publication-time refresh now reports a conflict with main. Please resolve it and rerun the affected configuration checks before final approval; the conflict alone is not a demonstrated code defect.
THEMANnt commented 2026-10-28 17:06:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T17:06:42Z.

Review: COMMENTED


Re-reviewed c5a69e8e46f38becbf59a58662db02971fb6a980 — approve. Moving the CLI option before library configuration and guarding CLI-dependent registrations fixes the missing-target generation failure when ANYPS5_RELINKER_CLI=OFF.

Actual Windows/GCC 15.3 Release configurations: head ON and OFF both generate successfully; the head OFF graph contains no relinker target or CLI-dependent library tests. Head ON retains the same registered-test catalogue as baseline ON. Baseline OFF reproduces the generator errors for $<TARGET_FILE:relinker> in the three affected library registrations. The standalone timed-join executable builds, and its normal/coarse CTests pass 2/2 on head OFF and 2/2 on baseline ON, confirming the unrelated tests remain available.

The Linux-only guards were source-reviewed, not executed on Linux. No full library/product suite, graphics workload or title run is claimed. No remaining defect was found in the tested configuration scope.

Publication-time checks: Build: queued. Please complete these checks before final approval; this status alone is not a demonstrated implementation defect.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686648619 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12068#pullrequestreview-5686648619). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T17:06:42Z. **Review:** COMMENTED --- Re-reviewed `c5a69e8e46f38becbf59a58662db02971fb6a980` — approve. Moving the CLI option before library configuration and guarding CLI-dependent registrations fixes the missing-target generation failure when `ANYPS5_RELINKER_CLI=OFF`. Actual Windows/GCC 15.3 Release configurations: head ON and OFF both generate successfully; the head OFF graph contains no relinker target or CLI-dependent library tests. Head ON retains the same registered-test catalogue as baseline ON. Baseline OFF reproduces the generator errors for `$<TARGET_FILE:relinker>` in the three affected library registrations. The standalone timed-join executable builds, and its normal/coarse CTests pass 2/2 on head OFF and 2/2 on baseline ON, confirming the unrelated tests remain available. The Linux-only guards were source-reviewed, not executed on Linux. No full library/product suite, graphics workload or title run is claimed. No remaining defect was found in the tested configuration scope. Publication-time checks: Build: queued. Please complete these checks before final approval; this status alone is not a demonstrated implementation defect.
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!12068
No description provided.