From fbe97be73d18865da23c21878432793c99d2b2bc Mon Sep 17 00:00:00 2001 From: jinrui Date: Tue, 17 Dec 2024 15:33:21 +0800 Subject: [PATCH] ci: linux-musl build failed (#8743) * fix: linux-musl release build failed * fix: comment --- .github/workflows/reusable-build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index f1521accd6a..ab0125c16b8 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -148,7 +148,8 @@ jobs: target: ${{ inputs.target }} image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 profile: ${{ inputs.profile }} - pre: export CC_aarch64_unknown_linux_gnu=clang + pre: | + export CC_aarch64_unknown_linux_gnu=clang - name: Build x86_64-unknown-linux-musl in Docker if: ${{ inputs.target == 'x86_64-unknown-linux-musl' && steps.check_cache.outputs.files_exists != 'true' && !inputs.skipable }} @@ -157,6 +158,12 @@ jobs: target: ${{ inputs.target }} image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine profile: ${{ inputs.profile }} + pre: | + # musl will enable clang-sys static linking + # https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static + # llvm19-dev is used to install llvm-config + # clang19-static is used to install libclang.a + apk add llvm19-dev clang19-static - name: Build aarch64-unknown-linux-musl in Docker if: ${{ inputs.target == 'aarch64-unknown-linux-musl' && steps.check_cache.outputs.files_exists != 'true' && !inputs.skipable }} @@ -167,6 +174,11 @@ jobs: profile: ${{ inputs.profile }} pre: | export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc + # musl will enable clang-sys static linking + # https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static + # llvm19-dev is used to install llvm-config + # clang19-static is used to install libclang.a + apk add llvm19-dev clang19-static # setup rust target for windows and macos - name: Setup Rust Target