fix(cmake): isolate bundled subprojects from inherited link libraries #12994
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12994"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Triple-P on 2026-10-29T19:24:29Z.
What
Prevent directory-level
LINK_LIBRARIES, includingwindows_seh_personalities, from leaking into bundled subprojects. The inherited SEH object-library dependency makes nghttp2's CMake install/export generation fail because that dependency is outside nghttp2's export set.Add
add_bundled_subdirectory, which saves the complete effective directory link list, clears it while adding the bundled subproject, and restores it afterwards. Use it for nghttp2, mbedtls and glslang undercore/libs; AnyPS5 targets retain their injected libraries. No guest API, shader semantics or third-party sources change. The regression tooltools/check_link_scope.pyreproduces the export failure without the helper and checks successful generation, restored links, generated build data, nested mounts, paths with spaces, empty link lists andEXCLUDE_FROM_ALLwith the helper.Alternative to #12731, not an additional independent nghttp2 fix. That PR addresses the same failure by removing the SEH dependency from nghttp2's target properties after creation. This draft instead prevents inheritance at all three bundled boundaries and adds regression coverage. There has been no agreement with that author about which approach should merge. Please keep this draft pending that decision; merging both as-is would leave redundant nghttp2 handling. No dependency on #12731 is declared because this is an independent alternative, not a stack on top of it.
Related: #11470 changes link dependencies elsewhere in
libSceHttp2/CMakeLists.txt; its current CMake hunks do not replace the bundled mount changed here. Sharing a file does not by itself imply a required dependency. The current overlap report and its incomplete comparisons are recorded below; no blanket conflict-free claim is intended.The author approved candidate
fdbf945a6ead80f0bed8e126f1ddd03d16d98f70. This publication commit reapplies exactly those changes ontomainata6ec79e895fa3dd0fe88d1a504506175c7b9d0b1, fetched when preparing the branch, with a single Conventional Commit attributed to Triple-P. The approved checkout and its history are preserved locally. The helper and regression-tool blobs are identical to the approved candidate; the four existing-file edits are unchanged. During the overlap check,mainadvanced to58b2753d74df72635a68bef79c977539332caf2e; a finalgit merge-tree --write-treecheck against that tip completed without conflicts.Tested
Windows, MSYS2 UCRT64 / Ninja. No game or homebrew was run. This is a build-system change, with no performance claim.
On publication commit
b43e78c99de2f85b44ff625d10bb4ff69c1ba9dc, based on themaincommit above:Earlier validation on the approved change before updating its base:
CMAKE_SKIP_INSTALL_RULES. Generated data showed SYSV-SEH enabled, DWARF disabled, SEH injection retained for the AnyPS5 core targets and absent from the bundled targets. This was configure validation, not a full build. CMake reported long object-path warnings in that deep local checkout.74acfad65b3f0fd4eab653f3a3989d298fba1157versus candidate016925c1410e325a9fdbc529a7526ccb63944ad7, one run per side on NVIDIA GeForce RTX 4090, driver 617.14, Microsoft Windows NT 10.0.26300.0. Each side passed 12 tests with no failures or skips. Eleven tests per side logged both the GPU and loaded Khronos validation layer;agc_driver_queued_raw_shaderis CPU supporting coverage and is not counted as GPU execution evidence.ctest -V,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LAYER_PATH=C:/msys64/ucrt64/binand the same selected GPU. Complete verbose logs contained noVUID-,SYNC-HAZARD, standard validation errors/warnings or missing-requested-layer messages on either side.CMAKE_SKIP_INSTALL_RULES=ONso the known-broken baseline could be built. That shared workaround limits the GPU comparison; the separate configure without suppression establishes the configure fix. The later approved candidate only removes two unused Python-test lines relative to this GPU-tested candidate.Focused CTest selection used for the earlier GPU comparison
Draft validation remaining: the full configure/build and focused GPU comparison have not been repeated after updating to the newer
main; no complete regression-suite pass or Linux/macOS validation is claimed. Full project CI requires a maintainer-triggered workflow under the contribution rules. Resolve the alternative-solution discussion with #12731 before marking ready for review.Overlap check:
python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch fix/bundled-link-scopecompleted successfully against maina6ec79e895fa3dd0fe88d1a504506175c7b9d0b1, scanning 1,480 open PRs. It reported no confirmed line/export/new-file conflicts, but 56 comparisons were incomplete because those PRs already conflict with main in shared files. This does not detect the semantic duplication with #12731.Complete overlap findings (56 incomplete comparisons)
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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtChecklist
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)The first checklist item remains open deliberately: the branch is based on the current
mainfetched for publication, but #12731 addresses the same failure and the choice of approach is unresolved. The template's fully checked checklist is a readiness requirement that this draft does not yet claim to satisfy. No exports, stubs or third-party sources were added; the corresponding checked items are not applicable to the scope of this change.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T21:52:00Z.
Review: COMMENTED
Reviewed — no blocking findings
A formal approval is not justified because the regression tool and rebased full configure were not completely verified on this head.
What I ran
Reviewed head
b43e78c99de2f85b44ff625d10bb4ff69c1ba9dc. Read the prepared description, commit summary, diff, and manifest; inspected the helper and changed CMake call sites, plus selected sections of the regression tool. No commands or tests were run in this review.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
Not verified
The complete
tools/check_link_scope.pysource was not read; therefore its full behavior and error handling are not verified. No build, configure, regression script, or test suite was run. The author-reported Windows checks were not independently confirmed on this head. All six changed paths appear in the manifest as included; no excluded changed paths were listed. Files read:cmake/BundledSubdirectory.cmake,core/libs/CMakeLists.txt,core/libs/prx/libSceAgcDriver/CMakeLists.txt,core/libs/prx/libSceHttp2/CMakeLists.txt,core/libs/prx/libSceSsl/CMakeLists.txt, and selected portions oftools/check_link_scope.py.To get this to a good state
Nothing is required. Optional: resolve the stated approach overlap and complete review of the regression tool and rebased configure before requesting a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:14:02Z.
Review: COMMENTED
I ran
python3 tools/check_link_scope.pyfrom a source snapshot ofb43e78c99don Linux with CMake 3.31.6 and Ninja. The check found the glslang, nghttp2, and mbedtls call sites. Its control fixture reproduced the export-set error, and the fixture with the helper generated successfully. It confirmed the bundled targets received an empty inherited link list and the AnyPS5 targets retained their original links across the nested and excluded mounts. This run exercised the CMake fixtures on Linux.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.