Repository navigation
fix(build): link SDL2 tests against SDL2 under system deps - #11345
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The two link-line additions are correctly ordered: under system dependencies SDL2-static is the interface wrapper for SDL2::SDL2, and in the bundled build the SDL archive follows the libraries that already define those symbols. The reported same-machine before/after runs cover both the system-deps link failure and the default build, including the relevant validation-layer checks. I could not reproduce those configurations locally because this environment has no system SDL2 package. One repository requirement remains: tools/check_main_sync.py --base upstream/main --head refs/remotes/upstream/pr/11345 reports the branch 1 ahead and 20 behind current main (14c99b52ac), although the merge preview is clean. Please refresh onto current main and rerun the two focused test sets there; I will re-review that exact head.
4a5c5e3 to
843d48c
Compare
|
@MarcZX10 Rebased onto
Selected tests on this PR: 472 pass, 0 failed, 1 skipped ( |
MarcZX10
left a comment
There was a problem hiding this comment.
The current-main sync finding is resolved: head 843d48c479dfbb318f0fe77afab8fcdba9bb96bc is exactly one commit ahead of 14c99b52ace303eef1667764670d1d1540140b3d, and the merge preview is clean. Thanks for rerunning the focused matrix on that parent.
One integration detail remains in the stated order with #11119. I inspected #11119's current patch: it switches libSceVideoOut and the mouse, pad-SDL, HDR-probe and telemetry test targets to ${videoOutSdl}, but does not change the video_out_flip_tests link line. That target is the second line changed here and will still name SDL2-static if #11119 lands unchanged, despite also linking libSceAgcDriver. This leaves the test outside the one-SDL link setup described in #11119. Please coordinate the flip-test line with that PR's author and update either branch/body so the eventual combined CMake configuration uses ${videoOutSdl} for this test on Apple and SDL2-static elsewhere. The focused system-deps link fix and current-main evidence otherwise look good.
|
@MarcZX10 Coordinated on #11119: #11119 (comment). The proposed order is this PR first, then #11119 switches |
|
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.
|
|
Rebased onto
PR body updated with the post-rebase verification. |
MarcZX10
left a comment
There was a problem hiding this comment.
The current-main refresh is confirmed: head 843d48c479dfbb318f0fe77afab8fcdba9bb96bc is one commit ahead of 14c99b52ace303eef1667764670d1d1540140b3d, with a clean merge preview. I rechecked both link additions and the reported default/system-deps focused builds and tests. The SDL target ordering is correct in both configurations. The coordination on #11119 now establishes that its follow-up will switch video_out_flip_tests to ${videoOutSdl} after this PR lands, so the integration concern is addressed. The local environment lacks system SDL2, so I could not independently repeat that configuration here. No remaining actionable findings.
|
Follow-up to my approval: upstream |
|
Current-main update: |
|
@MarcZX10 Both files are unchanged on current Rebased locally onto
Selected tests on this head: 473 pass, 0 failed, 1 skipped ( |
The audio resampling and VideoOut flip tests call SDL functions themselves. With ANYPS5_USE_SYSTEM_DEPS=ON the shared system SDL2 is not a transitive dependency of the .prx libraries, so both links fail with an undefined reference and a DSO missing from the command line. SDL2-static resolves SDL2::SDL2 in that mode and the bundled SDL2 in the default build.
843d48c to
87d6f45
Compare
|
@MarcZX10 Pushed the refresh: head
Selected tests on this head: 482 pass, 0 failed, 1 skipped ( |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 87d6f4595b14 against 84ffc1ae2d96. No actionable findings.
The test-link additions expose SDL functions called directly by the audio-resampling and video-flip tests. In system-dependency mode, SDL2-static resolves to the SDL2::SDL2 interface; with bundled dependencies it remains the bundled static SDL target. The #11119 integration remains sequenced as stated: its follow-up must switch video_out_flip_tests to ${videoOutSdl} if that PR lands after this one.
Validation: The exact-head Windows Release video_out_flip_tests target built successfully; CTest passed 16/16, 0 skipped, 0 failed. Local conventions and diff checks passed. The PR reports Linux default and system-dependency focused tests passing 17/17, but I did not reproduce them. The exact-head Actions run required approval and had no jobs.
The local system-dependency configure could not find SDL2Config.cmake; Windows has no WSL, so I did not independently run the Linux system-dependency tests. audio_out_resampling_tests is registered only on Linux.
XairRrR
left a comment
There was a problem hiding this comment.
Reviewed — approved
The two link-line additions merge cleanly into current main, leave the default (bundled SDL) build unchanged at the symbol level, and the focused tests pass; I could not configure ANYPS5_USE_SYSTEM_DEPS=ON here, so the system-deps fix itself rests on the mechanism and the author's runs.
What I ran
- PR head:
87d6f4595b14f4ef9ff817ca5d087a207d5b14db main:5454cd2e455994d992aca39335ce60507eeda1eb- Tree under test:
mainwith the PR merged (--no-ff), clean merge. Release, GCC 16.2.1, Ninja,BUILD_TESTING=ON, bundled dependencies. - Machine: Arch Linux 7.2.11-zen, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08).
git fetch origin main pull/11345/head:refs/review/11345
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/11345
git diff --check origin/main...refs/review/11345
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target audio_out_resampling_tests video_out_flip_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
VK_LOADER_DEBUG=error,warn,layer \
ctest --test-dir build -R '^(audio_out_resampling|video_out_flip_.*)$' -V -j4 --output-on-failure
nm --defined-only build/tests/audio_out_resampling_tests | grep ' [TtDdBbRr] SDL_'
nm --defined-only build/tests/video_out_flip_tests | grep ' [TtDdBbRr] SDL_'
# same build, ctest and nm steps repeated on origin/main
cmake -S . -B build-sysdeps -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_USE_SYSTEM_DEPS=ONResults
| Check | Result |
|---|---|
Merge into main |
Clean |
git diff --check |
Clean |
check_conventions.py --base origin/main |
All conventions checks passed. |
Build audio_out_resampling_tests, video_out_flip_tests (merged) |
OK |
| Focused ctest, merged | 18/18 passed; 16 of them skipped (see below) |
Focused ctest, main |
18/18 passed; same 16 skipped |
VUID- lines, merged / main |
0 / 0 |
was not found but was requested by env var VK_INSTANCE_LAYERS, merged / main |
0 / 0 |
SDL symbols defined in audio_out_resampling_tests, merged vs main |
Identical: only the 9 functions the test source replaces |
SDL symbols defined in video_out_flip_tests, merged vs main |
Identical: none |
Binary size, merged vs main |
Identical (18016 and 162184 bytes) |
ANYPS5_USE_SYSTEM_DEPS=ON configure |
Not possible here: the host has sdl2-compat, which cmake/SystemDeps.cmake rejects on purpose |
Focused ctest (merged tree)
1/18 Test #1859: audio_out_resampling ................. Passed 0.00 sec
2/18 Test #2344: video_out_flip_decode ................ Passed 0.00 sec
3/18 Test #2340: video_out_flip_labels ................***Skipped 0.03 sec
...
18/18 Test #2356: video_out_flip_cpuflip_in_order ......***Skipped 0.02 sec
100% tests passed out of 18
2340: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
SDL symbols defined in audio_out_resampling_tests (same on main and merged)
SDL_ClearQueuedAudio
SDL_CloseAudioDevice
SDL_GetQueuedAudioSize
SDL_InitSubSystem
SDL_OpenAudioDevice
SDL_PauseAudioDevice
SDL_QueueAudio
SDL_QueueAudio.cold
SDL_WasInit
System-deps configure
CMake Error at cmake/SystemDeps.cmake:33 (message):
ANYPS5_USE_SYSTEM_DEPS: the system SDL2 does not define
-- Configuring incomplete, errors occurred!
The 16 display tests skip under the default offscreen SDL video driver on both trees, as the description says. The two tests that ran do not create a Vulkan instance, and neither log has any loader output. So the validation-layer comparison is empty on both sides and adds no evidence. A link-line-only change does not need it.
Negative control
None applies. The PR changes no test sources, only two link lines. The failure it fixes is a link error that only happens under ANYPS5_USE_SYSTEM_DEPS=ON, which I could not configure on this host. On the default build, the useful control is the comparison with main: nm shows the same SDL symbols defined in both binaries and the files are the same size. That matches the description: the static archive gives no objects, because libSceAudioOut, and libSceVideoOut/libSceAgcDriver, already export the SDL symbols, and they come earlier on the link line.
Findings
Blocking
None.
Non-blocking
None. Notes from reading the code:
- The mechanism is sound. Under system deps,
SDL2-staticis anINTERFACEtarget overSDL2::SDL2(cmake/SystemDeps.cmake#L18-L19). The prx libraries link itPRIVATE, so an executable that calls SDL itself must name it.AudioOutResampling.cppcallsSDL_NewAudioStreamand the other stream functions, which it does not define, andFlip.cppcallsSDL_GetCurrentDisplayMode. That is exactly the "DSO missing from command line" case. - I checked the other tests in the two touched files that mention
SDL_functions (AudioOutPortLocks,AudioOutBufferSize,AudioOutDefaultOpen,AudioOutVibrationDevice,AudioOutInitialization). They only define replacement SDL functions; they do not call real ones. So the PR's scope looks complete for these two files. - I agree with the earlier reviews about #11119: if #11119 lands second, it has to switch
core/libs/prx/libSceVideoOut/CMakeLists.txt:52to${videoOutSdl}. The description and the #11119 thread already cover this.
Not verified
- The system-deps build (
ANYPS5_USE_SYSTEM_DEPS=ON), which is the configuration the PR fixes. The only system SDL2 here is sdl2-compat, whichSystemDeps.cmakerejects. Like the two earlier approvals, this relies on the author's Gentoo runs and on the mechanism above. - The 16
video_out_flip_*display tests in a real display session. They skip underoffscreenhere, and I did not run a windowed session. - Windows and macOS builds.
✅ NVIDIA GPU test: passedPR head
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (5 IDs in 360 tests)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
Link
audio_out_resampling_testsandvideo_out_flip_testsagainstSDL2-static. Both tests call SDL themselves (SDL_NewAudioStreamand the other conversion calls,SDL_GetCurrentDisplayMode). WithANYPS5_USE_SYSTEM_DEPS=ONthe prx libraries link the shared system SDL2 privately, so it is not on the tests' link line and both links fail with an undefined reference andDSO missing from command line. Under that flagSDL2-staticis the interface target overSDL2::SDL2, so each test and the libraries share the one system SDL2.The default build is unchanged in effect. The libraries listed before
SDL2-staticalready define the SDL symbols, so the linker takes no object from the static archive:nmon the default-build binaries showsvideo_out_flip_testsdefining no SDL symbol andaudio_out_resampling_testsdefining only the SDL functions its source replaces, as onmain.#11049 and #11119 (open) make the macOS libraries take SDL from
libSceAgcDriverand change other test link lines in these two files;pr_overlap.pyfinds no shared lines.audio_out_resampling_testsis built only on Linux, so #11049 does not reach it.video_out_flip_testsis the one overlap: under #11119 on macOS it would carry a second SDL copy unless it uses${videoOutSdl}. Proposed order (asked on #11119): this PR first, since it fixes a Linux build and merges cleanly without the macOS series; #11119 then switches this line along with its other test targets, so the combined configuration iswith
libSceAgcDriver's SDL on Apple andSDL2-staticelsewhere. If #11119 is merged first, I will rebase this PR onto it and use${videoOutSdl}on this line.Tested
Gentoo Linux x86-64, Ryzen 7 5800X, GCC 16.2.1, CMake 4.3.4, Ninja, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON, system SDL2 2.32.8.mainis this PR's parentb0f1183ca1. The focused tests arectest -R '^(audio_out_resampling|video_out_flip_.*)$' -V, run onmainand on this PR on the same machine and GPU: AMD Radeon RX 6700 XT (RADV NAVI22, Mesa 26.1.8), withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, inside a headless sway session (SDL_VIDEODRIVER=wayland; under the defaultoffscreendriver every flip display test skips).VK_LOADER_DEBUG=layershows the layer inserted at instance and device level.ANYPS5_USE_SYSTEM_DEPS=ON,main:audio_out_resampling_testsfails to link (undefined reference to symbol 'SDL_NewAudioStream',libSDL2-2.0.so.0: error adding symbols: DSO missing from command line). This PR: both targets build; the focused tests pass 17/17 with no skips.mainand this PR: the focused tests pass 17/17 with no skips in both.was not found but was requested by env var VK_INSTANCE_LAYERSor contains aVUID-.tools/select_tests.pyselects for the two files: 482 pass, 0 failed, 1 skipped (guest_video_out_high_frame_rate, which needs a high refresh rate output).python3 tools/check_conventions.py --base upstream/mainpasses.pr_overlap.pycould not compare feat(input): add native SDL input configuration with ImGui #674, feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, Macos port #7201, fix(libSceVideoOut): answer the cursor, flip status and pending-flip calls as measured on a PS5 #8927 and feat(libSceVideoOut): add the PS4 device capability and ModeSetAny exports #9880, which conflict withmain; their diffs don't touch theaudio_out_resampling_testsorvideo_out_flip_testslines.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)🤖 Generated with Claude Code
https://claude.ai/code/session_01X3Bs12ksrt7qyzTVeHZWy5