CI: build the MinGW Clang matrix without debug info - #5360
Open
nlohmann wants to merge 1 commit into
Open
Conversation
Linking test-regression2_cpp20 intermittently fails with unit-regression2.cpp.obj:(.debug_info+0x16): relocation truncated to fit: IMAGE_REL_AMD64_SECREL against `.debug_line' The failure moves between matrix entries from run to run, and the same commit can pass and fail on consecutive runs, so it is the size of the debug sections rather than any one Clang version. The jobs only build and run the tests, so override CMAKE_CXX_FLAGS_DEBUG to drop the default -g. Everything else about the Debug build is unchanged: no optimization flag is added and NDEBUG stays undefined, so JSON_ASSERT remains active. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
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.
The
clangmatrix inwindows.ymlfails intermittently while linkingtest-regression2_cpp20:Why this is not a code problem
clang (13.0.1)failed while15.0.7,16.0.6and19.1.7linked the same binary fine. Re-running the same commit flipped it:13.0.1passed and11.0.1failed instead, with a byte-identical message.claude/binary-writer-output-sinkshit the same error on the same target.Error 130(SIGINT) —fail-fastcancelling them, not real failures.So it is the size of the debug sections that
unit-regression2.cppproduces at C++20, not any one Clang version: the MinGW linker cannot relocateDW_AT_stmt_listinto.debug_lineonce it grows past what a 32-bitSECRELrelocation can address.The change
Override
CMAKE_CXX_FLAGS_DEBUGto-g0for that matrix, so no debug sections are emitted and the relocation cannot occur. This is a categorical fix rather than a probabilistic one.The jobs build the tests and run them under
ctest; nothing consumes the debug info. doctest's failure output uses__FILE__/__LINE__, so--output-on-failureis unaffected.Everything else about the Debug build is unchanged. Verified by configuring the project both ways:
No optimization flag is added and
NDEBUGstays undefined, soJSON_ASSERTremains active.Result
Run 30921367054 on this branch: all nine
clangmatrix entries pass, including11.0.1and13.0.1, the two that had been failing.Job times are modestly better for the entries that previously ran to completion —
15.0.79m→8m,16.0.69m→8m,19.1.79m→7m.Scope
Only the
clangjob is changed, because that is where the failure has been observed. Themingwjob (GCC 12.2.0) uses the same linker and the sameDebugbuild type, so it carries the same latent risk — I left it alone rather than change a job that is not failing.Public API
No changes to the public API. This touches only
.github/workflows/windows.yml; no library, test, or documentation source is modified.make amalgamatewas run (not applicable — no header changes).This pull request was written by Claude Code.