ci(macos): drop -stack_size rustflag (breaks proc-macro dylib links)#294
Merged
Conversation
Follow-up to #293. Replacing `-undefined dynamic_lookup` with `-Wl,-stack_size,0x800000` fixed the dyld crash but introduced a new build failure: ld64 rejects `-stack_size` on any link that is not a main executable — ld: -stack_size option can only be used when linking a main executable cargo applies rustflags to every link invocation, including proc-macro/cdylib crates (e.g. serde_derive, linked `-dynamiclib`), so the flag fails the build before any test runs. On Linux the equivalent `-zstack-size` is silently accepted for shared objects, which is why it was never caught there. macOS already defaults the main-thread stack to 8 MB — the same value the Linux side sets explicitly — so no override is needed. Drop the custom rustflags on macOS entirely. Claude-Session: https://claude.ai/code/session_01Vnu2A87mWaKnbeFuWZSwkd
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Follow-up to #293
#293 removed
-undefined dynamic_lookup(which caused the dyldsyscall to map cache into shared region failed/ SIGABRT crash) and replaced it with-Wl,-stack_size,0x800000to preserve the Linux side's 8 MB stack intent. That replacement introduced a new build failure on macOS:Cause
ld64rejects-stack_sizeon any link target that isn't a main executable. Cargo appliesrustflagsto every link invocation — including proc-macro and cdylib crates likeserde_derive, which link as-dynamiclib. So the flag fails the build before a single test runs. On Linux the equivalent-zstack-sizeis silently accepted for shared objects, which is why the same pattern was never a problem there.Fix
Drop the custom
rustflagson macOS entirely. The macOS main-thread stack already defaults to 8 MB — the exact value the Linux side sets explicitly via-zstack-size=8388608— so no override is needed. (The-stack_sizelinker arg only affects the main thread anyway;cargo testruns tests on spawned worker threads, so it never influenced the test suite.)The step now writes only
linker = "clang"(the macOS default) plus a comment documenting both flags that must not come back.Verification
Confirmed on PR #244's runner: with #293 merged, the dyld crash is gone and the build now fails only on this
-stack_sizeerror — this PR removes that last flag. The same fix is already pushed to the #244 branch, which is re-running CI now.https://claude.ai/code/session_01Vnu2A87mWaKnbeFuWZSwkd