fix(build): preserve forced include paths with spaces #8629

Merged
MarcZX10 merged 2 commits from upstream-pr/8629 into main 2026-11-08 13:58:41 +00:00
MarcZX10 commented 2026-10-20 19:03:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:03:19Z.


What

Quote the path to HostStandardStreams.hpp inside each CMake SHELL:-include option. CMake otherwise splits a checkout path containing spaces into multiple compiler arguments, which makes Windows builds fail on the forced include.

The fix covers the libc target, the library loop and shader recompiler target. Closes #8607.

Tested

  • CMake/Ninja fixture in /tmp/AnyPS5 space fixture: generated the forced-include command with the header path as one quoted argument and compiled the fixture successfully.
  • python3 tools/check_conventions.py --base upstream/main: passed.
  • git diff upstream/main...HEAD --check: passed.
  • No Windows build was run locally. The issue includes a Windows 11 reproduction and reports a successful libs build after quoting the path.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #8607
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4940909231 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8629). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T19:03:19Z. --- ### What Quote the path to `HostStandardStreams.hpp` inside each CMake `SHELL:-include` option. CMake otherwise splits a checkout path containing spaces into multiple compiler arguments, which makes Windows builds fail on the forced include. The fix covers the libc target, the library loop and shader recompiler target. Closes #8607. ### Tested - CMake/Ninja fixture in `/tmp/AnyPS5 space fixture`: generated the forced-include command with the header path as one quoted argument and compiled the fixture successfully. - `python3 tools/check_conventions.py --base upstream/main`: passed. - `git diff upstream/main...HEAD --check`: passed. - No Windows build was run locally. The issue includes a Windows 11 reproduction and reports a successful `libs` build after quoting the path. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #8607 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-20 19:05:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:05:50Z.


Additional validation: I cross-configured a Windows-target CMake/Ninja object fixture on Linux with MinGW GCC 12.0.0. Source and build paths contained spaces, as did the forced-header path. Compilation passed, and the generated command kept the -include header as one quoted argument. This is a focused MinGW cross-compile, not a full Windows project build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6298930800 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8629#issuecomment-6298930800). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T19:05:50Z. --- Additional validation: I cross-configured a Windows-target CMake/Ninja object fixture on Linux with MinGW GCC 12.0.0. Source and build paths contained spaces, as did the forced-header path. Compilation passed, and the generated command kept the `-include` header as one quoted argument. This is a focused MinGW cross-compile, not a full Windows project build.
LeandroLP23 commented 2026-10-21 16:12:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T16:12:09Z.


