From 2aa734e747621ddc83f311ad605f20dd27afa94c Mon Sep 17 00:00:00 2001 From: null8626 Date: Tue, 29 Oct 2024 14:35:33 +0700 Subject: [PATCH] fix: try to fix node binding --- .github/workflows/CI.yml | 54 ++++++++++------------------------------ bindings/node/src/lib.rs | 2 +- 2 files changed, 14 insertions(+), 42 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d0907972..b02f0c41 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -366,11 +366,9 @@ jobs: settings: - host: macos-latest target: x86_64-apple-darwin - build: | - yarn build - strip -x *.node + build: yarn build --target x86_64-apple-darwin - host: windows-latest - build: yarn build + build: yarn build --target x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc - host: windows-latest build: yarn build --target i686-pc-windows-msvc @@ -378,63 +376,37 @@ jobs: - host: ubuntu-latest target: x86_64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian - build: | - yarn build --target x86_64-unknown-linux-gnu - strip *.node + build: yarn build --target x86_64-unknown-linux-gnu - host: ubuntu-latest target: x86_64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - build: | - yarn build - strip *.node + build: yarn build --target x86_64-unknown-linux-musl - host: macos-latest target: aarch64-apple-darwin - build: | - sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; - export CC=$(xcrun -f clang); - export CXX=$(xcrun -f clang++); - SYSROOT=$(xcrun --sdk macosx --show-sdk-path); - export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; - yarn build --target aarch64-apple-darwin - strip -x *.node + build: yarn build --target aarch64-apple-darwin - host: ubuntu-latest target: aarch64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 - build: | - yarn build --target aarch64-unknown-linux-gnu - aarch64-unknown-linux-gnu-strip *.node + build: yarn build --target aarch64-unknown-linux-gnu - host: ubuntu-latest target: armv7-unknown-linux-gnueabihf build: | sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y - yarn build --target=armv7-unknown-linux-gnueabihf - arm-linux-gnueabihf-strip *.node + sudo apt-get install gcc-arm-linux-gnueabihf -y + yarn build --target armv7-unknown-linux-gnueabihf - host: ubuntu-latest target: aarch64-linux-android - build: | - export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" - export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" - export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++" - export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" - yarn build --target aarch64-linux-android - llvm-strip *.node + build: yarn build --target aarch64-linux-android - host: ubuntu-latest target: armv7-linux-androideabi - build: | - export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" - export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" - export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++" - export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" - yarn build --target armv7-linux-androideabi - llvm-strip *.node + build: yarn build --target armv7-linux-androideabi - host: ubuntu-latest target: aarch64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - build: | - rustup target add aarch64-unknown-linux-musl + build: |- + set -e && + rustup target add aarch64-unknown-linux-musl && yarn build --target aarch64-unknown-linux-musl - /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node - host: windows-latest target: aarch64-pc-windows-msvc build: yarn build --target aarch64-pc-windows-msvc diff --git a/bindings/node/src/lib.rs b/bindings/node/src/lib.rs index d6d8a47e..b28566c7 100644 --- a/bindings/node/src/lib.rs +++ b/bindings/node/src/lib.rs @@ -218,4 +218,4 @@ fn cure(input: String, maybe_options: JsUnknown) -> Result { Ok(output) => Ok(CuredString(output)), Err(err) => Err(Error::new(Status::InvalidArg, err)), } -} +} \ No newline at end of file