summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Sen <raisinten@gmail.com>2023-03-11 14:28:52 +0530
committerMichaƫl Zasso <targos@protonmail.com>2023-03-14 07:54:12 +0100
commit458671daebfdb62440acde5dc37e85a8ef2079e2 (patch)
treec1acf9960f3348ea5cd9d3bdeb5ebe48aededdf1
parent0f1ecbccca43a75bea837ffbc77ae68a371f0951 (diff)
downloadnode-new-458671daebfdb62440acde5dc37e85a8ef2079e2.tar.gz
doc,test: extend the list of platforms supported by single-executables
Now that https://github.com/nodejs/node/pull/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: https://github.com/nodejs/node/pull/47026 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
-rw-r--r--doc/api/single-executable-applications.md4
-rw-r--r--doc/contributing/maintaining-single-executable-application-support.md4
-rw-r--r--test/parallel/test-single-executable-application.js23
3 files changed, 18 insertions, 13 deletions
diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md
index fb69681a12..1af2d4dbdd 100644
--- a/doc/api/single-executable-applications.md
+++ b/doc/api/single-executable-applications.md
@@ -153,7 +153,8 @@ platforms:
* Windows
* macOS
-* Linux (AMD64 only)
+* Linux (all distributions [supported by Node.js][] except Alpine and all
+ architectures [supported by Node.js][] except s390x and ppc64)
This is due to a lack of better tools to generate single-executables that can be
used to test this feature on other platforms.
@@ -174,3 +175,4 @@ to help us document them.
[postject]: https://github.com/nodejs/postject
[signtool]: https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool
[single executable applications]: https://github.com/nodejs/single-executable
+[supported by Node.js]: https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list
diff --git a/doc/contributing/maintaining-single-executable-application-support.md b/doc/contributing/maintaining-single-executable-application-support.md
index e3957230f3..51cafb5ae6 100644
--- a/doc/contributing/maintaining-single-executable-application-support.md
+++ b/doc/contributing/maintaining-single-executable-application-support.md
@@ -54,7 +54,9 @@ for the following features are in the list of work we'd like to get to:
* Running an archive of multiple files.
* Embedding [Node.js CLI options][] into the binary.
* [XCOFF][] executable format.
-* Run tests on Linux architectures/distributions other than AMD64 Ubuntu.
+* Run tests on Alpine Linux.
+* Run tests on s390x Linux.
+* Run tests on ppc64 Linux.
## Disabling single executable application support
diff --git a/test/parallel/test-single-executable-application.js b/test/parallel/test-single-executable-application.js
index f41b9d7778..902093dc6e 100644
--- a/test/parallel/test-single-executable-application.js
+++ b/test/parallel/test-single-executable-application.js
@@ -16,8 +16,10 @@ if (!process.config.variables.single_executable_application)
if (!['darwin', 'win32', 'linux'].includes(process.platform))
common.skip(`Unsupported platform ${process.platform}.`);
-if (process.platform === 'linux' && process.config.variables.asan)
- common.skip('Running the resultant binary fails with `Segmentation fault (core dumped)`.');
+if (process.platform === 'linux' && process.config.variables.asan) {
+ // Source of the memory leak - https://github.com/nodejs/node/blob/da0bc6db98cef98686122ea1e2cd2dbd2f52d123/src/node_sea.cc#L94.
+ common.skip('Running the resultant binary fails because of a memory leak ASAN error.');
+}
if (process.platform === 'linux' && process.config.variables.is_debug === 1)
common.skip('Running the resultant binary fails with `Couldn\'t read target executable"`.');
@@ -39,17 +41,16 @@ if (process.config.variables.want_separate_host_toolset !== 0)
common.skip('Running the resultant binary fails with `Segmentation fault (core dumped)`.');
if (process.platform === 'linux') {
- try {
- const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' });
- if (!/^NAME="Ubuntu"/m.test(osReleaseText)) {
- throw new Error('Not Ubuntu.');
- }
- } catch {
- common.skip('Only supported Linux distribution is Ubuntu.');
+ const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' });
+ const isAlpine = /^NAME="Alpine Linux"/m.test(osReleaseText);
+ if (isAlpine) common.skip('Alpine Linux is not supported.');
+
+ if (process.arch === 's390x') {
+ common.skip('On s390x, postject fails with `memory access out of bounds`.');
}
- if (process.arch !== 'x64') {
- common.skip(`Unsupported architecture for Linux - ${process.arch}.`);
+ if (process.arch === 'ppc64') {
+ common.skip('On ppc64, this test times out.');
}
}