Skip to content

Commit

Permalink
Fix windows i686
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Nov 21, 2020
1 parent 66a9b1e commit f09616f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand All @@ -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'
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
14 changes: 10 additions & 4 deletions simple-test.js
Original file line number Diff line number Diff line change
@@ -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)
})
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f09616f

Please sign in to comment.