A native Windows build from a path with a space: Windows 11 26300, WinLibs GCC 15.2.0, Ninja, Release, BUILD_TESTING=ON. The source was C:/Users/leand/anyps5-work/Any PS5 space, and the build directory .../build space.

  • main 2c4b116da9: libc fails on its first file, as in #8607: FAILED: core/libs/CMakeFiles/libc.dir/prx/libc/Export.cpp.obj, c++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files.
  • This PR (03af44ef2a) merged into the same main (clean merge):
    • The full build (-k 0, 5670 steps) succeeds, except for ImageArrayWindowPastLayerLimit.cpp, which fails the same way from a path without spaces (#8310).
    • It produced the 360 .prx libraries and the shader recompiler objects.
    • build.ninja has 921 quoted -include "…/HostStandardStreams.hpp" flags and no unquoted ones. That covers all three sites: libc, the library loop, and the recompiler (checked on SpirvModuleEmitter.cpp).
    • From that build directory, 12 tests pass (guest_file_lock*, guest_filesystem, libc_*, agc_shader_disk_cache*, agc_driver_graphics).

BUILD_TESTING=OFF builds only libc and a few tools here, so a check with tests off wouldn't reach the other two sites.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6320678862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8629#issuecomment-6320678862). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-21T16:12:09Z. --- A native Windows build from a path with a space: Windows 11 26300, WinLibs GCC 15.2.0, Ninja, Release, `BUILD_TESTING=ON`. The source was `C:/Users/leand/anyps5-work/Any PS5 space`, and the build directory `.../build space`. - **`main` `2c4b116da9`:** `libc` fails on its first file, as in #8607: `FAILED: core/libs/CMakeFiles/libc.dir/prx/libc/Export.cpp.obj`, `c++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files`. - **This PR (`03af44ef2a`) merged into the same `main` (clean merge):** - The full build (`-k 0`, 5670 steps) succeeds, except for `ImageArrayWindowPastLayerLimit.cpp`, which fails the same way from a path without spaces (#8310). - It produced the 360 `.prx` libraries and the shader recompiler objects. - `build.ninja` has 921 quoted `-include "…/HostStandardStreams.hpp"` flags and no unquoted ones. That covers all three sites: `libc`, the library loop, and the recompiler (checked on `SpirvModuleEmitter.cpp`). - From that build directory, 12 tests pass (`guest_file_lock*`, `guest_filesystem`, `libc_*`, `agc_shader_disk_cache*`, `agc_driver_graphics`). `BUILD_TESTING=OFF` builds only `libc` and a few tools here, so a check with tests off wouldn't reach the other two sites.
Queuse commented 2026-10-21 23:36:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-21T23:36:24Z.


Native Windows 11 validation: applied 03af44ef2a to main 926ed2eda1 and built the complete libs target from a source path containing a space (GCC 15.2.0-r7, Ninja, Release). The build succeeded; generated commands retain the forced header as one quoted argument in all three target families. The same pinned main also built from a path without spaces. No title run. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328967656 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8629#issuecomment-6328967656). Originally posted by [Queuse](https://github.com/Queuse) on 2026-10-21T23:36:24Z. --- Native Windows 11 validation: applied `03af44ef2a` to main `926ed2eda1` and built the complete `libs` target from a source path containing a space (GCC 15.2.0-r7, Ninja, Release). The build succeeded; generated commands retain the forced header as one quoted argument in all three target families. The same pinned main also built from a path without spaces. No title run. AI-assisted: yes.
THEMANnt commented 2026-10-25 12:36:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T12:36:53Z.

Review: APPROVED


Reviewed head 03af44ef2a6bbc862021080860df21083da7d26d. No actionable findings in this focused Windows build fix.

The nested quotes keep the HostStandardStreams.hpp pathname together when CMake parses each SHELL:-include option. All three sites are covered: libc, the library loop and shader-recompiler targets. Paths without spaces retain the same forced-include behavior.

Validation: Windows, supported MinGW GCC 15.2.0, CMake/Ninja: exercised the three exact option lines in a small compiler fixture whose source/header/build paths contain spaces. All three head targets build and run successfully with the forced header required by the source. The same fixture with baseline options fails compilation for all three targets because the pathname is split into separate arguments. Conventions and whitespace checks pass. Hosted relinker/ASan and policy checks pass; full product jobs are skipped.

Scope: Real compiler argument handling with representative forced headers, not a complete rebuild of libc, shader recompiler or the application.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643223630 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8629#pullrequestreview-5643223630). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-25T12:36:53Z. **Review:** APPROVED --- Reviewed head `03af44ef2a6bbc862021080860df21083da7d26d`. No actionable findings in this focused Windows build fix. The nested quotes keep the HostStandardStreams.hpp pathname together when CMake parses each SHELL:-include option. All three sites are covered: libc, the library loop and shader-recompiler targets. Paths without spaces retain the same forced-include behavior. **Validation:** Windows, supported MinGW GCC 15.2.0, CMake/Ninja: exercised the three exact option lines in a small compiler fixture whose source/header/build paths contain spaces. All three head targets build and run successfully with the forced header required by the source. The same fixture with baseline options fails compilation for all three targets because the pathname is split into separate arguments. Conventions and whitespace checks pass. Hosted relinker/ASan and policy checks pass; full product jobs are skipped. **Scope:** Real compiler argument handling with representative forced headers, not a complete rebuild of libc, shader recompiler or the application.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8629
No description provided.