95
95
build : RUSTFLAGS="-C target-feature=+crt-static" npm run build:napi -- --release
96
96
target : x86_64-pc-windows-msvc
97
97
- host : windows-latest
98
- build : >-
99
- set -e &&
100
- rustup target add i686-pc-windows-msvc &&
101
- npm run build:napi -- --release --target i686-pc-windows-msvc
98
+ build : npm run build:napi -- --release --target i686-pc-windows-msvc
102
99
target : i686-pc-windows-msvc
103
100
- host : windows-latest
104
101
target : aarch64-pc-windows-msvc
@@ -107,78 +104,44 @@ jobs:
107
104
# MacOS
108
105
- host : macos-latest
109
106
target : x86_64-apple-darwin
110
- build : >-
111
- set -e &&
112
- npm run build:napi -- --release --target x86_64-apple-darwin
107
+ build : npm run build:napi -- --release --target x86_64-apple-darwin
113
108
- host : macos-latest
114
109
target : aarch64-apple-darwin
115
- build : >-
116
- set -e &&
117
- rustup target add aarch64-apple-darwin &&
118
- npm run build:napi -- --release --target aarch64-apple-darwin
110
+ build : npm run build:napi -- --release --target aarch64-apple-darwin
119
111
120
112
# Linux
121
113
- host : ubuntu-latest
122
114
target : x86_64-unknown-linux-gnu
123
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
124
- build : >-
125
- set -e &&
126
- rustup target add x86_64-unknown-linux-gnu &&
127
- npm run build:napi -- --release --target x86_64-unknown-linux-gnu
115
+ build : TARGET_CC=clang npm run build:napi -- --release --target x86_64-unknown-linux-gnu --use-napi-cross
128
116
- host : ubuntu-latest
129
117
target : x86_64-unknown-linux-musl
130
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
131
- build : >-
132
- set -e &&
133
- npm run build:napi -- --release
118
+ build : npm run build:napi -- --release --target x86_64-unknown-linux-musl -x
134
119
- host : ubuntu-latest
135
120
target : armv7-unknown-linux-gnueabihf
136
- zig : true
137
121
setup : |
138
122
sudo apt-get update
139
- sudo apt-get install gcc-arm-linux-gnueabihf -y
140
- build : >-
141
- set -e &&
142
- npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf
123
+ sudo apt-get install libatomic1-armhf-cross -y
124
+ build : TARGET_CC=clang npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf --use-napi-cross
143
125
- host : ubuntu-latest
144
126
target : armv7-unknown-linux-musleabihf
145
- zig : true
146
- build : >-
147
- set -e &&
148
- npm run build:napi -- --release --target armv7-unknown-linux-musleabihf
127
+ build : npm run build:napi -- --release --target armv7-unknown-linux-musleabihf -x
149
128
- host : ubuntu-latest
150
129
target : aarch64-unknown-linux-gnu
151
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
152
- build : >-
153
- set -e &&
154
- export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
155
- rustup default stable &&
156
- rustup target add aarch64-unknown-linux-gnu &&
157
- npm run build:napi -- --release --target aarch64-unknown-linux-gnu
130
+ build : TARGET_CC=clang npm run build:napi -- --release --target aarch64-unknown-linux-gnu --use-napi-cross
158
131
- host : ubuntu-latest
159
132
target : aarch64-unknown-linux-musl
160
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
161
- build : >-
162
- set -e &&
163
- export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
164
- rustup default stable &&
165
- rustup target add aarch64-unknown-linux-musl &&
166
- RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl
133
+ build : npm run build:napi -- --release --target aarch64-unknown-linux-musl -x
167
134
- host : ubuntu-latest
168
135
target : armv7-linux-androideabi
169
- build : >-
170
- set -e &&
171
- npm run build:napi -- --release --target armv7-linux-androideabi
136
+ build : npm run build:napi -- --release --target armv7-linux-androideabi --use-napi-cross
172
137
- host : ubuntu-latest
173
138
target : aarch64-linux-android
174
- build : >-
175
- set -e &&
176
- npm run build:napi -- --release --target aarch64-linux-android
139
+ build : npm run build:napi -- --release --target aarch64-linux-android --use-napi-cross
177
140
- host : ubuntu-latest
178
141
target : riscv64gc-unknown-linux-gnu
179
142
setup : |
180
143
sudo apt-get update
181
- sudo apt-get install gcc-riscv64-linux-gnu -y
144
+ sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
182
145
build : >-
183
146
set -e &&
184
147
rustup target add riscv64gc-unknown-linux-gnu &&
@@ -188,6 +151,8 @@ jobs:
188
151
docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
189
152
build : >-
190
153
set -e &&
154
+ unset CC &&
155
+ export TARGET_CC=clang &&
191
156
apk add binutils-riscv64 &&
192
157
mkdir -p /sysroot-riscv64/etc/apk &&
193
158
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/main' > /sysroot-riscv64/etc/apk/repositories &&
@@ -201,23 +166,14 @@ jobs:
201
166
npm run build:napi -- --release --target riscv64gc-unknown-linux-musl
202
167
- host : ubuntu-latest
203
168
target : powerpc64le-unknown-linux-gnu
204
- setup : |
205
- sudo apt-get update
206
- sudo apt-get install gcc-powerpc64le-linux-gnu -y
207
- build : >-
208
- set -e &&
209
- export CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc && rustup target add powerpc64le-unknown-linux-gnu &&
210
- npm run build:napi -- --release --target powerpc64le-unknown-linux-gnu
169
+ build : CC=clang TARGET_CC=clang npm run build:napi -- --release --target powerpc64le-unknown-linux-gnu --use-napi-cross
211
170
- host : ubuntu-latest
212
171
target : s390x-unknown-linux-gnu
213
- setup : |
214
- sudo apt-get update
215
- sudo apt-get install gcc-s390x-linux-gnu -y
216
- build : >-
217
- set -e &&
218
- export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc &&
219
- rustup target add s390x-unknown-linux-gnu &&
220
- npm run build:napi -- --release --target s390x-unknown-linux-gnu
172
+ build : |
173
+ export TARGET_CC=clang
174
+ export CC=clang
175
+ export CFLAGS="-fuse-ld=lld"
176
+ npm run build:napi -- --release --target s390x-unknown-linux-gnu --use-napi-cross
221
177
- host : ubuntu-latest
222
178
target : loongarch64-unknown-linux-gnu
223
179
docker : ghcr.io/darkyzhou/napi-rs-nodejs-rust:trixie-loongarch64
@@ -253,9 +209,16 @@ jobs:
253
209
key : ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}-${{ hashFiles('rust/Cargo.lock') }}
254
210
restore-keys : ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}
255
211
- uses : goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
256
- if : ${{ matrix.settings.zig }}
212
+ if : ${{ contains(matrix.settings.target, 'musl') }}
213
+ with :
214
+ version : 0.14.1
215
+ - name : Install cargo-zigbuild
216
+ uses : taiki-e/install-action@d188da0a65bc6c80011567688127bddc8be0ca24 # v2.56.21
217
+ if : ${{ contains(matrix.settings.target, 'musl') }}
218
+ env :
219
+ GITHUB_TOKEN : ${{ github.token }}
257
220
with :
258
- version : 0.10.1
221
+ tool : cargo-zigbuild
259
222
- name : Setup toolchain
260
223
run : ${{ matrix.settings.setup }}
261
224
if : ${{ matrix.settings.setup }}
@@ -324,11 +287,11 @@ jobs:
324
287
settings :
325
288
- name : freebsd
326
289
architecture : x86-64
327
- version : ' 13.3 '
290
+ version : ' 14.2 '
328
291
target : x86_64-unknown-freebsd
329
292
- name : freebsd
330
293
architecture : arm64
331
- version : ' 13.3 '
294
+ version : ' 14.2 '
332
295
target : aarch64-unknown-freebsd
333
296
name : Build ${{ matrix.settings.name }} ${{ matrix.settings.architecture }}
334
297
runs-on : ubuntu-latest
@@ -357,14 +320,14 @@ jobs:
357
320
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
358
321
restore-keys : node-modules-${{ runner.os }}
359
322
- name : Build
360
- uses : cross-platform-actions/action@97419d18f6470332677e345e9df97cdc71244ead # v0.28 .0
323
+ uses : cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29 .0
361
324
with :
362
325
operating_system : ${{ matrix.settings.name }}
363
326
architecture : ${{ matrix.settings.architecture }}
364
327
version : ${{ matrix.settings.version }}
365
328
memory : 8G
366
329
run : |
367
- sudo pkg install -y node npm rust
330
+ sudo pkg install -y node npm rust cmake
368
331
${{ steps.cache-node-modules.outputs.cache-hit != 'true' && 'npm install --ignore-scripts' || 'echo Cache hit' }}
369
332
npm run build:napi -- --release --target ${{ matrix.settings.target }}
370
333
- name : Save Cargo cache
0 commit comments