fix(relinker): build the manifest resource in paths with spaces #5301

Merged
wachi35676 merged 1 commit from upstream-pr/5301 into main 2026-10-14 01:35:21 +00:00
wachi35676 commented 2026-10-13 16:45:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-13T16:45:04Z.


What

On Windows the relinker does not build when the checkout path contains a space. windres passes the include directories to the preprocessor unquoted, so relinker.rc fails:

cc1.exe: fatal error: Contribution/AnyPS5/core/relinker/cli/include: No such file or directory
windres.exe: preprocessing failed.

#2210 fixed the same failure for FreeType's ftver.rc; relinker.rc arrived later with the long-path manifest (#4618) and inherits the relinker target's include directories. The resource only includes <winuser.h> and the manifest next to it, so it is now compiled in its own object library, which has no include directories, and its object is added to relinker. The OBJECT_DEPENDS on relinker.manifest is kept.

Tested

Windows 11 26200, WinLibs GCC 15.2.0 UCRT (15.2.0posix-14.0.0-ucrt-r7), windres 2.46.0, CMake 4.3.1, relinker-only build (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON) with the checkout in ...\Emulation Contribution\AnyPS5.

  • Before, on 0214069e3: the build stops at relinker.rc.obj with the error above.

  • After: the build completes, relinker.exe has a .rsrc section holding the manifest (longPathAware is present), and ctest passes 150/150.

  • build.ninja shows the relinker.rc.obj edge without INCLUDES and still depending on relinker.manifest.

  • python tools/check_conventions.py --base origin/main passes.

  • Full build with -DBUILD_TESTING=ON in the same checkout, with this change on 0214069e3: configure and build complete (3155 steps). ctest -j 6 on a machine under other load: 1088 of 1095 passed, 7 skipped; the 7 that failed (conventions_function_bodies, host_thread_local, guest_video_out_high_frame_rate, guest_pthread_start, guest_pthread_rwlock, guest_raise_exception, guest_file_lock_process; timeouts and two aborts) all pass when rerun one at a time.

Not tested: Linux and macOS (the changed block is inside if(WIN32)).

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4846488797 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5301). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-13T16:45:04Z. --- ### What On Windows the relinker does not build when the checkout path contains a space. `windres` passes the include directories to the preprocessor unquoted, so `relinker.rc` fails: ``` cc1.exe: fatal error: Contribution/AnyPS5/core/relinker/cli/include: No such file or directory windres.exe: preprocessing failed. ``` #2210 fixed the same failure for FreeType's `ftver.rc`; `relinker.rc` arrived later with the long-path manifest (#4618) and inherits the `relinker` target's include directories. The resource only includes `<winuser.h>` and the manifest next to it, so it is now compiled in its own object library, which has no include directories, and its object is added to `relinker`. The `OBJECT_DEPENDS` on `relinker.manifest` is kept. ### Tested Windows 11 26200, WinLibs GCC 15.2.0 UCRT (`15.2.0posix-14.0.0-ucrt-r7`), windres 2.46.0, CMake 4.3.1, relinker-only build (`-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`) with the checkout in `...\Emulation Contribution\AnyPS5`. - Before, on `0214069e3`: the build stops at `relinker.rc.obj` with the error above. - After: the build completes, `relinker.exe` has a `.rsrc` section holding the manifest (`longPathAware` is present), and `ctest` passes 150/150. - `build.ninja` shows the `relinker.rc.obj` edge without `INCLUDES` and still depending on `relinker.manifest`. - `python tools/check_conventions.py --base origin/main` passes. - Full build with `-DBUILD_TESTING=ON` in the same checkout, with this change on `0214069e3`: configure and build complete (3155 steps). `ctest -j 6` on a machine under other load: 1088 of 1095 passed, 7 skipped; the 7 that failed (`conventions_function_bodies`, `host_thread_local`, `guest_video_out_high_frame_rate`, `guest_pthread_start`, `guest_pthread_rwlock`, `guest_raise_exception`, `guest_file_lock_process`; timeouts and two aborts) all pass when rerun one at a time. Not tested: Linux and macOS (the changed block is inside `if(WIN32)`). ### Checklist - [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 (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
johandavidcm commented 2026-10-13 21:50:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johandavidcm on 2026-10-13T21:50:49Z.


Independent validation on Windows with a checkout path that contains spaces (E:\Rangers Guild Proyects\...): Windows 11 26200, WinLibs GCC 15.2.0 UCRT (15.2.0posix-14.0.0-ucrt-r7), CMake 4.3.1, relinker-only build (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON).

  • main c7601b797: the build stops at relinker.rc.obj with cc1.exe: fatal error: Guild\: No such file or directory.
  • This PR (04421e7d4) merged into c7601b797: the build completes, relinker.rc.obj is built by relinker_resources without include directories, relinker.exe still embeds the manifest (longPathAware present, .rsrc section), and ctest passes 150/150.

Not tested: Linux and macOS.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155948294 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5301#issuecomment-6155948294). Originally posted by [johandavidcm](https://github.com/johandavidcm) on 2026-10-13T21:50:49Z. --- Independent validation on Windows with a checkout path that contains spaces (`E:\Rangers Guild Proyects\...`): Windows 11 26200, WinLibs GCC 15.2.0 UCRT (`15.2.0posix-14.0.0-ucrt-r7`), CMake 4.3.1, relinker-only build (`-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`). - `main` `c7601b797`: the build stops at `relinker.rc.obj` with `cc1.exe: fatal error: Guild\: No such file or directory`. - This PR (`04421e7d4`) merged into `c7601b797`: the build completes, `relinker.rc.obj` is built by `relinker_resources` without include directories, `relinker.exe` still embeds the manifest (`longPathAware` present, `.rsrc` section), and `ctest` passes 150/150. Not tested: Linux and macOS.
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!5301
No description provided.