fix(agc): exclude tests and tools from the shader cache guard when the source path holds regex characters #1105
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1105"
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 orbz22 on 2026-10-07T12:01:19Z.
What
core/libs/prx/libSceAgcDriver/CMakeLists.txtexcludedtests/andtools/from the shader cache guard sources withREGEX "^${CMAKE_CURRENT_SOURCE_DIR}/(tests|tools)/". The source path is embedded in the regex unescaped, so a checkout under a path with regex metacharacters (hereC:/Local Disk (D)/..., where(D)is a group matchingD) never matches. The test sources stay in the guard list and the build stops atShaderCacheVersion.hpp:The glob is now
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"and the filter matches only^(tests|tools)/.add_shader_recompileralready resolves relative guard sources withBASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}", so the list it receives is unchanged.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), CMake 4.4.4, Ninja 1.13.2.
C:/Local Disk (D)/...: targetShaderCacheVersion.hppfails onmain, builds with this change; notests/ortools/entry left in the guard list.C:/dev/AnyPS5: guard list (171 entries) andSourceVersion(0x596145c397a258c4) are identical before and after the change, and identical to the build underLocal Disk (D).ctestwith-DBUILD_TESTING=ON: 389/389 passed.A full build under a path with spaces still fails at FreeType's
ftver.rc, because MinGWwindrespasses-Ipaths tocc1with backslash-escaped spaces. That is outside this repository and not addressed here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T02:00:07Z.
Review: COMMENTED
Reproduced the bug and verified the fix on Linux, using
cmake -Pso both regexes can be exercised without a full build.The bug is real, and it is exactly what you describe. With a source directory containing a regex metacharacter, as in
Local Disk (D):The
(D)becomes a capture group inside the pattern, so the literal directory never matches and the guard keeps the test and tool sources. Correct root cause: a path was being used as a pattern, so any metacharacter in the checkout location silently changed the meaning.It is also behaviour-preserving where the old form worked, which is the half I wanted to confirm before saying yes — on a path with no metacharacters, both filters leave exactly the same list (only
Execution/src/Pm4.cpp). So this cannot regress a normal checkout.Your resolution claim is correct, and I checked it rather than taking it. In
core/shader/recompiler/CMakeLists.txt:That is an exact inverse of the new
RELATIVEglob, and sinceadd_shader_recompileris called from the agc directory,CMAKE_CURRENT_SOURCE_DIRthere is the agc directory — so the round-trip is identity. Confirmed by building the guard target as well:shader_recompiler_agc_driverconfigures and links on Linux with no error, so the relative list is resolved rather than passed through unresolved.One small note, not a request: the filter is now correct because the glob next to it is
RELATIVE. If a later caller ever feeds absolute paths into the same list,^(tests|tools)/quietly stops excluding anything. They are adjacent lines, so this is more of a comment than a hazard.This is a comment, not an approval — I have no merge rights here.
Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T06:45:34Z.
Checked:
add_shader_recompilerresolves the relative guard sources againstCMAKE_CURRENT_SOURCE_DIR(core/shader/recompiler/CMakeLists.txt:178), so the resulting list is unchanged. Full build and ctest on top of current main: 419/419 passed; CI green. Merging.