Repository navigation
Conversation
A test whose executable imports a .prx but whose add_test registration lacks the WIN32 ENVIRONMENT_MODIFICATION PATH prepend never reaches main(): the loader resolves lib*.prx imports to the patched copy in libs/ (or fails to find one), shows 0xC0000139 on a modal dialog, and ctest reports a timeout instead of a failure. The prepend is manual boilerplate repeated ~570 times across ~95 CMakeLists.txt files, and Linux/macOS authors cannot see the breakage (rpath covers them). add_test_executable now stages every linked prx runtime artifact next to the test executable via RUNTIME_OUTPUT/$<TARGET_RUNTIME_DLLS> on Windows (CMake >= 3.21; older CMake keeps today's behavior). The executable's own directory outranks PATH in the Windows DLL search order, so a missing prepend stops mattering and hand-running a test exe needs no environment setup. Existing ENVIRONMENT_MODIFICATION prepends stay harmless. Fixes boykopovar#7637
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
The overlap with #7645 appears substantive: both PRs address #7637 by staging linked |
|
Verdict: defect (the change has no effect)
Reproduced on Windows 11 Home 10.0.26300 with WinLibs GCC 15.2.0 r7, CMake 4.3.1 and Ninja. The test project has a
The PR says Windows behaviour "cannot be exercised in this sandbox" and leaves verification to CI. CI still passes because every existing test has the A AI-assisted: yes (Claude Code); results above were run on this machine. |
|
@plokmklo thanks for picking up #7637. Unfortunately the new line doesn't stage anything: I checked it with a small project cross-built for Windows with llvm-mingw (a SHARED dependency with a add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:${target}> $<TARGET_FILE_DIR:${target}>
COMMAND_EXPAND_LISTS)Two things to watch:
A Windows test that passes without the PATH prepend would show the fix works. |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 8187dbafdaf967188067be8bd0dfe01a82894957 against author merge base e90a1d180268a1135ae70748c661a2830ce3f8ec.
Changes requested: the added target property does not stage any runtime dependencies.
CMakeLists.txt:19 — consume TARGET_RUNTIME_DLLS in a real staging command. RUNTIME_OUTPUT is not a CMake runtime-copy property. Setting this custom property to a generator expression does not add a build rule, change the executable directory or copy a DLL. There is no project consumer for this property. Windows tests therefore still lack their linked .prx dependencies despite this patch's stated purpose. Add an appropriate post-build copy/staging operation with correct list/empty-list handling and test both linked and standalone executables.
Validation: CMake 4.3.1 identifies RUNTIME_OUTPUT as an unknown property. Disposable Windows projects used each revision's exact add_test_executable helper and WindowsTestExit wrapper, with a linked .prx emitted to a different directory (paths contain spaces). Both builds succeeded but neither staged the dependency; linked executables exited 0xC0000135. Manually copying only the .prx made both executables exit0. This demonstrates a no-op proposed fix, not a newly introduced missing-DLL regression. Conventions/whitespace passed; this older registration CLI does not support --scripts. No production source was amended; the manual copy is a reviewer fixture control.
|
Thanks @oneandonlydean and @THEMANnt — you're right, RUNTIME_OUTPUT isn't a
real CMake property so nothing was getting staged.
I'll switch this to a POST_BUILD copy with $<TARGET_RUNTIME_DLLS:...> (and
handle the empty-list case), and check we're copying the unpatched build
output rather than the libs/ copy. Will push an update soon.
…On Mon, Oct 19, 2026 at 9:39 PM Dean ***@***.***> wrote:
oneandonlydean left a comment (boykopovar/AnyPS5#8043)
@plokmklo thanks for picking up #7637. Unfortunately the new line doesn't
stage anything: `RUNTIME_OUTPUT` isn't a CMake property (`cmake
--help-property RUNTIME_OUTPUT` says so; the real ones are
`RUNTIME_OUTPUT_DIRECTORY` and `RUNTIME_OUTPUT_NAME`).
`set_target_properties` stores an unknown name as a user property without
complaint, so the `$<TARGET_RUNTIME_DLLS:...>` value is never used.
I checked it with a small project cross-built for Windows with llvm-mingw
(a SHARED dependency with a `.prx` suffix, plus a test executable in the
same shape as `add_test_executable`). With this PR's line, the test
directory holds only the `.exe`. With the copy that CMake's
`TARGET_RUNTIME_DLLS` documentation describes, the `.prx` lands next to it:
```cmake
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:${target}> $<TARGET_FILE_DIR:${target}>
COMMAND_EXPAND_LISTS)
```
Two things to watch:
- A test that links no SHARED target expands that to `copy_if_different
<dir>`, which fails. Use `-E copy -t <dir> ...` (CMake 3.26+), or wrap the
command in `$<$<BOOL:$<TARGET_RUNTIME_DLLS:${target}>>:...>`.
- Please check that the staged file is the unpatched build output that the
PATH prepend points at (the `TARGET_FILE_DIR` of libkernel and the others),
not the patched copy in `libs/` that #7637 says causes 0xC0000139.
A Windows test that passes without the PATH prepend would show the fix
works.
--
Reply to this email directly or view it on GitHub:
#8043 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
What
A test whose executable imports a
.prxbut whoseadd_testregistration lacks the WIN32ENVIRONMENT_MODIFICATIONPATH prepend never reachesmain(): the loader resolveslib*.prximports to the patched copy inlibs/(or fails to find one), shows0xC0000139on a modal dialog, and ctest reports a timeout instead of a readable failure. The prepend is manual boilerplate repeated ~570 times across ~95 CMakeLists.txt files, every new registration must remember it, and Linux/macOS authors cannot see the breakage (rpath covers them).add_test_executablenow stages every linked prx runtime artifact next to the test executable viaRUNTIME_OUTPUT/$<TARGET_RUNTIME_DLLS:...>on Windows (guarded to CMake >= 3.21; older CMake keeps today's behaviour). The executable's own directory outranksPATHin the Windows DLL search order, so a missing prepend stops mattering, the modal-dialog hang disappears, and hand-running a test exe needs no environment setup. ExistingENVIRONMENT_MODIFICATIONprepends stay harmless.Tested
Ubuntu 24.04: full configure + the libkernel/avplayer/relinker test targets build and pass unchanged on Linux (the branch is a no-op there by construction). The Windows behaviour is exactly the mechanism proposed in #7637 and cannot be exercised in this sandbox; CI's Windows matrix is the verification.
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)