From b97d7643e5e459d04c5d9b35473ff166a52bcba8 Mon Sep 17 00:00:00 2001 From: jerrykingxyz Date: Tue, 17 Dec 2024 14:42:46 +0800 Subject: [PATCH 1/2] fix: linux-musl release build failed --- .github/workflows/reusable-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index f1521accd6a..0f6779b41a9 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,8 @@ jobs: target: ${{ inputs.target }} image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine profile: ${{ inputs.profile }} + pre: | + 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 +170,7 @@ jobs: profile: ${{ inputs.profile }} pre: | export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc + apk add llvm19-dev clang19-static # setup rust target for windows and macos - name: Setup Rust Target From 0bae8e5ea0f6191eab95c5747da84568d8c1b574 Mon Sep 17 00:00:00 2001 From: jerrykingxyz Date: Tue, 17 Dec 2024 15:04:55 +0800 Subject: [PATCH 2/2] fix: comment --- .github/workflows/reusable-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 0f6779b41a9..ab0125c16b8 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -159,6 +159,10 @@ jobs: 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 @@ -170,6 +174,10 @@ 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