Skip to content

Commit f09616f

Browse files
committed
Fix windows i686
1 parent 66a9b1e commit f09616f

5 files changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/CI.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ jobs:
188188

189189
build-win32-ia686:
190190
runs-on: windows-latest
191-
env:
192-
CARGO_PROFILE_napi_OPT_LEVEL: 0
193-
CARGO_PROFILE_napi_OPT_LTO: false
194191
steps:
195192
- uses: actions/checkout@v2
196193

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ version = "0.1.0"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
napi = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"}
14-
napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"}
13+
napi = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
14+
napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
1515

1616
[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
1717
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
@@ -20,7 +20,7 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
2020
mimalloc = {version = "0.1"}
2121

2222
[build-dependencies]
23-
napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "cstring-issues"}
23+
napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
2424

2525
[profile.release]
26-
lto = true
26+
opt-level = 's'

npm/win32-x64-msvc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
1010
"license": "MIT",
1111
"engines": {
12-
"node": ">= 8.9"
12+
"node": ">= 10"
1313
},
1414
"publishConfig": {
1515
"registry": "https://registry.npmjs.org/",

simple-test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
const { sync } = require('./index')
1+
const { exec } = require('child_process')
2+
const { stderr } = require('process')
23

3-
console.assert(sync(0) === 100, 'Simple test failed')
4-
5-
console.info('Simple test passed')
4+
exec(`node -e "console.log(require('./index.js'))"`, (err, stdout, stderr) => {
5+
if (err) {
6+
console.error(err)
7+
process.exit(1)
8+
}
9+
console.info(stdout)
10+
console.info(stderr)
11+
})

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use napi::{CallContext, Env, JsNumber, JsObject, Module, Result, Task};
1111
#[global_allocator]
1212
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
1313

14-
#[cfg(all(windows, target_arch = "x86_64"))]
14+
#[cfg(windows)]
1515
#[global_allocator]
1616
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
1717

0 commit comments

Comments
 (0)