From b9af7c8f80747311f0ee98a5c76394e7151db0b6 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 1 Jun 2021 00:48:08 +0800 Subject: [PATCH 1/2] build: support windows aarch64 binary --- .github/workflows/ci.yaml | 62 +++++++++++++++++++ packages/bcrypt/Cargo.toml | 4 +- .../bcrypt/npm/win32-arm64-msvc/README.md | 3 + .../bcrypt/npm/win32-arm64-msvc/package.json | 27 ++++++++ packages/bcrypt/package.json | 3 +- packages/bcrypt/src/lib.rs | 3 +- packages/crc32/Cargo.toml | 4 +- packages/crc32/npm/win32-arm64-msvc/README.md | 3 + .../crc32/npm/win32-arm64-msvc/package.json | 27 ++++++++ packages/crc32/package.json | 3 +- packages/crc32/src/lib.rs | 3 +- packages/deno-lint/Cargo.toml | 4 +- .../deno-lint/npm/win32-arm64-msvc/README.md | 3 + .../npm/win32-arm64-msvc/package.json | 27 ++++++++ packages/deno-lint/package.json | 3 +- packages/deno-lint/src/lib.rs | 3 +- packages/jieba/Cargo.toml | 4 +- packages/jieba/npm/win32-arm64-msvc/README.md | 3 + .../jieba/npm/win32-arm64-msvc/package.json | 27 ++++++++ packages/jieba/package.json | 3 +- packages/jieba/src/lib.rs | 3 +- 21 files changed, 206 insertions(+), 16 deletions(-) create mode 100644 packages/bcrypt/npm/win32-arm64-msvc/README.md create mode 100644 packages/bcrypt/npm/win32-arm64-msvc/package.json create mode 100644 packages/crc32/npm/win32-arm64-msvc/README.md create mode 100644 packages/crc32/npm/win32-arm64-msvc/package.json create mode 100644 packages/deno-lint/npm/win32-arm64-msvc/README.md create mode 100644 packages/deno-lint/npm/win32-arm64-msvc/package.json create mode 100644 packages/jieba/npm/win32-arm64-msvc/README.md create mode 100644 packages/jieba/npm/win32-arm64-msvc/package.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e68f7429..d5d3ac56 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -156,6 +156,67 @@ jobs: name: bindings-win32-i686 path: packages/*/*.node + build-windows-aarch64: + if: "!contains(github.event.head_commit.message, 'skip ci')" + name: stable - windows-aarch64 - node@14 + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup node + uses: actions/setup-node@v2-beta + with: + node-version: 14 + check-latest: true + + - name: Cache NPM dependencies + uses: actions/cache@v1 + with: + path: node_modules + key: npm-cache-windows-aarch64-node@lts-${{ hashFiles('yarn.lock') }} + + - name: Install dependencies + run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 + + - name: Build TypeScript + run: yarn build:ts + + - name: Install + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Install aarch64 toolchain + run: rustup target add aarch64-pc-windows-msvc + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: stable-windows-aarch64-node@lts-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: stable-windows-aarch64-node@lts-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: Run build + run: npx lerna exec "yarn build --target aarch64-pc-windows-msvc" --concurrency 1 --stream --no-prefix + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: bindings-win32-aarch64 + path: packages/*/*.node + build-musl: if: "!contains(github.event.head_commit.message, 'skip ci')" name: stable - linux-musl - node@lts @@ -718,6 +779,7 @@ jobs: - build-windows-i686 - build-linux-aarch64-musl - build-freebsd + - build-windows-aarch64 steps: - uses: actions/checkout@v2 diff --git a/packages/bcrypt/Cargo.toml b/packages/bcrypt/Cargo.toml index 41913d5f..e61c183e 100644 --- a/packages/bcrypt/Cargo.toml +++ b/packages/bcrypt/Cargo.toml @@ -19,11 +19,11 @@ rand = "0.8" [target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} -[target.'cfg(windows)'.dependencies] +[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies] mimalloc = {version = "0.1"} [dev-dependencies] quickcheck = "1.0" [build-dependencies] -napi-build = "1" +napi-build = "1.1.0-beta.0" diff --git a/packages/bcrypt/npm/win32-arm64-msvc/README.md b/packages/bcrypt/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..7a41e8cd --- /dev/null +++ b/packages/bcrypt/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@node-rs/bcrypt-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@node-rs/bcrypt` diff --git a/packages/bcrypt/npm/win32-arm64-msvc/package.json b/packages/bcrypt/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..8226c904 --- /dev/null +++ b/packages/bcrypt/npm/win32-arm64-msvc/package.json @@ -0,0 +1,27 @@ +{ + "name": "@node-rs/bcrypt-win32-arm64-msvc", + "version": "1.2.1", + "os": ["win32"], + "cpu": ["arm64"], + "main": "bcrypt.win32-arm64-msvc.node", + "files": ["bcrypt.win32-arm64-msvc.node"], + "description": "Rust bcrypt binding", + "keywords": ["bcrypt", "auth", "password", "authentication", "encryption", "crypto", "N-API", "napi-rs", "node-rs"], + "author": "LongYinan ", + "homepage": "https://github.com/napi-rs/node-rs", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/napi-rs/node-rs.git" + }, + "bugs": { + "url": "https://github.com/napi-rs/node-rs/issues" + } +} diff --git a/packages/bcrypt/package.json b/packages/bcrypt/package.json index 79a276ea..f9100ead 100644 --- a/packages/bcrypt/package.json +++ b/packages/bcrypt/package.json @@ -21,7 +21,8 @@ "aarch64-apple-darwin", "aarch64-linux-android", "x86_64-unknown-freebsd", - "aarch64-unknown-linux-musl" + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc" ] } }, diff --git a/packages/bcrypt/src/lib.rs b/packages/bcrypt/src/lib.rs index 72ed5a9b..9f62d1a0 100644 --- a/packages/bcrypt/src/lib.rs +++ b/packages/bcrypt/src/lib.rs @@ -27,8 +27,9 @@ mod verify_task; not(target_arch = "arm"), not(target_arch = "aarch64") ))] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[cfg(windows)] #[global_allocator] diff --git a/packages/crc32/Cargo.toml b/packages/crc32/Cargo.toml index 45a2120e..eff2f651 100644 --- a/packages/crc32/Cargo.toml +++ b/packages/crc32/Cargo.toml @@ -15,8 +15,8 @@ napi-derive = "1" [target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} -[target.'cfg(windows)'.dependencies] +[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies] mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1" +napi-build = "1.1.0-beta.0" diff --git a/packages/crc32/npm/win32-arm64-msvc/README.md b/packages/crc32/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..484e9c07 --- /dev/null +++ b/packages/crc32/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@node-rs/crc32-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@node-rs/crc32` diff --git a/packages/crc32/npm/win32-arm64-msvc/package.json b/packages/crc32/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..f4de80e2 --- /dev/null +++ b/packages/crc32/npm/win32-arm64-msvc/package.json @@ -0,0 +1,27 @@ +{ + "name": "@node-rs/crc32-win32-arm64-msvc", + "version": "1.1.0", + "os": ["win32"], + "cpu": ["arm64"], + "main": "crc32.win32-arm64-msvc.node", + "files": ["crc32.win32-arm64-msvc.node"], + "description": "SIMD crc32", + "keywords": ["SIMD", "NAPI", "napi-rs", "node-rs", "crc32", "crc32c"], + "author": "LongYinan ", + "homepage": "https://github.com/napi-rs/node-rs", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/napi-rs/node-rs.git" + }, + "bugs": { + "url": "https://github.com/napi-rs/node-rs/issues" + } +} diff --git a/packages/crc32/package.json b/packages/crc32/package.json index 38b7edfd..5aa6d07d 100644 --- a/packages/crc32/package.json +++ b/packages/crc32/package.json @@ -21,7 +21,8 @@ "aarch64-apple-darwin", "aarch64-linux-android", "x86_64-unknown-freebsd", - "aarch64-unknown-linux-musl" + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc" ] } }, diff --git a/packages/crc32/src/lib.rs b/packages/crc32/src/lib.rs index 65455eb4..529f0b75 100644 --- a/packages/crc32/src/lib.rs +++ b/packages/crc32/src/lib.rs @@ -15,8 +15,9 @@ use std::convert::TryInto; not(target_arch = "arm"), not(target_arch = "aarch64") ))] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[cfg(windows)] #[global_allocator] diff --git a/packages/deno-lint/Cargo.toml b/packages/deno-lint/Cargo.toml index a0ec5cea..34feb8a7 100644 --- a/packages/deno-lint/Cargo.toml +++ b/packages/deno-lint/Cargo.toml @@ -20,8 +20,8 @@ termcolor = "1.1" [target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} -[target.'cfg(windows)'.dependencies] +[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies] mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1" +napi-build = "1.1.0-beta.0" diff --git a/packages/deno-lint/npm/win32-arm64-msvc/README.md b/packages/deno-lint/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..7c3e6769 --- /dev/null +++ b/packages/deno-lint/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@node-rs/deno-lint-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@node-rs/deno-lint` diff --git a/packages/deno-lint/npm/win32-arm64-msvc/package.json b/packages/deno-lint/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..5262c2db --- /dev/null +++ b/packages/deno-lint/npm/win32-arm64-msvc/package.json @@ -0,0 +1,27 @@ +{ + "name": "@node-rs/deno-lint-win32-arm64-msvc", + "version": "1.1.0", + "os": ["win32"], + "cpu": ["arm64"], + "main": "deno-lint.win32-arm64-msvc.node", + "files": ["deno-lint.win32-arm64-msvc.node"], + "description": "Deno lint binding for Node.js", + "keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"], + "author": "LongYinan ", + "homepage": "https://github.com/napi-rs/node-rs", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/napi-rs/node-rs.git" + }, + "bugs": { + "url": "https://github.com/napi-rs/node-rs/issues" + } +} diff --git a/packages/deno-lint/package.json b/packages/deno-lint/package.json index 5d4aeb23..e1c8b96b 100644 --- a/packages/deno-lint/package.json +++ b/packages/deno-lint/package.json @@ -24,7 +24,8 @@ "aarch64-apple-darwin", "aarch64-linux-android", "x86_64-unknown-freebsd", - "aarch64-unknown-linux-musl" + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc" ] } }, diff --git a/packages/deno-lint/src/lib.rs b/packages/deno-lint/src/lib.rs index fe99692e..6c79c1bb 100644 --- a/packages/deno-lint/src/lib.rs +++ b/packages/deno-lint/src/lib.rs @@ -31,8 +31,9 @@ use termcolor::{BufferWriter, ColorChoice}; not(target_arch = "arm"), not(target_arch = "aarch64") ))] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[cfg(windows)] #[global_allocator] diff --git a/packages/jieba/Cargo.toml b/packages/jieba/Cargo.toml index 804cb371..965f1f04 100644 --- a/packages/jieba/Cargo.toml +++ b/packages/jieba/Cargo.toml @@ -16,8 +16,8 @@ once_cell = "1.5" [target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} -[target.'cfg(windows)'.dependencies] +[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies] mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1" +napi-build = "1.1.0-beta.0" diff --git a/packages/jieba/npm/win32-arm64-msvc/README.md b/packages/jieba/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..f7167ba2 --- /dev/null +++ b/packages/jieba/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@node-rs/jieba-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@node-rs/jieba` diff --git a/packages/jieba/npm/win32-arm64-msvc/package.json b/packages/jieba/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..8b5b36d8 --- /dev/null +++ b/packages/jieba/npm/win32-arm64-msvc/package.json @@ -0,0 +1,27 @@ +{ + "name": "@node-rs/jieba-win32-arm64-msvc", + "version": "1.1.0", + "os": ["win32"], + "cpu": ["arm64"], + "main": "jieba.win32-arm64-msvc.node", + "files": ["jieba.win32-arm64-msvc.node"], + "description": "Fastest Chinese word segmentation in Node.js", + "keywords": ["Jieba", "Rust", "node-rs", "napi", "napi-rs", "N-API"], + "author": "LongYinan ", + "homepage": "https://github.com/napi-rs/node-rs", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/napi-rs/node-rs.git" + }, + "bugs": { + "url": "https://github.com/napi-rs/node-rs/issues" + } +} diff --git a/packages/jieba/package.json b/packages/jieba/package.json index e0217bba..4ba255ae 100644 --- a/packages/jieba/package.json +++ b/packages/jieba/package.json @@ -21,7 +21,8 @@ "aarch64-apple-darwin", "aarch64-linux-android", "x86_64-unknown-freebsd", - "aarch64-unknown-linux-musl" + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc" ] } }, diff --git a/packages/jieba/src/lib.rs b/packages/jieba/src/lib.rs index 696583f2..4b4802f2 100644 --- a/packages/jieba/src/lib.rs +++ b/packages/jieba/src/lib.rs @@ -20,8 +20,9 @@ use once_cell::sync::OnceCell; not(target_arch = "arm"), not(target_arch = "aarch64") ))] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[cfg(windows)] #[global_allocator] From 9fc0ea1e3b3dcdba35152bf7a21aa250f94ee951 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 1 Jun 2021 00:51:19 +0800 Subject: [PATCH 2/2] doc: update support matrix --- README.md | 25 ++++++++++++++----------- packages/bcrypt/Cargo.toml | 2 +- packages/bcrypt/README.md | 25 ++++++++++++++----------- packages/bcrypt/src/lib.rs | 5 ++--- packages/crc32/Cargo.toml | 2 +- packages/crc32/README.md | 25 ++++++++++++++----------- packages/crc32/src/lib.rs | 5 ++--- packages/deno-lint/Cargo.toml | 2 +- packages/deno-lint/README.md | 25 ++++++++++++++----------- packages/deno-lint/src/lib.rs | 5 ++--- packages/jieba/Cargo.toml | 2 +- packages/jieba/README.md | 25 ++++++++++++++----------- packages/jieba/src/lib.rs | 5 ++--- 13 files changed, 82 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 928b0f54..da2dc972 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,20 @@ Make rust crates binding to Node.js use [napi-rs](https://github.com/napi-rs/nap # Support matrix -| | node10 | node12 | node14 | node15 | -| --------------- | ------ | ------ | ------ | ------ | -| Windows x64 | ✓ | ✓ | ✓ | ✓ | -| Windows x32 | ✓ | ✓ | ✓ | ✓ | -| macOS x64 | ✓ | ✓ | ✓ | ✓ | -| macOS arm64 | ✓ | ✓ | ✓ | ✓ | -| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | -| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | -| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | -| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | -| Android arm64 | ✓ | ✓ | ✓ | ✓ | +| | node12 | node14 | node16 | +| ---------------- | ------ | ------ | ------ | +| Windows x64 | ✓ | ✓ | ✓ | +| Windows x32 | ✓ | ✓ | ✓ | +| Windows arm64 | ✓ | ✓ | ✓ | +| macOS x64 | ✓ | ✓ | ✓ | +| macOS arm64 | ✓ | ✓ | ✓ | +| Linux x64 gnu | ✓ | ✓ | ✓ | +| Linux x64 musl | ✓ | ✓ | ✓ | +| Linux arm gnu | ✓ | ✓ | ✓ | +| Linux arm64 gnu | ✓ | ✓ | ✓ | +| Linux arm64 musl | ✓ | ✓ | ✓ | +| Android arm64 | ✓ | ✓ | ✓ | +| FreeBSD x64 | ✓ | ✓ | ✓ | # Packages diff --git a/packages/bcrypt/Cargo.toml b/packages/bcrypt/Cargo.toml index e61c183e..62cfaf08 100644 --- a/packages/bcrypt/Cargo.toml +++ b/packages/bcrypt/Cargo.toml @@ -26,4 +26,4 @@ mimalloc = {version = "0.1"} quickcheck = "1.0" [build-dependencies] -napi-build = "1.1.0-beta.0" +napi-build = "1.1.0" diff --git a/packages/bcrypt/README.md b/packages/bcrypt/README.md index 39624592..774ad9e6 100644 --- a/packages/bcrypt/README.md +++ b/packages/bcrypt/README.md @@ -7,17 +7,20 @@ ## Support matrix -| | node10 | node12 | node14 | node15 | -| --------------- | ------ | ------ | ------ | ------ | -| Windows x64 | ✓ | ✓ | ✓ | ✓ | -| Windows x32 | ✓ | ✓ | ✓ | ✓ | -| macOS x64 | ✓ | ✓ | ✓ | ✓ | -| macOS arm64 | ✓ | ✓ | ✓ | ✓ | -| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | -| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | -| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | -| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | -| Android arm64 | ✓ | ✓ | ✓ | ✓ | +| | node12 | node14 | node16 | +| ---------------- | ------ | ------ | ------ | +| Windows x64 | ✓ | ✓ | ✓ | +| Windows x32 | ✓ | ✓ | ✓ | +| Windows arm64 | ✓ | ✓ | ✓ | +| macOS x64 | ✓ | ✓ | ✓ | +| macOS arm64 | ✓ | ✓ | ✓ | +| Linux x64 gnu | ✓ | ✓ | ✓ | +| Linux x64 musl | ✓ | ✓ | ✓ | +| Linux arm gnu | ✓ | ✓ | ✓ | +| Linux arm64 gnu | ✓ | ✓ | ✓ | +| Linux arm64 musl | ✓ | ✓ | ✓ | +| Android arm64 | ✓ | ✓ | ✓ | +| FreeBSD x64 | ✓ | ✓ | ✓ | ## Usage diff --git a/packages/bcrypt/src/lib.rs b/packages/bcrypt/src/lib.rs index 9f62d1a0..95e6c0d4 100644 --- a/packages/bcrypt/src/lib.rs +++ b/packages/bcrypt/src/lib.rs @@ -27,11 +27,10 @@ mod verify_task; not(target_arch = "arm"), not(target_arch = "aarch64") ))] -#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[cfg(windows)] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/packages/crc32/Cargo.toml b/packages/crc32/Cargo.toml index eff2f651..a4925a0f 100644 --- a/packages/crc32/Cargo.toml +++ b/packages/crc32/Cargo.toml @@ -19,4 +19,4 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1.1.0-beta.0" +napi-build = "1.1.0" diff --git a/packages/crc32/README.md b/packages/crc32/README.md index f8397344..41fbd85d 100644 --- a/packages/crc32/README.md +++ b/packages/crc32/README.md @@ -42,17 +42,20 @@ js_crc32 for inputs 16931844B, avg 2066B x 22.12 ops/sec ±5.20% (40 runs sample ## Support matrix -| | node10 | node12 | node14 | node15 | -| --------------- | ------ | ------ | ------ | ------ | -| Windows x64 | ✓ | ✓ | ✓ | ✓ | -| Windows x32 | ✓ | ✓ | ✓ | ✓ | -| macOS x64 | ✓ | ✓ | ✓ | ✓ | -| macOS arm64 | ✓ | ✓ | ✓ | ✓ | -| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | -| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | -| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | -| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | -| Android arm64 | ✓ | ✓ | ✓ | ✓ | +| | node12 | node14 | node16 | +| ---------------- | ------ | ------ | ------ | +| Windows x64 | ✓ | ✓ | ✓ | +| Windows x32 | ✓ | ✓ | ✓ | +| Windows arm64 | ✓ | ✓ | ✓ | +| macOS x64 | ✓ | ✓ | ✓ | +| macOS arm64 | ✓ | ✓ | ✓ | +| Linux x64 gnu | ✓ | ✓ | ✓ | +| Linux x64 musl | ✓ | ✓ | ✓ | +| Linux arm gnu | ✓ | ✓ | ✓ | +| Linux arm64 gnu | ✓ | ✓ | ✓ | +| Linux arm64 musl | ✓ | ✓ | ✓ | +| Android arm64 | ✓ | ✓ | ✓ | +| FreeBSD x64 | ✓ | ✓ | ✓ | ## API diff --git a/packages/crc32/src/lib.rs b/packages/crc32/src/lib.rs index 529f0b75..44fe7b35 100644 --- a/packages/crc32/src/lib.rs +++ b/packages/crc32/src/lib.rs @@ -15,11 +15,10 @@ use std::convert::TryInto; not(target_arch = "arm"), not(target_arch = "aarch64") ))] -#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[cfg(windows)] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/packages/deno-lint/Cargo.toml b/packages/deno-lint/Cargo.toml index 34feb8a7..d0ee82fe 100644 --- a/packages/deno-lint/Cargo.toml +++ b/packages/deno-lint/Cargo.toml @@ -24,4 +24,4 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1.1.0-beta.0" +napi-build = "1.1.0" diff --git a/packages/deno-lint/README.md b/packages/deno-lint/README.md index 65241607..b148f2ad 100644 --- a/packages/deno-lint/README.md +++ b/packages/deno-lint/README.md @@ -7,17 +7,20 @@ ## Support matrix -| | node10 | node12 | node14 | node15 | -| --------------- | ------ | ------ | ------ | ------ | -| Windows x64 | ✓ | ✓ | ✓ | ✓ | -| Windows x32 | ✓ | ✓ | ✓ | ✓ | -| macOS x64 | ✓ | ✓ | ✓ | ✓ | -| macOS arm64 | ✓ | ✓ | ✓ | ✓ | -| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | -| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | -| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | -| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | -| Android arm64 | ✓ | ✓ | ✓ | ✓ | +| | node12 | node14 | node16 | +| ---------------- | ------ | ------ | ------ | +| Windows x64 | ✓ | ✓ | ✓ | +| Windows x32 | ✓ | ✓ | ✓ | +| Windows arm64 | ✓ | ✓ | ✓ | +| macOS x64 | ✓ | ✓ | ✓ | +| macOS arm64 | ✓ | ✓ | ✓ | +| Linux x64 gnu | ✓ | ✓ | ✓ | +| Linux x64 musl | ✓ | ✓ | ✓ | +| Linux arm gnu | ✓ | ✓ | ✓ | +| Linux arm64 gnu | ✓ | ✓ | ✓ | +| Linux arm64 musl | ✓ | ✓ | ✓ | +| Android arm64 | ✓ | ✓ | ✓ | +| FreeBSD x64 | ✓ | ✓ | ✓ | ## Performance diff --git a/packages/deno-lint/src/lib.rs b/packages/deno-lint/src/lib.rs index 6c79c1bb..fc26509d 100644 --- a/packages/deno-lint/src/lib.rs +++ b/packages/deno-lint/src/lib.rs @@ -31,11 +31,10 @@ use termcolor::{BufferWriter, ColorChoice}; not(target_arch = "arm"), not(target_arch = "aarch64") ))] -#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[cfg(windows)] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/packages/jieba/Cargo.toml b/packages/jieba/Cargo.toml index 965f1f04..47714045 100644 --- a/packages/jieba/Cargo.toml +++ b/packages/jieba/Cargo.toml @@ -20,4 +20,4 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc = {version = "0.1"} [build-dependencies] -napi-build = "1.1.0-beta.0" +napi-build = "1.1.0" diff --git a/packages/jieba/README.md b/packages/jieba/README.md index b3e90c39..3c34aa4d 100644 --- a/packages/jieba/README.md +++ b/packages/jieba/README.md @@ -33,17 +33,20 @@ Tag 246568 words bench suite: Fastest is @node-rs/jieba ## Support matrix -| | node10 | node12 | node14 | node15 | -| --------------- | ------ | ------ | ------ | ------ | -| Windows x64 | ✓ | ✓ | ✓ | ✓ | -| Windows x32 | ✓ | ✓ | ✓ | ✓ | -| macOS x64 | ✓ | ✓ | ✓ | ✓ | -| macOS arm64 | ✓ | ✓ | ✓ | ✓ | -| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | -| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | -| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | -| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | -| Android arm64 | ✓ | ✓ | ✓ | ✓ | +| | node12 | node14 | node16 | +| ---------------- | ------ | ------ | ------ | +| Windows x64 | ✓ | ✓ | ✓ | +| Windows x32 | ✓ | ✓ | ✓ | +| Windows arm64 | ✓ | ✓ | ✓ | +| macOS x64 | ✓ | ✓ | ✓ | +| macOS arm64 | ✓ | ✓ | ✓ | +| Linux x64 gnu | ✓ | ✓ | ✓ | +| Linux x64 musl | ✓ | ✓ | ✓ | +| Linux arm gnu | ✓ | ✓ | ✓ | +| Linux arm64 gnu | ✓ | ✓ | ✓ | +| Linux arm64 musl | ✓ | ✓ | ✓ | +| Android arm64 | ✓ | ✓ | ✓ | +| FreeBSD x64 | ✓ | ✓ | ✓ | ## Usage diff --git a/packages/jieba/src/lib.rs b/packages/jieba/src/lib.rs index 4b4802f2..0e59412c 100644 --- a/packages/jieba/src/lib.rs +++ b/packages/jieba/src/lib.rs @@ -20,11 +20,10 @@ use once_cell::sync::OnceCell; not(target_arch = "arm"), not(target_arch = "aarch64") ))] -#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] -static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[cfg(windows)] +#[cfg(all(windows, not(target_arch = "aarch64")))] #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;