fix(build): give Windows test executables an asInvoker manifest #17778

Merged
AlfaRojo merged 5 commits from upstream-pr/17778 into main 2026-11-12 05:07:49 +00:00
AlfaRojo commented 2026-11-09 15:37:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlfaRojo on 2026-11-09T15:37:10Z.


What

On a Windows host with UAC, an executable without an application manifest whose file name contains install, setup or update is treated as an installer and needs elevation, so ctest reports agc_draw_setup, guest_update_env, guest_gameupdate, guest_hmd_setup_dialog and guest_vr_setup_dialog as ***Not Run (#16293). The WinLibs toolchain ships no default-manifest.o, so no test executable had a manifest.

add_test_executable now links a resource with an asInvoker manifest (cmake/WindowsManifest.manifest, through cmake/WindowsManifest.rc.in) into every test executable on MinGW, so the installer heuristic no longer applies. A new test, test_executable_manifests, lists the test executables at generate time and fails with each executable that lacks the asInvoker manifest, so a future add_executable that bypasses the helper is caught; an executable that was not built is skipped. The change is inside if(MINGW); Linux and macOS are untouched.

Overlap: tools/pr_overlap.py reports #17730 on CMakeLists.txt (a new add_subdirectory, different lines); the other hits are PRs that conflict with main and could not be compared.

Tested

Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, branch merged with main ffe575754a.

  • Full tree configured and the five executables from #16293 rebuilt: each embeds requestedExecutionLevel level="asInvoker", and ctest --test-dir build -R '^(agc_draw_setup|guest_hmd_setup_dialog|guest_vr_setup_dialog|guest_update_env|guest_gameupdate)$' passes 5 of 5 as a normal user, where main reports them ***Not Run.
  • test_executable_manifests against the executables of the previous full build, linked before this change, lists every one of them by name with no asInvoker manifest, so the check detects a missing manifest.
  • Relinker-only tree (-DANYPS5_RELINKER_ONLY=ON) rebuilt from scratch: test_executable_manifests is registered (it was not before the last commit, as that configuration returns early) and passes over its 57 executables, each with the manifest. Two other tests fail there on this host for reasons outside this change: select_tests_FixtureBuildTests builds its own beta/setup_tests.exe fixture with a plain add_executable, so the same installer heuristic blocks it (follow-up PR), and vulkan_validation_gate_commands needs the symlink privilege.

Linux and macOS not run; nothing outside if(MINGW) changes.

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: Fixes #16293
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5226535876 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17778). Originally posted by [AlfaRojo](https://github.com/AlfaRojo) on 2026-11-09T15:37:10Z. --- ### What On a Windows host with UAC, an executable without an application manifest whose file name contains `install`, `setup` or `update` is treated as an installer and needs elevation, so `ctest` reports `agc_draw_setup`, `guest_update_env`, `guest_gameupdate`, `guest_hmd_setup_dialog` and `guest_vr_setup_dialog` as `***Not Run` (#16293). The WinLibs toolchain ships no `default-manifest.o`, so no test executable had a manifest. `add_test_executable` now links a resource with an `asInvoker` manifest (`cmake/WindowsManifest.manifest`, through `cmake/WindowsManifest.rc.in`) into every test executable on MinGW, so the installer heuristic no longer applies. A new test, `test_executable_manifests`, lists the test executables at generate time and fails with each executable that lacks the `asInvoker` manifest, so a future `add_executable` that bypasses the helper is caught; an executable that was not built is skipped. The change is inside `if(MINGW)`; Linux and macOS are untouched. Overlap: `tools/pr_overlap.py` reports #17730 on `CMakeLists.txt` (a new `add_subdirectory`, different lines); the other hits are PRs that conflict with `main` and could not be compared. ### Tested Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, branch merged with `main` `ffe575754a`. - Full tree configured and the five executables from #16293 rebuilt: each embeds `requestedExecutionLevel level="asInvoker"`, and `ctest --test-dir build -R '^(agc_draw_setup|guest_hmd_setup_dialog|guest_vr_setup_dialog|guest_update_env|guest_gameupdate)$'` passes 5 of 5 as a normal user, where `main` reports them `***Not Run`. - `test_executable_manifests` against the executables of the previous full build, linked before this change, lists every one of them by name with `no asInvoker manifest`, so the check detects a missing manifest. - Relinker-only tree (`-DANYPS5_RELINKER_ONLY=ON`) rebuilt from scratch: `test_executable_manifests` is registered (it was not before the last commit, as that configuration returns early) and passes over its 57 executables, each with the manifest. Two other tests fail there on this host for reasons outside this change: `select_tests_FixtureBuildTests` builds its own `beta/setup_tests.exe` fixture with a plain `add_executable`, so the same installer heuristic blocks it (follow-up PR), and `vulkan_validation_gate_commands` needs the symlink privilege. Linux and macOS not run; nothing outside `if(MINGW)` changes. ### 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: Fixes #16293 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!17778
No description provided.