From 4a1ec3276d227f0762b32116a6a89f9d29012917 Mon Sep 17 00:00:00 2001 From: iff Date: Wed, 12 Feb 2025 17:00:03 +0100 Subject: [PATCH] ci: change gnu libraries to musl --- .github/workflows/build.yaml | 23 ++++++++++++++++++----- install.sh | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d6ab9f..3292b43 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,24 +23,28 @@ jobs: matrix: include: - os: ubuntu-latest - target: x86_64-unknown-linux-gnu + target: x86_64-unknown-linux-musl deb: true rpm: true + musl: true - os: ubuntu-latest - target: i686-unknown-linux-gnu + target: i686-unknown-linux-musl deb: true rpm: true cross: true + musl: true - os: ubuntu-latest - target: aarch64-unknown-linux-gnu + target: aarch64-unknown-linux-musl deb: true rpm: true cross: true + musl: true - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf + target: armv7-unknown-linux-musleabihf deb: true rpm: true cross: true + musl: true - os: ubuntu-latest target: aarch64-linux-android cross: true @@ -67,16 +71,25 @@ jobs: target: ${{ matrix.target }} profile: minimal + - name: Install musl + if: matrix.musl == true + run: sudo apt-get install -y musl-tools + - name: Caching uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - name: Build - if: ${{ matrix.cross == false}} + if: ${{ matrix.cross == false && matrix.musl == false }} run: cargo build --release --workspace --locked --target ${{ matrix.target }} + - name: Build (musl) + if: ${{ matrix.cross == false && matrix.musl == true }} + run: + cargo build --release --workspace --no-default-features --locked --target ${{ matrix.target }} + - name: Build (cross) if: ${{ matrix.cross == true}} # cross 0.2.5 broken for android diff --git a/install.sh b/install.sh index e95f3d8..1651411 100644 --- a/install.sh +++ b/install.sh @@ -201,7 +201,7 @@ get_architecture() { local _ostype _cputype _bitness _arch _clibtype _ostype="$(uname -s)" _cputype="$(uname -m)" - _clibtype="gnu" + _clibtype="musl" if [ "${_ostype}" = Linux ]; then if [ "$(uname -o || true)" = Android ]; then @@ -329,7 +329,7 @@ get_architecture() { esac # Detect 64-bit linux with 32-bit userland - if [ "${_ostype}" = unknown-linux-gnu ] && [ "${_bitness}" -eq 32 ]; then + if [ "${_ostype}" = unknown-linux-musl ] && [ "${_bitness}" -eq 32 ]; then case ${_cputype} in x86_64) # 32-bit executable for amd64 = x32