build: Windows test executables named with setup or update need elevation, so ctest never runs them #16293

Closed
opened 2026-11-06 05:59:31 +00:00 by AlfaRojo · 0 comments
AlfaRojo commented 2026-11-06 05:59:31 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlfaRojo on 2026-11-06T05:59:31Z.


What happens

On a Windows host with UAC enabled, five test executables never run: ctest reports them as BAD_COMMAND (***Not Run), and running one from a shell fails with "requires elevation" (bash prints Permission denied). Launching it from a console that honours the elevation prompt starts it elevated, and the elevated process has no PATH to the libraries, so it stops with libSceAgc.prx was not found and the Program Compatibility Assistant then asks whether the "program installed correctly".

1/6 Test  #789: guest_update_env ...........................***Not Run   0.00 sec
3/6 Test #2773: guest_gameupdate ...........................***Not Run   0.00 sec
4/6 Test #2778: guest_hmd_setup_dialog .....................***Not Run   0.00 sec
6/6 Test #3662: guest_vr_setup_dialog ......................***Not Run   0.00 sec
   5/1387 Test #1127: agc_draw_setup ...........................***Not Run   0.00 sec

Cause

Windows installer detection: an executable without an application manifest whose file name contains install, setup or update is treated as an installer and needs elevation. None of the test executables embeds a manifest (objdump -h shows no .rsrc; the WinLibs toolchain ships no default-manifest.o), and these five file names match:

  • agc_draw_setup_tests.exe (test agc_draw_setup, since 4ad61bf3ce)
  • guest_update_env_tests.exe
  • guest_gameupdate_tests.exe
  • guest_hmd_setup_dialog_tests.exe
  • guest_vr_setup_dialog_tests.exe

A copy of agc_draw_setup_tests.exe renamed to agc_draw_renamed_tests.exe runs as a normal user and passes with build/core/libs/libs/unpatched on PATH. Tests whose name contains the words but whose executable does not (guest_standard_streams_update_stdout, guest_ult_thread_lifecycle_cleanup-setup) run fine.

The hosted Windows check runs elevated on windows-latest, so CI never sees it; a developer running ctest on their own machine does.

Title, test or build step

ctest --test-dir build -R '^(agc_draw_setup|guest_hmd_setup_dialog|guest_vr_setup_dialog|guest_update_env|guest_gameupdate)$'

AnyPS5 commit

main 6a37dfbed9

System

Windows 11 Pro 10.0.26200, UAC on, standard (non-elevated) console; WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, BUILD_TESTING=ON. Found while running ctest -R '^agc_' on an RTX 4070 and a Radeon 1002:13c0: these were the only failures besides #15564, #15566 and #9507.

Fix

Embed a requestedExecutionLevel level="asInvoker" manifest in every executable from add_test_executable (a resource compiled by windres), and a ctest that checks every executable in the test output directory carries one, so a future name does not regress silently. Branch ready: https://github.com/AlfaRojo/AnyPS5/commits/fix/windows-test-exe-manifest; I will open it as a PR when my open-PR slot frees (#16274 is in it).

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6237629482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/16293). Originally posted by [AlfaRojo](https://github.com/AlfaRojo) on 2026-11-06T05:59:31Z. --- ### What happens On a Windows host with UAC enabled, five test executables never run: ctest reports them as `BAD_COMMAND` (`***Not Run`), and running one from a shell fails with "requires elevation" (bash prints `Permission denied`). Launching it from a console that honours the elevation prompt starts it elevated, and the elevated process has no `PATH` to the libraries, so it stops with `libSceAgc.prx was not found` and the Program Compatibility Assistant then asks whether the "program installed correctly". ``` 1/6 Test #789: guest_update_env ...........................***Not Run 0.00 sec 3/6 Test #2773: guest_gameupdate ...........................***Not Run 0.00 sec 4/6 Test #2778: guest_hmd_setup_dialog .....................***Not Run 0.00 sec 6/6 Test #3662: guest_vr_setup_dialog ......................***Not Run 0.00 sec 5/1387 Test #1127: agc_draw_setup ...........................***Not Run 0.00 sec ``` ### Cause Windows installer detection: an executable without an application manifest whose file name contains `install`, `setup` or `update` is treated as an installer and needs elevation. None of the test executables embeds a manifest (`objdump -h` shows no `.rsrc`; the WinLibs toolchain ships no `default-manifest.o`), and these five file names match: - `agc_draw_setup_tests.exe` (test `agc_draw_setup`, since 4ad61bf3ce) - `guest_update_env_tests.exe` - `guest_gameupdate_tests.exe` - `guest_hmd_setup_dialog_tests.exe` - `guest_vr_setup_dialog_tests.exe` A copy of `agc_draw_setup_tests.exe` renamed to `agc_draw_renamed_tests.exe` runs as a normal user and passes with `build/core/libs/libs/unpatched` on `PATH`. Tests whose *name* contains the words but whose executable does not (`guest_standard_streams_update_stdout`, `guest_ult_thread_lifecycle_cleanup-setup`) run fine. The hosted Windows check runs elevated on `windows-latest`, so CI never sees it; a developer running `ctest` on their own machine does. ### Title, test or build step `ctest --test-dir build -R '^(agc_draw_setup|guest_hmd_setup_dialog|guest_vr_setup_dialog|guest_update_env|guest_gameupdate)$'` ### AnyPS5 commit `main` 6a37dfbed9 ### System Windows 11 Pro 10.0.26200, UAC on, standard (non-elevated) console; WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, `BUILD_TESTING=ON`. Found while running `ctest -R '^agc_'` on an RTX 4070 and a Radeon `1002:13c0`: these were the only failures besides #15564, #15566 and #9507. ### Fix Embed a `requestedExecutionLevel level="asInvoker"` manifest in every executable from `add_test_executable` (a resource compiled by `windres`), and a ctest that checks every executable in the test output directory carries one, so a future name does not regress silently. Branch ready: https://github.com/AlfaRojo/AnyPS5/commits/fix/windows-test-exe-manifest; I will open it as a PR when my open-PR slot frees (#16274 is in it). AI-assisted: yes.
Sign in to join this conversation.
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#16293
No description provided.