Skip to content

Commit 8a57182

Browse files
RaisinTentargos
authored andcommitted
doc,test: extend the list of platforms supported by single-executables
Now that #46934 has landed, we can extend the list of platforms and architectures where we can run the single-executable test. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #47026 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 67fe7d8 commit 8a57182

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

doc/api/single-executable-applications.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ platforms:
159159

160160
* Windows
161161
* macOS
162-
* Linux (AMD64 only)
162+
* Linux (all distributions [supported by Node.js][] except Alpine and all
163+
architectures [supported by Node.js][] except s390x and ppc64)
163164

164165
This is due to a lack of better tools to generate single-executables that can be
165166
used to test this feature on other platforms.
@@ -180,3 +181,4 @@ to help us document them.
180181
[postject]: https://github.com/nodejs/postject
181182
[signtool]: https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool
182183
[single executable applications]: https://github.com/nodejs/single-executable
184+
[supported by Node.js]: https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list

doc/contributing/maintaining/maintaining-single-executable-application-support.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ for the following features are in the list of work we'd like to get to:
5454
* Running an archive of multiple files.
5555
* Embedding [Node.js CLI options][] into the binary.
5656
* [XCOFF][] executable format.
57-
* Run tests on Linux architectures/distributions other than AMD64 Ubuntu.
57+
* Run tests on Alpine Linux.
58+
* Run tests on s390x Linux.
59+
* Run tests on ppc64 Linux.
5860

5961
## Disabling single executable application support
6062

test/parallel/test-single-executable-application.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ if (!process.config.variables.single_executable_application)
1616
if (!['darwin', 'win32', 'linux'].includes(process.platform))
1717
common.skip(`Unsupported platform ${process.platform}.`);
1818

19+
if (process.platform === 'linux' && process.config.variables.asan) {
20+
// Source of the memory leak - https://github.com/nodejs/node/blob/da0bc6db98cef98686122ea1e2cd2dbd2f52d123/src/node_sea.cc#L94.
21+
common.skip('Running the resultant binary fails because of a memory leak ASAN error.');
22+
}
23+
1924
if (process.platform === 'linux' && process.config.variables.is_debug === 1)
2025
common.skip('Running the resultant binary fails with `Couldn\'t read target executable"`.');
2126

@@ -36,17 +41,16 @@ if (process.config.variables.want_separate_host_toolset !== 0)
3641
common.skip('Running the resultant binary fails with `Segmentation fault (core dumped)`.');
3742

3843
if (process.platform === 'linux') {
39-
try {
40-
const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' });
41-
if (!/^NAME="Ubuntu"/m.test(osReleaseText)) {
42-
throw new Error('Not Ubuntu.');
43-
}
44-
} catch {
45-
common.skip('Only supported Linux distribution is Ubuntu.');
44+
const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' });
45+
const isAlpine = /^NAME="Alpine Linux"/m.test(osReleaseText);
46+
if (isAlpine) common.skip('Alpine Linux is not supported.');
47+
48+
if (process.arch === 's390x') {
49+
common.skip('On s390x, postject fails with `memory access out of bounds`.');
4650
}
4751

48-
if (process.arch !== 'x64') {
49-
common.skip(`Unsupported architecture for Linux - ${process.arch}.`);
52+
if (process.arch === 'ppc64') {
53+
common.skip('On ppc64, this test times out.');
5054
}
5155
}
5256

0 commit comments

Comments
 (0)