Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: musl builds #1937

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,31 @@ jobs:
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV

- name: Linux ARM setup
if: matrix.target == 'aarch64-unknown-linux-musl'
- name: Musl setup (x86_64)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
sudo apt-get install -y clang musl-tools musl-dev

# g++ supports musl
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++

rustup target add ${{ matrix.target }}

- name: Musl setup
if: contains(matrix.target, 'musl')
- name: Musl setup (aarch64)
if: matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update -y
sudo apt-get install -y musl-tools musl-dev
sudo apt-get install -y clang musl-tools musl-dev gcc-aarch64-linux-gnu

# g++ supports musl
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++

# cc-rs uses the wrong defaults for this target so we override them.
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

rustup target add ${{ matrix.target }}

- name: Build binaries
Expand Down
Loading