Repository navigation
fix(relinker): preserve inputs when writing Windows diagnostics - #4338
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Merged
Conversation
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--windows --windows-diagnosticswriteswindows-diagnostics-imports.txtin the current directory. If that path names the input executable or aliases a bundled module, conversion currently succeeds after truncating the source file. Add this report to the existing input/output collision preflight, before registry, module or executable output is written. The check uses the same file-identity comparison as other outputs, so hard links and symbolic links are covered.Reproducer: create the existing
main_fixture()ELF aswindows-diagnostics-imports.txt, then run from that directory:Before: exit 0, the 32,768-byte input becomes empty. After: exit 2 with
Windows import diagnostics output would overwrite the input executable, and the input remains byte-for-byte unchanged. The regression also covers bundled modules, hard links, optional registry output, and existing outputs that must remain untouched. Separate diagnostics files still get written or replaced; an input named like the report remains valid when diagnostics are disabled.Checked current open PR file inventory and related issues/PR discussions. #3970, #4140 and #4194 touch other parts of
main.cpp; none adds this preflight. Open usage-document changes affect other paragraphs/options. Merged #3495 and #3678 establish the existing registry/desktop collision behavior that this change extends. No dependency on those open PRs.Branch:
fix/diagnostic-input-preservation. Base:d06c06565717961104edecdab46ce61c8cc72a70. Fixed commit:4b6bb2f05928d8026d89459b22d3cba0a532ac6d.Tested
Windows 11 x64 (build 26200), supported WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH r7, CMake 4.3.1, Ninja 1.13.2, Python 3.13.7. Synthetic ELF fixtures exercise the relinker executable and actual filesystem writes; no title, GPU, Linux/macOS guest execution or full library build was used for this fix.
Configured unchanged baseline
2ccbd376f86a0ab2dafca98749585e281f37d599intobuild-relinker-baselineand built itsrelinkertarget before modifying the C++ source. Configured the fixed tree separately intobuild-relinker:input_magicandinput_preservationare registered. Four unrelated tooling tests were excluded because their disposable repository fixtures create Git commits, which this local workflow currently disallows. No test timeout was raised.git diff --checkpasses.python tools/check_conventions.py --base origin/mainpasses on the submitted commit. No CI result is claimed.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
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (no new unimplemented paths).mdfiles or images added to the repository (attach them to this PR)