Skip to content

Commit e5f048e

Browse files
authored
build: remove support for i686 & arm windows builds (#5108)
1 parent 9ee0633 commit e5f048e

File tree

11 files changed

+58
-88
lines changed

11 files changed

+58
-88
lines changed

.changeset/silver-sheep-exist.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nomicfoundation/edr": patch
3+
---
4+
5+
Removed i686 & ARM builds of EDR

.github/workflows/edr-npm-release.yml

-20
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ jobs:
3737
- host: windows-latest
3838
build: pnpm build
3939
target: x86_64-pc-windows-msvc
40-
- host: windows-latest
41-
build: |
42-
pnpm build --target i686-pc-windows-msvc
43-
pnpm testNoBuild
44-
target: i686-pc-windows-msvc
4540
- host: ubuntu-latest
4641
target: x86_64-unknown-linux-gnu
4742
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:4b2638c0987845c4ab3488574a215a2a866b99fb28588788786f2b8cbcb40e71
@@ -85,9 +80,6 @@ jobs:
8580
rustup target add aarch64-unknown-linux-musl &&
8681
pnpm run build --target aarch64-unknown-linux-musl &&
8782
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
88-
- host: windows-latest
89-
target: aarch64-pc-windows-msvc
90-
build: pnpm build --target aarch64-pc-windows-msvc
9183
name: stable - ${{ matrix.settings.target }} - node@18
9284
runs-on: ${{ matrix.settings.host }}
9385
defaults:
@@ -131,20 +123,8 @@ jobs:
131123
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
132124
with:
133125
version: 0.10.1
134-
- name: Setup node x86
135-
if: matrix.settings.target == 'i686-pc-windows-msvc'
136-
run: pnpm config set supportedArchitectures.cpu "ia32"
137-
shell: bash
138126
- name: Install dependencies
139127
run: pnpm install --frozen-lockfile --prefer-offline
140-
- name: Setup node x86
141-
uses: actions/setup-node@v3
142-
if: matrix.settings.target == 'i686-pc-windows-msvc'
143-
with:
144-
node-version: 18
145-
check-latest: true
146-
cache: pnpm
147-
architecture: x86
148128
- name: Build in docker
149129
uses: addnab/docker-run-action@v3
150130
if: ${{ matrix.settings.docker }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
First, install `@napi-rs/cli`:
2+
3+
```bash
4+
npm -g i @napi-rs/cli
5+
```
6+
7+
Then follow the steps in [this document](https://napi.rs/docs/introduction/simple-package) to generate a package with the desired supported target triples.
8+
9+
You will be prompted for several inputs.
10+
Use the package name `@nomicfoundation/edr` and select the desired target triples.
11+
12+
Once done, replace the `napi.triples.additional` entries in `crates/edr_napi/package.json` with the values in the generated `package.json` and replace `crates/edr_napi/npm` with the generated `npm` folder.
13+
14+
Ensure that the `version` field of all `npm/*/package.json` files is set to the latest release and `engines.node` to the minimum supported version.
15+
16+
Finally, to update the `index.js`, run:
17+
18+
```bash
19+
cd crates/edr_napi &&
20+
pnpm build
21+
```

book/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Tools](02_development/01_tools.md)
1212
- [Verdaccio](02_development/02_verdaccio.md)
1313
- [Local release](02_development/03_local_release.md)
14+
- [Update N-API targets](02_development/04_update_napi_targets.md)
1415

1516
- [Release](./03_release.md)
1617

crates/edr_napi/index.js

+25-10
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,32 @@ switch (platform) {
224224
}
225225
break
226226
case 'arm':
227-
localFileExisted = existsSync(
228-
join(__dirname, 'edr.linux-arm-gnueabihf.node')
229-
)
230-
try {
231-
if (localFileExisted) {
232-
nativeBinding = require('./edr.linux-arm-gnueabihf.node')
233-
} else {
234-
nativeBinding = require('@nomicfoundation/edr-linux-arm-gnueabihf')
227+
if (isMusl()) {
228+
localFileExisted = existsSync(
229+
join(__dirname, 'edr.linux-arm-musleabihf.node')
230+
)
231+
try {
232+
if (localFileExisted) {
233+
nativeBinding = require('./edr.linux-arm-musleabihf.node')
234+
} else {
235+
nativeBinding = require('@nomicfoundation/edr-linux-arm-musleabihf')
236+
}
237+
} catch (e) {
238+
loadError = e
239+
}
240+
} else {
241+
localFileExisted = existsSync(
242+
join(__dirname, 'edr.linux-arm-gnueabihf.node')
243+
)
244+
try {
245+
if (localFileExisted) {
246+
nativeBinding = require('./edr.linux-arm-gnueabihf.node')
247+
} else {
248+
nativeBinding = require('@nomicfoundation/edr-linux-arm-gnueabihf')
249+
}
250+
} catch (e) {
251+
loadError = e
235252
}
236-
} catch (e) {
237-
loadError = e
238253
}
239254
break
240255
case 'riscv64':

crates/edr_napi/npm/win32-arm64-msvc/README.md

-3
This file was deleted.

crates/edr_napi/npm/win32-arm64-msvc/package.json

-22
This file was deleted.

crates/edr_napi/npm/win32-ia32-msvc/README.md

-3
This file was deleted.

crates/edr_napi/npm/win32-ia32-msvc/package.json

-22
This file was deleted.

crates/edr_napi/package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919
"triples": {
2020
"additional": [
2121
"aarch64-apple-darwin",
22-
"aarch64-pc-windows-msvc",
2322
"aarch64-unknown-linux-gnu",
2423
"aarch64-unknown-linux-musl",
25-
"x86_64-unknown-linux-musl",
26-
"i686-pc-windows-msvc"
24+
"x86_64-unknown-linux-musl"
2725
]
2826
}
2927
},
3028
"license": "MIT",
3129
"devDependencies": {
32-
"@napi-rs/cli": "^2.16.3",
30+
"@napi-rs/cli": "^2.18.1",
3331
"@types/chai": "^4.2.0",
3432
"@types/chai-as-promised": "^7.1.8",
3533
"@types/mocha": ">=9.1.0",

pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)