Skip to content

fix(relinker): accept trailing separators on the Windows origin path - #4337

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
ArjenS-LA:fix/windows-origin-slash
Oct 12, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
ArjenS-LA:fix/windows-origin-slash

Conversation

@ArjenS-LA

Copy link
Copy Markdown
Contributor

What

relinker --windows --rpath '$ORIGIN/' ... rejects a valid executable-directory library path with Ambiguous Windows run path, while $ORIGIN succeeds. Normalization strips the prefix to an empty string and reads back() before constructing a rooted path.

Normalize the emptied prefix to .. Both slash and backslash forms now resolve beside the executable. The regression generates a provider, converts a consumer with five equivalent runpaths, and on Windows executes each consumer from another working directory. Each must load the adjacent provider and return its value, 77.

Base: d06c06565717961104edecdab46ce61c8cc72a70.
Branch: fix/windows-origin-slash.
Fixed commit: e2c24cf038b9bb5f200a666b2b5fedf2fdf10ff9.

Tested

Windows x86-64, OS build 10.0.26200, supported WinLibs MinGW-w64 GCC 15.2.0 (x86_64-ucrt-posix-seh, r7), Python 3.13.7.

  • Identical test_windows_runpath.py fails on baseline at $ORIGIN/, after the bare $ORIGIN control successfully converts and executes. The fixed test passes with $ORIGIN, $ORIGIN/, $ORIGIN\, $ORIGIN/. and .; all five generated consumers load the provider and exit 77.
  • Baseline binary built at b42ef24e07725ba1166420073817d80a60ec9149; current base d06c06565717961104edecdab46ce61c8cc72a70 has identical relinker, build and tooling sources. The fixed build uses the current base.
  • Relinker-only Release build with BUILD_TESTING=ON and explicit Python3_EXECUTABLE succeeds; Python-backed input_magic is registered.
  • ctest --test-dir build-relinker-origin-slash --output-on-failure -E 'conventions_function_bodies|conventions_wrapped_declarations|import_audit|pr_overlap_encoding' -j 4: 119/119 pass in 18.02 seconds. The four excluded tooling tests create disposable Git commits and were not repeated under the personal commit quota; baseline Python tooling tests already passed 178 tests with two Windows symlink skips.
  • git diff --check passes. python tools/check_conventions.py --base origin/main passes on the submitted commit.

This includes execution of generated Windows fixture executables and their provider. No game/title, GPU, Linux/macOS runtime or upstream CI validation is claimed.

Reviewed the complete open-PR file inventory and the diffs/discussions of #3579, #3965, #3970 and #4062, which also edit Windows startup construction. None changes normalizeRunPath or addresses this failure. No dependency on those changes.

After fast-forwarding to current main, the targeted regression passed again. Relinker builds reported no work because their sources and build configuration were unchanged. No upstream CI result is claimed.

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 in TechnicalDebt — no runtime exports changed
  • 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 — none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes — OpenAI Codex

@github-actions

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4547 core/relinker/CMakeLists.txt L404

@ArjenS-LA

Copy link
Copy Markdown
Contributor Author

@codingreapermaps, I checked this PR against #4547 using Git's merge engine, normalizing both heads onto main d592d54e11ecce022abd62635a58bf2d048f3a2c and using that main as the explicit merge base.

At heads e2c24cf038b9bb5f200a666b2b5fedf2fdf10ff9 (#4337) and 0af8b55e8a2d3a37795234cf729ea50589c1aaa7 (#4547), both merge cleanly with main. Combining them conflicts only in core/relinker/CMakeLists.txt: windows_runpath and windows_trace_imports are inserted at the same location. The WindowsEntryStubBuilder.cpp changes merge cleanly; these fixes have no functional dependency.

Would #4337 merging first work for you, with both test registrations retained when #4547 is updated afterward? That would let #4547 record Depends on: #4337 for merge coordination alongside its existing #4546 dependency.

This is a tree-only merge preview and source inspection on Windows x64. I have not built or run the combined tree, and no code changes were pushed.

@oneandonlydean
oneandonlydean merged commit 0a6bb6a into boykopovar:main Oct 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants