Fix CI: cargo fmt and static linking on macOS#106
Closed
jucasoliveira wants to merge 2 commits into
Closed
Conversation
- Run cargo fmt on inference.rs: match guard arm now uses brace on new line as required by rustfmt (Type::RefWithLifetime guard pattern) - .cargo/config.toml: link libzstd.a statically on both macOS targets instead of adding a dynamic library search path - release.yml (aarch64): remove LLVM's libunwind.dylib after install so the linker falls back to the system libunwind, preventing homebrew dynamic dependency in the distributed binary - release.yml (x86_64): switch from -lzstd with search path to explicit static archive path - ci.yml (macOS): remove LLVM's libunwind.dylib in test job as well Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes two CI failures. Closes #3 if applicable.
Changes
1.
cargo fmtfix —src/types/inference.rsThe
collect_lifetimes_from_typefunction had a match arm using theif-inside-block pattern, which was converted to a proper match guard.rustfmtrequires the opening brace of a guarded arm to appear on a new line:2. Static linking fix — libzstd and libunwind on macOS
Problem: The binary dynamically linked
/opt/homebrew/opt/zstd/lib/libzstd.1.dyliband/opt/homebrew/opt/llvm@18/lib/libunwind.1.dylib, making the distributed artifact depend on Homebrew being installed.Fix:
.cargo/config.toml: replaced-L <zstd-dir>(dynamic search path) with-C link-arg=<zstd-dir>/libzstd.a(explicit static archive) for both macOS targets.release.yml/ci.ymlmacOS steps: addedsudo rm -f .../libunwind*.dylibafter installing LLVM@18, so the linker falls back to the systemlibunwind— matching the approach already used for the x86_64 cross-compile target.release.ymlx86_64 build step: switched from-L .../zstd/lib -lzstdto the static archive path.Test plan
cargo fmt --all -- --checkpassescargo build --releaseandcargo test --releasepassotool -Lshows no Homebrew dynamic libsotool -Lshows no Homebrew dynamic libs🤖 Generated with Claude Code