Skip to content

Commit f08434e

Browse files
committed
fixup! doc,test: add documentation and test on how to use addons in SEA
1 parent da4160e commit f08434e

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

β€Ždoc/api/single-executable-applications.mdβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ console.log(myaddon.exports);
508508
fs.rmSync(addonPath);
509509
```
510510
511+
Known caveat: if the single-executable application is produced by postject running on a Linux arm64 docker container,
512+
[the produced ELF binary does not have the correct hash table to load the addons][postject-linux-arm64-issue] and
513+
will crash on `process.dlopen()`. Build the single-executable application on other platforms, or at least on
514+
a non-container Linux arm64 environment to work around this issue.
515+
511516
## Notes
512517
513518
### Single executable application creation process
@@ -560,6 +565,7 @@ to help us document them.
560565
[documentation about startup snapshot support in Node.js]: cli.md#--build-snapshot
561566
[fuse]: https://www.electronjs.org/docs/latest/tutorial/fuses
562567
[postject]: https://github.com/nodejs/postject
568+
[postject-linux-arm64-issue]: https://github.com/nodejs/postject/issues/105
563569
[signtool]: https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool
564570
[single executable applications]: https://github.com/nodejs/single-executable
565571
[supported by Node.js]: https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list

β€Žtest/node-api/node-api.statusβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ test_fatal/test_threads_report: PASS,FLAKY
1616
[$system==linux && $arch==ppc64]
1717
# https://github.com/nodejs/node/issues/59561
1818
test_sea_addon/test: SKIP
19+
20+
[$system==linux && $arch==arm]
21+
# https://github.com/nodejs/postject/issues/105
22+
test_sea_addon/test: SKIP

β€Žtest/node-api/sea_addonβ€Ž

Whitespace-only changes.

β€Žtest/node-api/test_sea_addon/test.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const sea = require('node:sea');
2929
const fs = require('fs');
3030
const path = require('path');
3131
32-
const addonPath = path.join(process.cwd(), 'hello.node');
32+
const addonPath = path.join(${JSON.stringify(tmpdir.path)}, 'hello.node');
3333
fs.writeFileSync(addonPath, new Uint8Array(sea.getRawAsset('hello.node')));
3434
const mod = {exports: {}}
3535
process.dlopen(mod, addonPath);

0 commit comments

Comments
Β (0)