Repository navigation
Build Node release binaries with Bazel - #1416
Conversation
0c9e342 to
c789449
Compare
Use the Bazel Node addon target to produce npm scoped binary package artifacts while keeping the existing node-gyp source fallback for unsupported platforms.
c789449 to
508f692
Compare
|
Have you compared if the binary sizes are similar generated from both systems? Are the diffs explainable? |
|
我比較了一下,差異看起來是可解釋的,而且沒有看到 package size 方面的異常。 比較方式:
結果如下:
Linux/Windows 的 binary 和 package 都變小。macOS 的未壓縮 我也看了 macOS 差異:舊 gyp 產物是 Mach-O bundle;Bazel 產物是 Mach-O dylib,會多一個 另外本機同 commit 也比較了 |
|
我又補了一輪真正的 end-to-end prebuilt 驗證,用 GitHub Actions hosted runners 當臨時 VM 跑了五個平台:
驗證 run: https://github.com/BYVoid/OpenCC/actions/runs/28997678352 每個平台的測試流程都是:
五個 matrix jobs 都通過,所以目前看起來這些 Bazel 產出的 prebuilt addons 不只是能 build/pack,也能在對應平台乾淨安裝後端到端使用。 |
Summary
npm run prebuildto the Bazel scriptbinding.gyp/node-gyp-buildas the source-build fallback and document the splitVerification
./scripts/build-node-prebuild-bazel.sh darwin-arm64PREBUILDS_ONLY=1 npm testnpm run prepare:scoped-packagesnpm pack --dry-run dist/scoped-packages/@opencc/opencc-darwin-arm64npm pack --dry-runbazel test --test_output=errors //node/test:node_testbash -n scripts/build-node-prebuild-bazel.sh scripts/build-node-windows-prebuild-zig.sh.github/workflows/release-npm.ymland.github/workflows/release-npm-binaries.yml