From 5204cb67d81c9fee587ae988c8417a1e442979db Mon Sep 17 00:00:00 2001 From: houseme Date: Mon, 7 Apr 2025 16:55:14 +0800 Subject: [PATCH] Change build target to `x86_64-unknown-linux-musl` and update system dependencies - Change build target from `x86_64-unknown-linux-gnu` to `x86_64-unknown-linux-musl` - Default install `x86_64-unknown-linux-musl` toolchain in setup action - Add `musl-tools` and `build-essential` to system dependencies --- .github/actions/setup/action.yml | 3 +++ .github/workflows/build.yml | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 4c7afb30..13eb3b8f 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -21,6 +21,8 @@ runs: run: | sudo apt update sudo apt install -y \ + musl-tools \ + build-essential \ lld \ libdbus-1-dev \ libwayland-dev \ @@ -38,6 +40,7 @@ runs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ inputs.rust-version }} + targets: x86_64-unknown-linux-musl components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 886a5bc0..32fed0f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: push: branches: - main - tags: ["v*", "*"] + tags: [ "v*", "*" ] jobs: build-rustfs: @@ -16,17 +16,17 @@ jobs: strategy: matrix: variant: - - { profile: dev, target: x86_64-unknown-linux-gnu, glibc: "default" } + - { profile: dev, target: x86_64-unknown-linux-musl, glibc: "default" } - { - profile: release, - target: x86_64-unknown-linux-gnu, - glibc: "default", - } + profile: release, + target: x86_64-unknown-linux-musl, + glibc: "default", + } - { - profile: release, - target: x86_64-unknown-linux-gnu, - glibc: "2.31", - } + profile: release, + target: x86_64-unknown-linux-musl, + glibc: "2.31", + } steps: - uses: actions/checkout@v4 @@ -190,7 +190,7 @@ jobs: merge: runs-on: ubuntu-latest - needs: [build-rustfs, build-rustfs-gui] + needs: [ build-rustfs, build-rustfs-gui ] steps: - uses: actions/upload-artifact/merge@v4 with: