Repository navigation
Conversation
CMake names the object of a source outside runtime/ after its absolute path, and Ninja passes object names to lib.exe unquoted through cmd.exe /C. In a checkout whose folder name has `&`, cmd split the gta6rt_xtaskqueue.lib line at the `&` (LNK1181). The four vendored sources now compile through one-line wrappers in runtime/shims/xtaskqueue, so their objects have relative names. tests/test_runtime_sources_in_tree.py fails when a runtime target compiles a source outside runtime/ again. Found by VeTkN in ItsNotRexed#3554. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devnull34
left a comment
There was a problem hiding this comment.
Tested and verified at commit \70a4a6eb7\ on Windows 11 (Build 26300): pass.
- \python -I tests/test_runtime_sources_in_tree.py: 4/4 tests pass (0.032s), verifying all compiled sources resolve under
untime/\ and wrapper targets point to valid vendored files. - \git diff --check: clean, zero whitespace/CRLF issues.
- \python -I tests/test_text_write_line_endings.py: 3/3 passed.
- \python -I tests/test_docs_cli_flags.py: 3/3 passed.
- Diff review: The 4 one-line wrappers in
untime/shims/xtaskqueue/\ cleanly include their respective vendored sources, keeping object paths relative to the build directory and preventing \lib.exe\ LNK1181 command-line splitting under Ninja + \cmd.exe /C\ when checkout paths contain &.
Approve. Clean and well-tested fix.
VeTkN
left a comment
There was a problem hiding this comment.
Tested 70a4a6e merged into main 561b65a on Windows 11 Pro, MSVC 19.51 (VS 2026 Build Tools), RTX 5070 (driver 621.24), building with scripts/build_runtime.ps1 under Windows PowerShell 5.1 in C:\LT\amp&dir.
- main 561b65a in the same folder: configure succeeds, then the build stops at step 18/644 on gta6rt_xtaskqueue.lib with LNK1181 on CMakeFiles\gta6rt_xtaskqueue.dir\C_\LT\amp.
- This PR in the same folder: exit 0, all 644 steps, gta6rt.exe built.
- ctest -j 4 on this PR's build: 246 of 247 pass. The one failure, d3d12_indirect_dispatch_count, also fails on main built in a plain folder (C:\LT\plain-main) on this machine. No test fails on only one side (one run each).
- python -I tests/test_runtime_sources_in_tree.py: 4 tests OK on this PR. With main's runtime/CMakeLists.txt it fails (1 failure, 1 error).
Note: main's build_runtime.ps1 starts with two UTF-8 BOMs, so Windows PowerShell 5.1 doesn't parse param() (#5874 fixes that). I removed the extra BOM in the test copies, the same way for main and this PR. Nothing else was changed.
Not run: a folder name with ^, and the cl.exe-only fallback.
AI-assisted (Claude).
DoubleD17
left a comment
There was a problem hiding this comment.
The new source-location test misses an outside source when it is the second entry in a CMake list variable. In tests/test_runtime_sources_in_tree.py:32–45, the set() matcher keeps only the first value. For example:
set(PROBE_SOURCES probe.cpp ../outside/helper.cpp)
add_executable(scope_probe ${PROBE_SOURCES})At 70a4a6eb77365be1f030922ea3ad6c68c9e4c43d, the verifier therefore checks only probe.cpp. Putting ../outside/helper.cpp first, or listing it directly in add_executable(), makes the verifier report it. This leaves a gap in the source-location test described in the coordination claim. The four wrappers in this PR are listed directly.
Two independent synthetic CMake probes confirmed that the outside file is compiled and linked. The second probe tested both orders, direct listing and an all-in-tree control on Windows x64, CMake 3.31.6-msvc6 and MSVC 19.44 with the Visual Studio 2022 generator. CTest passed 1/1 for each configuration. The verifier result comes from reading the pinned diff. VeTkN's separate review covers the actual runtime build in an ampersand path. Runtime build result.
Could the verifier check each entry in a simple set() list when expanding it in a target? A regression with the outside file second would cover this case. Coordination claim · Verifier at reviewed head.
No game files. AI-assisted.
outside_sources() kept only the first value of a set(), so set(SRC probe.cpp ../outside/helper.cpp) passed (found by DoubleD17). Each value of every set() and list(APPEND) is now expanded, one word per value, and a test covers the outside file listed second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @DoubleD17, confirmed and fixed in AI-assisted (Claude Code). |
|
Also checked the AI-assisted (Claude Code). |
|
Independent Windows check of 6b533d19. All five tests in
AI-assisted. |
|
Tested
AI-assisted (Claude Code). |
Claim: #6089 (comment) (found by @VeTkN in #3554)
Depends on: none
What changed and why
A full runtime build in a checkout whose folder name has
&(C:\LT\amp&caret^dir, or here%TEMP%\leo\a&b\L) stopped atgta6rt_xtaskqueue.lib:The four vendored xtaskqueue sources sit outside
runtime/, so CMake names their objects after the sources' absolute paths, and the Ninja generator hands object names tolib.exeunquoted throughcmd.exe /C. cmd splits at the&. Every other object name is relative to the build folder, and compile lines quote their-Ipaths, so only this target was affected.runtime/shims/xtaskqueue/{TaskQueue,AsyncLib,ThreadPool_win32,WaitTimer_win32}.cpp: one-line wrappers that#includethe vendored file.third_party/xtaskqueuestays unmodified, andpch.hstill comes fromshims/xtaskqueue.runtime/CMakeLists.txt:gta6rt_xtaskqueuelists the wrappers, with a comment saying why.tests/test_runtime_sources_in_tree.py(standard library, picked up by thecheckloop): readsruntime/CMakeLists.txtand fails ifadd_library,add_executableortarget_sourcescompiles a source that resolves outsideruntime/(every value of eachset()andlist(APPEND ...)is expanded, since6b533d19after @DoubleD17's review; build-folder outputs are allowed). It also checks the four wrappers point at existing vendored files.Tests (Windows 11 Pro 26300, MSVC 19.44 / VS 2022 Build Tools, CMake 4.4.4 + VS Ninja, AMD Radeon RX 9060 XT, AMD driver 2.0.416 / Vulkan 1.4.359)
python -I tests/test_runtime_sources_in_tree.py: 5 tests OK at6b533d19(a first-value-only expansion fails the list-variable test). Withmain'sruntime/CMakeLists.txtit fails and lists the four../third_party/xtaskqueuesources.main561b65a8in%TEMP%\leo\a&b\L: configure succeeds,gta6rt_xtaskqueuefails with theLNK1181above.ctest -j 6: 242 of 247 pass. The 5 failures are not path-related. I ran the same tests onmain561b65a8built in a plain folder (%TEMP%\leo\plain\L) on the same machine:vk_queue_query_sync,d3d12_texture_tiles,d3d12_indirect_dispatch_count,d3d12_pipeline_library_hostfail there too, with the same messages.d3d12_sparse_queue_family_contractis flaky on both: 1 pass in 5 runs on this branch, 1 in 5 onmain.scripts/build_runtime.ps1(no CMake), which this does not touch.AI-assisted (Claude Code).