Skip to content

Commit 70d7fa7

Browse files
authored
feat: upgrade dependencies and lockfile (#751)
1 parent cac0c8b commit 70d7fa7

30 files changed

+1588
-795
lines changed

.cargo/config.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
rustflags = ["-C", "target-feature=+sse4.2"]
33
[target.x86_64-pc-windows-msvc]
44
rustflags = ["-C", "target-feature=+sse4.2"]
5-
[target.x86_64-apple-darwin]
6-
rustflags = ["-C", "target-feature=+sse4.2"]
75
[target.aarch64-unknown-linux-musl]
8-
linker = "aarch64-linux-musl-gcc"
96
rustflags = ["-C", "target-feature=-crt-static"]

.github/workflows/ci.yaml

Lines changed: 38 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ on:
1919

2020
jobs:
2121
build:
22-
if: "!contains(github.event.head_commit.message, 'skip ci')"
23-
2422
strategy:
2523
fail-fast: false
2624
matrix:
2725
settings:
2826
- host: macos-latest
2927
target: 'x86_64-apple-darwin'
30-
build: |
31-
yarn build
32-
strip -x packages/*/*.node
28+
build: yarn build --target x86_64-apple-darwin
3329
- host: windows-latest
3430
build: yarn build
3531
target: 'x86_64-pc-windows-msvc'
@@ -40,16 +36,10 @@ jobs:
4036
target: 'i686-pc-windows-msvc'
4137
- host: ubuntu-latest
4238
target: 'x86_64-unknown-linux-gnu'
43-
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
44-
build: >-
45-
set -e &&
46-
rustup target add x86_64-unknown-linux-gnu &&
47-
yarn build --target x86_64-unknown-linux-gnu &&
48-
strip packages/*/*.node
39+
build: CC=clang yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
4940
- host: ubuntu-latest
5041
target: 'x86_64-unknown-linux-musl'
51-
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
52-
build: yarn build
42+
build: yarn build --target x86_64-unknown-linux-musl -x
5343
- host: macos-latest
5444
target: 'aarch64-apple-darwin'
5545
build: |
@@ -59,63 +49,44 @@ jobs:
5949
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
6050
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
6151
yarn build --target aarch64-apple-darwin
62-
strip -x packages/*/*.node
6352
- host: ubuntu-latest
6453
target: aarch64-unknown-linux-gnu
65-
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
66-
build: >-
67-
rustup target add aarch64-unknown-linux-gnu &&
68-
yarn build --target aarch64-unknown-linux-gnu &&
69-
llvm-strip packages/*/*.node
54+
build: CC=clang yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
7055
- host: ubuntu-latest
7156
target: 'armv7-unknown-linux-gnueabihf'
72-
setup: |
73-
sudo apt-get update
74-
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
75-
build: yarn build --target armv7-unknown-linux-gnueabihf
57+
build: CC=clang yarn build --target armv7-unknown-linux-gnueabihf --use-napi-cross
7658
- host: ubuntu-latest
7759
target: aarch64-linux-android
78-
build: |
79-
yarn build --target aarch64-linux-android
80-
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
60+
build: yarn build --target aarch64-linux-android
8161
- host: ubuntu-latest
8262
architecture: x64
8363
target: armv7-linux-androideabi
84-
build: |
85-
yarn build --target armv7-linux-androideabi
86-
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
64+
build: yarn build --target armv7-linux-androideabi
8765
- host: ubuntu-latest
8866
target: 'aarch64-unknown-linux-musl'
8967
downloadTarget: 'aarch64-unknown-linux-musl'
90-
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
91-
build: >-
92-
set -e &&
93-
rustup target add aarch64-unknown-linux-musl &&
94-
yarn build --target aarch64-unknown-linux-musl
68+
build: yarn build --target aarch64-unknown-linux-musl -x
9569
- host: windows-latest
9670
target: 'aarch64-pc-windows-msvc'
97-
build: |
98-
npm i -g @napi-rs/cli
99-
yarn build --target aarch64-pc-windows-msvc
71+
build: yarn build --target aarch64-pc-windows-msvc
10072

101-
name: stable - ${{ matrix.settings.target }} - node@18
73+
name: stable - ${{ matrix.settings.target }} - node@20
10274
runs-on: ${{ matrix.settings.host }}
10375

10476
steps:
105-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@v4
10678

10779
- name: Setup node
10880
uses: actions/setup-node@v4
10981
if: ${{ !matrix.settings.docker }}
11082
with:
111-
node-version: 18
83+
node-version: 20
11284
cache: yarn
11385

11486
- name: Install
11587
uses: dtolnay/rust-toolchain@stable
116-
if: ${{ !matrix.settings.docker }}
11788
with:
118-
toolchain: nightly-2023-10-25
89+
toolchain: nightly-2023-12-23
11990
targets: ${{ matrix.settings.target }}
12091

12192
- name: Cache cargo registry
@@ -124,8 +95,8 @@ jobs:
12495
path: |
12596
~/.cargo/registry
12697
~/.cargo/git
98+
~/.napi-rs
12799
target
128-
.cargo-cache
129100
key: ${{ matrix.settings.target }}-cargo-registry
130101

131102
- name: Setup toolchain
@@ -134,7 +105,7 @@ jobs:
134105
shell: bash
135106

136107
- uses: goto-bus-stop/setup-zig@v2
137-
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
108+
if: ${{ contains(matrix.settings.target, 'musl') }}
138109
with:
139110
version: 0.11.0
140111

@@ -149,25 +120,15 @@ jobs:
149120
- name: 'Build TypeScript'
150121
run: yarn build:ts
151122

152-
- name: Build in docker
153-
uses: addnab/docker-run-action@v3
154-
if: ${{ matrix.settings.docker }}
155-
with:
156-
image: ${{ matrix.settings.docker }}
157-
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/.cargo/git:/usr/local/cargo/git -v ${{ github.workspace }}/.cargo-cache/.cargo/registry:/usr/local/cargo/registry -v ${{ github.workspace }}:/build -w /build
158-
run: ${{ matrix.settings.build }}
159-
160123
- name: Setup node x86
161124
uses: actions/setup-node@v4
162125
if: matrix.settings.target == 'i686-pc-windows-msvc'
163126
with:
164-
node-version: 18
165-
cache: yarn
127+
node-version: 20
166128
architecture: x86
167129

168130
- name: 'Build'
169131
run: ${{ matrix.settings.build }}
170-
if: ${{ !matrix.settings.docker }}
171132
shell: bash
172133

173134
- name: Upload artifact
@@ -181,7 +142,7 @@ jobs:
181142
runs-on: macos-12
182143
name: Build FreeBSD
183144
steps:
184-
- uses: actions/checkout@v3
145+
- uses: actions/checkout@v4
185146
- name: Build
186147
id: build
187148
uses: cross-platform-actions/[email protected]
@@ -202,7 +163,7 @@ jobs:
202163
sudo pkg install -y -f curl node libnghttp2 npm
203164
sudo npm install -g yarn --ignore-scripts
204165
curl https://sh.rustup.rs -sSf --output rustup.sh
205-
sh rustup.sh -y --default-toolchain nightly-2023-10-25
166+
sh rustup.sh -y --default-toolchain nightly-2023-12-23
206167
source "$HOME/.cargo/env"
207168
echo "~~~~ rustc --version ~~~~"
208169
rustc --version
@@ -221,7 +182,7 @@ jobs:
221182
strip -x packages/*/*.node
222183
rm -rf node_modules
223184
rm -rf target
224-
rm -rf .yarn/cache
185+
rm -rf .yarn
225186
226187
- name: Upload artifact
227188
uses: actions/upload-artifact@v4
@@ -246,7 +207,7 @@ jobs:
246207
runs-on: ${{ matrix.settings.host }}
247208

248209
steps:
249-
- uses: actions/checkout@v3
210+
- uses: actions/checkout@v4
250211
with:
251212
submodules: true
252213

@@ -273,13 +234,7 @@ jobs:
273234
run: yarn build:ts
274235

275236
- name: Test bindings
276-
run: |
277-
yarn test packages/argon2
278-
yarn test packages/bcrypt
279-
yarn test packages/crc32
280-
yarn test packages/jieba
281-
yarn test packages/jsonwebtoken
282-
yarn test packages/xxhash
237+
run: yarn workspaces foreach -A -j 1 run test
283238

284239
test-linux-x64-gnu-binding:
285240
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
@@ -292,7 +247,7 @@ jobs:
292247
runs-on: ubuntu-latest
293248

294249
steps:
295-
- uses: actions/checkout@v3
250+
- uses: actions/checkout@v4
296251

297252
- name: Setup node
298253
uses: actions/setup-node@v4
@@ -325,8 +280,7 @@ jobs:
325280
with:
326281
image: node:${{ matrix.node }}-slim
327282
options: -v ${{ github.workspace }}:/build -w /build
328-
run: |
329-
yarn test
283+
run: yarn test -s
330284

331285
test-linux-x64-centos-7:
332286
name: Test bindings on Linux-x64-glibc-2.17
@@ -379,7 +333,7 @@ jobs:
379333
runs-on: ubuntu-latest
380334

381335
steps:
382-
- uses: actions/checkout@v3
336+
- uses: actions/checkout@v4
383337

384338
- name: Setup node
385339
uses: actions/setup-node@v4
@@ -415,7 +369,7 @@ jobs:
415369
image: node:${{ matrix.node }}-alpine
416370
options: -v ${{ github.workspace }}:/build -w /build
417371
run: |
418-
yarn test
372+
yarn test -s
419373
420374
test-linux-aarch64-gnu-binding:
421375
name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
@@ -428,7 +382,7 @@ jobs:
428382
runs-on: ubuntu-latest
429383

430384
steps:
431-
- uses: actions/checkout@v3
385+
- uses: actions/checkout@v4
432386

433387
- name: Download artifacts
434388
uses: actions/download-artifact@v4
@@ -472,10 +426,14 @@ jobs:
472426
needs:
473427
- build
474428

429+
strategy:
430+
fail-fast: false
431+
matrix:
432+
node: ['18', '20']
475433
runs-on: ubuntu-latest
476434

477435
steps:
478-
- uses: actions/checkout@v3
436+
- uses: actions/checkout@v4
479437

480438
- name: Install dependencies
481439
run: |
@@ -487,7 +445,7 @@ jobs:
487445
uses: actions/download-artifact@v4
488446
with:
489447
name: bindings-aarch64-unknown-linux-musl
490-
path: packages
448+
path: artifacts
491449

492450
- name: Move artifacts
493451
run: yarn artifacts
@@ -511,7 +469,7 @@ jobs:
511469
run: |
512470
set -e
513471
yarn build:ts
514-
yarn test
472+
yarn test -s
515473
516474
test-linux-arm-gnueabihf-binding:
517475
name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
@@ -524,7 +482,7 @@ jobs:
524482
runs-on: ubuntu-latest
525483

526484
steps:
527-
- uses: actions/checkout@v3
485+
- uses: actions/checkout@v4
528486

529487
- name: Install dependencies
530488
run: |
@@ -559,7 +517,7 @@ jobs:
559517
run: |
560518
set -e
561519
yarn build:ts
562-
yarn test
520+
yarn test -s
563521
ls -la
564522
565523
publish:
@@ -571,15 +529,16 @@ jobs:
571529
- test-linux-x64-centos-7
572530
- test-linux-x64-musl-binding
573531
- test-linux-aarch64-gnu-binding
532+
- test-linux-aarch64-musl-binding
574533
- test-linux-arm-gnueabihf-binding
575534
- test-macOS-windows-binding
576535
steps:
577-
- uses: actions/checkout@v3
536+
- uses: actions/checkout@v4
578537

579538
- name: Setup node
580539
uses: actions/setup-node@v4
581540
with:
582-
node-version: 18
541+
node-version: 20
583542
cache: yarn
584543

585544
- name: 'Install dependencies'

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install
2424
uses: dtolnay/rust-toolchain@stable
2525
with:
26-
toolchain: nightly-2023-10-25
26+
toolchain: nightly-2023-12-23
2727
components: rustfmt, clippy
2828

2929
- name: 'Install dependencies'

ava.config.js renamed to ava.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
module.exports = {
1+
export default {
22
extensions: ['ts'],
33
workerThreads: false,
4+
cache: false,
45
require: ['@swc-node/register'],
56
files: ['packages/**/*.spec.ts'],
67
timeout: '3m',

crates/alloc/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.1.0"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[target.'cfg(not(target_os = "linux"))'.dependencies]
9-
mimalloc-rust = { version = "0.2" }
9+
mimalloc = { version = "0.1" }
1010

11-
[target.'cfg(all(target_os = "linux", not(all(target_env = "musl", target_arch = "aarch64"))))'.dependencies]
12-
mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] }
11+
[target.'cfg(target_os = "linux")'.dependencies]
12+
mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }

crates/alloc/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
#[cfg(all(
2-
not(all(target_os = "linux", target_env = "musl", target_arch = "aarch64")),
3-
not(debug_assertions)
4-
))]
51
#[global_allocator]
6-
static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;
2+
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

0 commit comments

Comments
 (0)