From e8e3f548497d957021a961065faec81cf6be6f55 Mon Sep 17 00:00:00 2001 From: b Date: Mon, 27 May 2024 22:05:19 +0000 Subject: [PATCH] actions: build node addon for aarch64 linux using zig --- .github/workflows/publish-tdl.yml | 42 ++++++++++++------------------- CHANGELOG.md | 1 + README.md | 2 +- packages/tdl/package.json | 2 +- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish-tdl.yml b/.github/workflows/publish-tdl.yml index 8445349..91a5b2a 100644 --- a/.github/workflows/publish-tdl.yml +++ b/.github/workflows/publish-tdl.yml @@ -23,41 +23,31 @@ jobs: with: node-version: lts/* cache: npm + - uses: goto-bus-stop/setup-zig@v2 - name: Install dependencies run: npm install - name: Clean old binaries run: npm run clean -w tdl - - name: Prebuildify in docker + - name: Prebuildify (Linux via zig) if: runner.os == 'Linux' run: | - # docker run -u root -v $(pwd):/app ghcr.io/prebuild/centos7-devtoolset7:2 \ - # npm run make-prebuild -w tdl -- --tag-libc - cat > prebuilt-node-addon.sh <= 2.17), and macOS (x86_64, aarch64; v10.14+). If a pre-built binary is not available for your system, then the node addon will be built using node-gyp, requiring Python and a C++ toolchain (C++14 is required) to be installed (on Windows, MSVS or Build Tools). Pass `--build-from-source` to never use the pre-built binaries. Note that macOS aarch64 binaries aren't tested. +[^1]: `tdl` is packaged with pre-built addons for Windows (x86_64), GNU/Linux (x86_64, arm64; glibc >= 2.17), and macOS (x86_64, arm64; v10.14+). If a pre-built binary is not available for your system, then the node addon will be built using node-gyp, requiring Python and a C++ toolchain (C++14 is required) to be installed (on Windows, MSVS or Build Tools). Pass `--build-from-source` to never use the pre-built binaries. arm64 binaries are not tested in the CI. Only Linux binaries are statically linked against libstdc++. ## Installation diff --git a/packages/tdl/package.json b/packages/tdl/package.json index 7b8efb7..45f8795 100644 --- a/packages/tdl/package.json +++ b/packages/tdl/package.json @@ -8,7 +8,7 @@ "build:lib": "tsc", "build:addon": "node-gyp rebuild", "build": "tsc && node scripts/copy-readme.js && node scripts/generate-flow.js && node-gyp rebuild", - "make-prebuild": "prebuildify --napi -t 18.20.2 --strip", + "make-prebuild": "prebuildify --napi -t 18.20.2", "clean": "node-gyp clean", "install": "node-gyp-build" },