Skip to content

Commit 321380e

Browse files
committed
Fix windows i686
1 parent fded8fe commit 321380e

File tree

4 files changed

+19
-44
lines changed

4 files changed

+19
-44
lines changed

.github/workflows/CI.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ jobs:
186186
name: bindings-linux-aarch64
187187
path: ${{ env.APP_NAME }}.*.node
188188

189-
build-win32-ia686:
189+
build-win32-i686:
190190
runs-on: windows-latest
191+
env:
192+
CARGO_PROFILE_RELEASE_OPT_LEVEL: 1
191193
steps:
192194
- uses: actions/checkout@v2
193195

@@ -243,9 +245,7 @@ jobs:
243245
run: yarn build --target i686-pc-windows-msvc
244246

245247
- name: Test binary
246-
run: |
247-
node -v
248-
node simple-test.js
248+
run: yarn test
249249

250250
- name: Upload artifact
251251
uses: actions/upload-artifact@v2

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 = "rust-codegen-win32"}
14-
napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
13+
napi = {git = "https://github.com/napi-rs/napi-rs"}
14+
napi-derive = {git = "https://github.com/napi-rs/napi-rs"}
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 = "rust-codegen-win32"}
23+
napi-build = {git = "https://github.com/napi-rs/napi-rs"}
2424

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

package.json

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@
55
"main": "index.js",
66
"repository": "git@github.com:napi-rs/package-template.git",
77
"license": "MIT",
8-
"keywords": [
9-
"napi-rs",
10-
"NAPI",
11-
"N-API",
12-
"Rust",
13-
"node-addon",
14-
"node-addon-api"
15-
],
16-
"files": [
17-
"index.d.ts",
18-
"index.js"
19-
],
8+
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
9+
"files": ["index.d.ts", "index.js"],
2010
"napi": {
2111
"name": "package-template",
2212
"triples": {
@@ -75,27 +65,14 @@
7565
"@node-rs/helper": "^1.0.0-alpha.1"
7666
},
7767
"lint-staged": {
78-
"*.@(js|ts|tsx)": [
79-
"prettier --write",
80-
"eslint -c .eslintrc.yml --fix"
81-
],
82-
"*.@(yml|yaml)": [
83-
"prettier --parser yaml --write"
84-
],
85-
"*.md": [
86-
"prettier --parser markdown --write"
87-
],
88-
"*.json": [
89-
"prettier --parser json --write"
90-
]
68+
"*.@(js|ts|tsx)": ["prettier --write", "eslint -c .eslintrc.yml --fix"],
69+
"*.@(yml|yaml)": ["prettier --parser yaml --write"],
70+
"*.md": ["prettier --parser markdown --write"],
71+
"*.json": ["prettier --parser json --write"]
9172
},
9273
"ava": {
93-
"require": [
94-
"ts-node/register/transpile-only"
95-
],
96-
"extensions": [
97-
"ts"
98-
],
74+
"require": ["ts-node/register/transpile-only"],
75+
"extensions": ["ts"],
9976
"environmentVariables": {
10077
"TS_NODE_PROJECT": "./tsconfig.json"
10178
}
@@ -113,4 +90,4 @@
11390
"pre-commit": "lint-staged"
11491
}
11592
}
116-
}
93+
}

simple-test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const { exec } = require('child_process')
2-
const { stderr } = require('process')
32

43
exec(`node -e "console.log(require('./index.js'))"`, (err, stdout, stderr) => {
4+
console.info(stdout)
5+
console.info(stderr)
56
if (err) {
6-
console.error(err)
77
process.exit(1)
88
}
9-
console.info(stdout)
10-
console.info(stderr)
119
})

0 commit comments

Comments
 (0)