diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8d86b35..8458303 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -188,9 +188,6 @@ jobs: build-win32-ia686: runs-on: windows-latest - env: - CARGO_PROFILE_napi_OPT_LEVEL: 0 - CARGO_PROFILE_napi_OPT_LTO: false steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 373d2f2..45f21a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -napi = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"} -napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"} +napi = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} +napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} [target.'cfg(all(unix, not(target_env = "musl")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} @@ -20,7 +20,7 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc = {version = "0.1"} [build-dependencies] -napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"} +napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} [profile.release] -lto = true +opt-level = 's' diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json index 1291db6..816296e 100644 --- a/npm/win32-x64-msvc/package.json +++ b/npm/win32-x64-msvc/package.json @@ -9,7 +9,7 @@ "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "license": "MIT", "engines": { - "node": ">= 8.9" + "node": ">= 10" }, "publishConfig": { "registry": "https://registry.npmjs.org/", diff --git a/simple-test.js b/simple-test.js index 2937210..ee29c87 100644 --- a/simple-test.js +++ b/simple-test.js @@ -1,5 +1,11 @@ -const { sync } = require('./index') +const { exec } = require('child_process') +const { stderr } = require('process') -console.assert(sync(0) === 100, 'Simple test failed') - -console.info('Simple test passed') +exec(`node -e "console.log(require('./index.js'))"`, (err, stdout, stderr) => { + if (err) { + console.error(err) + process.exit(1) + } + console.info(stdout) + console.info(stderr) +}) diff --git a/src/lib.rs b/src/lib.rs index d169350..19ea8cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ use napi::{CallContext, Env, JsNumber, JsObject, Module, Result, Task}; #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[cfg(all(windows, target_arch = "x86_64"))] +#[cfg(windows)] #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;