[info=604d97274942396e3e03c2c2c6a6edd2aa64bbf67e33f6a9c68bdbef05449ac7]

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs22?expand=0&rev=29
This commit is contained in:
OBS User unknown 2025-01-22 11:01:56 +00:00 committed by Git OBS Bridge
commit d9658f7657
36 changed files with 2620 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

46
CVE-2024-21538.patch Normal file
View File

@ -0,0 +1,46 @@
Applied following patches,
From 5ff3a07d9add449021d806e45c4168203aa833ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cruz?= <andremiguelcruz@msn.com>
Date: Wed, 6 Nov 2024 22:02:49 +0000
Subject: [PATCH] fix: disable regexp backtracking (#160)
---
lib/util/escape.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From 640d391fde65388548601d95abedccc12943374f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cruz?= <andre.cruz@uphold.com>
Date: Thu, 7 Nov 2024 12:50:38 +0000
Subject: [PATCH] fix: fix escaping bug introduced by backtracking
---
lib/util/escape.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: node-v18.20.5/deps/npm/node_modules/cross-spawn/lib/util/escape.js
===================================================================
--- node-v18.20.5.orig/deps/npm/node_modules/cross-spawn/lib/util/escape.js
+++ node-v18.20.5/deps/npm/node_modules/cross-spawn/lib/util/escape.js
@@ -15,15 +15,17 @@ function escapeArgument(arg, doubleEscap
arg = `${arg}`;
// Algorithm below is based on https://qntm.org/cmd
+ // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
+ // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information
// Sequence of backslashes followed by a double quote:
// double up all the backslashes and escape the double quote
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
// Sequence of backslashes followed by the end of the string
// (which will become a double quote later):
// double up all the backslashes
- arg = arg.replace(/(\\*)$/, '$1$1');
+ arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
// All other backslashes occur literally

41
SHASUMS256.txt Normal file
View File

@ -0,0 +1,41 @@
ed52239294ad517fbe91a268146d5d2aa8a17d2d62d64873e43219078ba71c4e node-v22.13.1-aix-ppc64.tar.gz
be127be1d98cad94c56f46245d0f2de89934d300028694456861a6d5ac558bf3 node-v22.13.1-arm64.msi
97483ff4361d239a56d038c6335767a56a291e78c10f07446f463f05d9d19b89 node-v22.13.1-darwin-arm64.tar.gz
9c169a9369f6c667a4de6b14c7492065adbae0fa830ef4c666bea2c53ac7b576 node-v22.13.1-darwin-arm64.tar.xz
6fdcc8412d434664238b0651ebd5ad55d15a08598ff42dcb6d9cf1d434a6c4be node-v22.13.1-darwin-x64.tar.gz
cbc49a2f179ec51f3a7d49f91b05e16db2ea8ea4ca586e1e370d19661becf0eb node-v22.13.1-darwin-x64.tar.xz
f9cde9ace585c3979f1b4ee247914f35fae6e7b7eabc6a40961f89ad39e78964 node-v22.13.1-headers.tar.gz
2722236564df6d33b1d953f23e21bf5247b62b38ea9000b47c655ee3a9a440e7 node-v22.13.1-headers.tar.xz
911d9c07af38c82be22cd0a3db613aabc578ba940b35380aeedadd6d48070bc1 node-v22.13.1-linux-arm64.tar.gz
0a237c413ccbab920640438bf6e1a32edb19845bdc21f0e1cd5b91545ce1c126 node-v22.13.1-linux-arm64.tar.xz
82be9fa5e74ee29d7342d38306dbee19d3e2239b5b753870c04fd03768916a7e node-v22.13.1-linux-armv7l.tar.gz
f2be8dca2a7a518f6d187aa4b18abbeeafd71096a6d95f73f4d8bc0f8d2394ea node-v22.13.1-linux-armv7l.tar.xz
e4d34550d791cc809cfbfe8d0e3082634796add404169484b0849fbae0714576 node-v22.13.1-linux-ppc64le.tar.gz
377a7a1ea66f39251e1657f419e9404d526fcca9910620d0ecf0a870c6308f6b node-v22.13.1-linux-ppc64le.tar.xz
56375cf2c827a425d708bd0322fd635b6f2038e272468395f4e160e1ea4ae91e node-v22.13.1-linux-s390x.tar.gz
22da01dbcead3ef7e69de6c1310a1c5c485039631f731a6ff0c35530cf5c811b node-v22.13.1-linux-s390x.tar.xz
666148b9fe0c7e1301cc1b029e33a45e9e4a893f68d2d2bb1cc88a931a88a004 node-v22.13.1-linux-x64.tar.gz
0d2a5af33c7deab5555c8309cd3f373446fe1526c1b95833935ab3f019733b3b node-v22.13.1-linux-x64.tar.xz
620a7b4008aa0406678987ce2dd22458a38bae163fe7c69fd243f1204725e6c2 node-v22.13.1.pkg
e7d5b1e84e7f3c3cebda81e2b138469eef41ba4ecf16a87fd15fc3f7afa3f701 node-v22.13.1.tar.gz
cfce282119390f7e0c2220410924428e90dadcb2df1744c0c4a0e7baae387cc2 node-v22.13.1.tar.xz
b2c537f24a725d7e6058d23b1b89bbf31e6c7299b51ac31e9c25dc3c6a61e2d9 node-v22.13.1-win-arm64.7z
db6d3d28e1b34acdbd9db7bac5ec37980e07e48a6a2edcd3747d605fc8a5468e node-v22.13.1-win-arm64.zip
d495abe2ae53962065fad979814259735fd90a4e03c6b94ccd3e32bc933aeda5 node-v22.13.1-win-x64.7z
398a61e250a5584a62a5959e2f69f5d597fc83f1a5ebe3ed8fff29ba39d55f14 node-v22.13.1-win-x64.zip
3c87ddd4aac7f980ed11caf97942bd87a647ce61d644ca08321508836b3d1899 node-v22.13.1-win-x86.7z
504ed03c8596dfeabddfcd0736f987be93e3330a5c690306dedacef8880b592c node-v22.13.1-win-x86.zip
821566022dc3b262ac2f76598ee4f46003a6edafe5dadb84e5fbc7daaa1a78c7 node-v22.13.1-x64.msi
79c36ea6aa2ede10b416bdae55b568ab31798ede2697440b266312bba95ef580 node-v22.13.1-x86.msi
afb7dcd60c7557843e5c2777205564950544297ba0588faa2aae573ccb735767 win-arm64/node.exe
988eb8c60a5ade17e652dbdb60d56d3c6ad5e599a99ce04932b8c4c86583cdaf win-arm64/node.lib
b19efd6f54283a2c01027f0e74e54563d06495b87efe08d111e1a176afd14d02 win-arm64/node_pdb.7z
0bb490f44fc575dd570326fae9f0a5fca1187bfc342f57a50084ef86aa2e6679 win-arm64/node_pdb.zip
8f6945c55a51c893691534e7163372e4cedb62c8ad80a2a975df3f14a19fba16 win-x64/node.exe
65e45757c026c93a170743a811ef1b921ae12d6d9dd62d258bbbca0626687626 win-x64/node.lib
2ad1af26e2f78247473e1e05f78fff3be7401f47c327f45602c84dce5d552cc0 win-x64/node_pdb.7z
31099d09933aad429c36071503cd200eb66c41529524ac159873f97d9f097c83 win-x64/node_pdb.zip
0b7071f0a7d90d4e1567d94a37c5d94441a3ca71a4eaa9596bc06e992c06e9c8 win-x86/node.exe
79bae10059e833ce7fa4de05e5601034461327e2e7cb75c2144b87d4ab5ac547 win-x86/node.lib
c3fb150e58d16dadd95c24c8a0a4c020a18b3c852b63e36df39587a301512ca4 win-x86/node_pdb.7z
97890935271fe117a745584ca710f0fcd38bbf24b8c920800411df87a3e22dc3 win-x86/node_pdb.zip

BIN
SHASUMS256.txt.sig Normal file

Binary file not shown.

32
_constraints Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<disk>
<size unit="G">8</size>
</disk>
<physicalmemory>
<size unit="M">10000</size>
</physicalmemory>
</hardware>
<overwrite>
<conditions>
<arch>aarch64</arch>
</conditions>
<hardware>
<cpu>
<flag>asimdrdm</flag>
</cpu>
</hardware>
</overwrite>
<overwrite>
<conditions>
<arch>armv6l</arch>
<arch>armv7l</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">5</size>
</physicalmemory>
</hardware>
</overwrite>
</constraints>

3
_scmsync.obsinfo Normal file
View File

@ -0,0 +1,3 @@
mtime: 1737543704
commit: 604d97274942396e3e03c2c2c6a6edd2aa64bbf67e33f6a9c68bdbef05449ac7
url: https://src.opensuse.org/nodejs/nodejs22.git

16
bash_output_helper.bash Normal file
View File

@ -0,0 +1,16 @@
#
# Node can break stdin/stdout/stderr by setting them O_NONBLOCK
# and then not resetting it back to blocking mode on exit
# This function redirects stdio descriptors via new logging pipe
#
function decoupled_cmd
{
mkfifo _log
($@) < /dev/null > _log 2>_log &
cat _log
rm _log
wait $!
}

View File

@ -0,0 +1,13 @@
Index: node-v14.17.5/src/cares_wrap.h
===================================================================
--- node-v14.17.5.orig/src/cares_wrap.h
+++ node-v14.17.5/src/cares_wrap.h
@@ -22,7 +22,7 @@
# include <netdb.h>
#endif // __POSIX__
-# include <ares_nameser.h>
+#include <arpa/nameser.h>
namespace node {
namespace cares_wrap {

129
fix_ci_tests.patch Normal file
View File

@ -0,0 +1,129 @@
Author: Adam Majer <amajer@suse.de>
Date: Dec 20 09:18:49 UTC 2017
Summary: Fix CI unit tests framework for OBS building
Index: node-v22.12.0/test/parallel/test-module-loading-globalpaths.js
===================================================================
--- node-v22.12.0.orig/test/parallel/test-module-loading-globalpaths.js
+++ node-v22.12.0/test/parallel/test-module-loading-globalpaths.js
@@ -11,6 +11,9 @@ const { addLibraryPath } = require('../c
addLibraryPath(process.env);
+common.skip('hardcoded global paths');
+return;
+
if (process.argv[2] === 'child') {
console.log(require(pkgName).string);
} else {
Index: node-v22.12.0/test/parallel/test-tls-passphrase.js
===================================================================
--- node-v22.12.0.orig/test/parallel/test-tls-passphrase.js
+++ node-v22.12.0/test/parallel/test-tls-passphrase.js
@@ -223,7 +223,7 @@ server.listen(0, common.mustCall(functio
}, onSecureConnect());
})).unref();
-const errMessageDecrypt = /bad decrypt/;
+const errMessageDecrypt = /bad (decrypt|password read)/;
// Missing passphrase
assert.throws(function() {
Index: node-v22.12.0/test/parallel/test-repl-envvars.js
===================================================================
--- node-v22.12.0.orig/test/parallel/test-repl-envvars.js
+++ node-v22.12.0/test/parallel/test-repl-envvars.js
@@ -2,7 +2,9 @@
// Flags: --expose-internals
-require('../common');
+const common = require('../common');
+common.skip('Not running test in OBS');
+
const stream = require('stream');
const { describe, test } = require('node:test');
const REPL = require('internal/repl');
Index: node-v22.12.0/Makefile
===================================================================
--- node-v22.12.0.orig/Makefile
+++ node-v22.12.0/Makefile
@@ -397,7 +397,6 @@ ADDONS_HEADERS_PREREQS := tools/install.
$(wildcard deps/uv/include/*/*.h) \
$(wildcard deps/v8/include/*.h) \
$(wildcard deps/v8/include/*/*.h) \
- deps/zlib/zconf.h deps/zlib/zlib.h \
src/node.h src/node_api.h src/js_native_api.h src/js_native_api_types.h \
src/node_api_types.h src/node_buffer.h src/node_object_wrap.h \
src/node_version.h
@@ -570,6 +569,7 @@ test-ci-js: | clear-stalled ## Build and
# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
test-ci: LOGLEVEL := info ## Build and test everything (CI).
test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests doc-only
+ strip $(NODE_EXE)
out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
@@ -750,7 +750,8 @@ apidocs_json = $(addprefix out/,$(apidoc
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
tools/doc/node_modules: tools/doc/package.json
- @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
+ echo "Skipping tools/doc/node_modules"
+# @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping tools/doc/node_modules (no crypto)"; \
else \
cd tools/doc && $(call available-node,$(run-npm-ci)) \
Index: node-v22.12.0/tools/test.py
===================================================================
--- node-v22.12.0.orig/tools/test.py
+++ node-v22.12.0/tools/test.py
@@ -1386,7 +1386,7 @@ def BuildOptions():
result.add_option("-s", "--suite", help="A test suite",
default=[], action="append")
result.add_option("-t", "--timeout", help="Timeout in seconds",
- default=120, type="int")
+ default=1200, type="int")
result.add_option("--arch", help='The architecture to run tests for',
default='none')
result.add_option("--snapshot", help="Run the tests with snapshot turned on",
Index: node-v22.12.0/test/parallel/test-crypto-dh.js
===================================================================
--- node-v22.12.0.orig/test/parallel/test-crypto-dh.js
+++ node-v22.12.0/test/parallel/test-crypto-dh.js
@@ -93,7 +93,7 @@ const crypto = require('crypto');
dh3.computeSecret('');
}, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ?
'Unspecified validation error' :
- 'Supplied key is too small' });
+ /(Supplied key is too small|invalid public key)/ });
}
}
Index: node-v22.12.0/test/parallel/test-dns.js
===================================================================
--- node-v22.12.0.orig/test/parallel/test-dns.js
+++ node-v22.12.0/test/parallel/test-dns.js
@@ -403,7 +403,7 @@ assert.throws(() => {
const server = dgram.createSocket('udp4');
- server.on('message', common.mustCall((msg, { address, port }) => {
+ server.on('message', common.mustCallAtLeast((msg, { address, port }) => {
const parsed = dnstools.parseDNSPacket(msg);
const domain = parsed.questions[0].domain;
assert.strictEqual(domain, 'example.org');
Index: node-v22.12.0/test/wpt/test-webcrypto.js
===================================================================
--- node-v22.12.0.orig/test/wpt/test-webcrypto.js
+++ node-v22.12.0/test/wpt/test-webcrypto.js
@@ -1,7 +1,8 @@
'use strict';
const common = require('../common');
-if (!common.hasCrypto)
+const os = require('os')
+if (!common.hasCrypto || os.arch() == 's390x')
common.skip('missing crypto');
const { WPTRunner } = require('../common/wpt');

21
flaky_test_rerun.patch Normal file
View File

@ -0,0 +1,21 @@
Index: node-v16.13.0/tools/test.py
===================================================================
--- node-v16.13.0.orig/tools/test.py
+++ node-v16.13.0/tools/test.py
@@ -586,6 +586,16 @@ class TestCase(object):
self.context.store_unexpected_output)
def Run(self):
+ reruns = 0
+ while (reruns < 5):
+ reruns += 1
+ result = self.OriginalRun()
+ if (not result.HasFailed()):
+ break
+ print("FLAKY TEST rerun: ", self.GetCommand())
+ return result
+
+ def OriginalRun(self):
try:
result = self.RunCommand(self.GetCommand(), {
"TEST_SERIAL_ID": "%d" % self.serial_id,

36
gcc13.patch Normal file
View File

@ -0,0 +1,36 @@
Index: node-v22.1.0/deps/v8/src/builtins/builtins-array-gen.cc
===================================================================
--- node-v22.1.0.orig/deps/v8/src/builtins/builtins-array-gen.cc
+++ node-v22.1.0/deps/v8/src/builtins/builtins-array-gen.cc
@@ -18,6 +18,7 @@
#include "src/objects/arguments-inl.h"
#include "src/objects/elements-kind.h"
#include "src/objects/property-cell.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {
Index: node-v22.1.0/deps/v8/src/builtins/builtins-array.cc
===================================================================
--- node-v22.1.0.orig/deps/v8/src/builtins/builtins-array.cc
+++ node-v22.1.0/deps/v8/src/builtins/builtins-array.cc
@@ -23,6 +23,7 @@
#include "src/objects/objects-inl.h"
#include "src/objects/prototype.h"
#include "src/objects/smi.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {
Index: node-v22.1.0/deps/v8/src/codegen/tnode.h
===================================================================
--- node-v22.1.0.orig/deps/v8/src/codegen/tnode.h
+++ node-v22.1.0/deps/v8/src/codegen/tnode.h
@@ -8,6 +8,7 @@
#include <type_traits>
#include "src/codegen/machine-type.h"
+#include "src/wasm/wasm-objects.h"
#include "src/objects/tagged.h"
namespace v8 {

13
icu76.1.patch Normal file
View File

@ -0,0 +1,13 @@
Index: node-v22.11.0/configure.py
===================================================================
--- node-v22.11.0.orig/configure.py
+++ node-v22.11.0/configure.py
@@ -1876,7 +1876,7 @@ def configure_intl(o):
elif with_intl == 'system-icu':
# ICU from pkg-config.
o['variables']['v8_enable_i18n_support'] = 1
- pkgicu = pkg_config('icu-i18n')
+ pkgicu = pkg_config('icu-i18n icu-uc')
if not pkgicu[0]:
error('''Could not load pkg-config data for "icu-i18n".
See above errors or the README.md.''')

26
legacy_python.patch Normal file
View File

@ -0,0 +1,26 @@
Index: node-v18.11.0/tools/utils.py
===================================================================
--- node-v18.11.0.orig/tools/utils.py
+++ node-v18.11.0/tools/utils.py
@@ -26,10 +26,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import glob
import platform
import re
import sys
+from pathlib import Path
# Reads a .list file into an array of strings
@@ -109,7 +109,8 @@ def IsWindows():
def SearchFiles(dir, ext):
- list = glob.glob(dir+ '/**/*.' + ext, recursive=True)
+ list = Path(dir).glob('**/*.' + ext)
+ list = [ str(x) for x in list ]
if sys.platform == 'win32':
list = [ x.replace('\\', '/')for x in list]
return sorted(list)

25
linker_lto_jobs.patch Normal file
View File

@ -0,0 +1,25 @@
Purpose of these dependencies is to make sure that the linker
is run serially over these binaries instead of in parallel.
OBS workers run out of memory as each executable seems to require
upward of 5G RAM
Index: node-v22.13.0/node.gyp
===================================================================
--- node-v22.13.0.orig/node.gyp
+++ node-v22.13.0/node.gyp
@@ -1180,6 +1180,7 @@
'deps/googletest/googletest.gyp:gtest_main',
'deps/histogram/histogram.gyp:histogram',
'deps/nbytes/nbytes.gyp:nbytes',
+ 'fuzz_env'
],
'includes': [
@@ -1257,6 +1258,7 @@
'<(node_lib_target_name)',
'deps/histogram/histogram.gyp:histogram',
'deps/nbytes/nbytes.gyp:nbytes',
+ 'cctest'
],
'includes': [

20
manual_configure.patch Normal file
View File

@ -0,0 +1,20 @@
Author: Adam Majer <amajer@suse.de>
Date: Wed May 23 14:13:33 CEST 2018
Summary: This config.h is defined by hand
Gyp doesn't run autotools, so this config is not quite correct.
Update to prevent implicit defines to be used.
Index: node-git.8dae89b396/deps/nghttp2/lib/includes/config.h
===================================================================
--- node-git.8dae89b396.orig/deps/nghttp2/lib/includes/config.h
+++ node-git.8dae89b396/deps/nghttp2/lib/includes/config.h
@@ -71,7 +71,7 @@ typedef intptr_t ssize_t;
/* #undef HAVE_NETDB_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
-/* #undef HAVE_NETINET_IN_H */
+#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */

112
node-gyp-addon-gypi.patch Normal file
View File

@ -0,0 +1,112 @@
Index: node-v21.7.1/addon-rpm.gypi
===================================================================
--- /dev/null
+++ node-v21.7.1/addon-rpm.gypi
@@ -0,0 +1,35 @@
+{
+ 'target_defaults': {
+ 'type': 'loadable_module',
+ 'product_prefix': '',
+ 'include_dirs': [
+ '/usr/include/node22/',
+ '/usr/include/'
+ ],
+
+ 'target_conditions': [
+ ['_type=="loadable_module"', {
+ 'product_extension': 'node',
+ 'defines': [ 'BUILDING_NODE_EXTENSION' ],
+ }]
+ ],
+
+ 'conditions': [
+ [ 'OS=="mac"', {
+ 'libraries': [ '-undefined dynamic_lookup' ],
+ 'xcode_settings': {
+ 'DYLIB_INSTALL_NAME_BASE': '@rpath'
+ },
+ }],
+ [ 'OS=="win"', {
+ 'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ],
+ # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
+ # needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ 'msvs_disabled_warnings': [ 4251 ],
+ }],
+ [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', {
+ 'cflags': [ '-fPIC' ],
+ }]
+ ]
+ }
+}
Index: node-v21.7.1/deps/npm/node_modules/node-gyp/lib/configure.js
===================================================================
--- node-v21.7.1.orig/deps/npm/node_modules/node-gyp/lib/configure.js
+++ node-v21.7.1/deps/npm/node_modules/node-gyp/lib/configure.js
@@ -36,10 +36,6 @@ async function configure (gyp, argv) {
if ('v' + release.version !== process.version) {
// if --target was given, then determine a target version to compile for
log.verbose('get node dir', 'compiling against --target node version: %s', release.version)
- } else {
- // if no --target was specified then use the current host node version
- log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version)
- }
if (!release.semver) {
// could not parse the version string with semver
@@ -54,6 +50,12 @@ async function configure (gyp, argv) {
log.verbose('get node dir', 'target node version installed:', release.versionDir)
nodeDir = path.resolve(gyp.devDir, release.versionDir)
+ } else {
+ // if no --target was specified then use RPM-installed headers
+ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers')
+ nodeDir = '/usr/include/node22'
+ createBuildDir()
+ }
}
return createBuildDir()
@@ -201,8 +203,16 @@ async function configure (gyp, argv) {
// this logic ported from the old `gyp_addon` python file
const gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
- const addonGypi = path.resolve(__dirname, '..', 'addon.gypi')
- let commonGypi = path.resolve(nodeDir, 'include/node/common.gypi')
+ let addon_gypi_file = gyp.opts.target || gyp.opts.nodedir ? 'addon.gypi' : 'addon-rpm.gypi'
+ let addonGypi = path.resolve(__dirname, '..', addon_gypi_file)
+ let commonGypi = path.resolve(nodeDir, 'include/node22/common.gypi')
+
+ try {
+ await fs.stat(commonGypi)
+ } catch (err) {
+ commonGypi = path.resolve(nodeDir, 'include/node/common.gypi')
+ }
+
try {
await fs.stat(commonGypi)
} catch (err) {
Index: node-v21.7.1/deps/npm/node_modules/node-gyp/addon.gypi
===================================================================
--- node-v21.7.1.orig/deps/npm/node_modules/node-gyp/addon.gypi
+++ node-v21.7.1/deps/npm/node_modules/node-gyp/addon.gypi
@@ -18,6 +18,7 @@
],
'include_dirs': [
+ '<(node_root_dir)/include/node22',
'<(node_root_dir)/include/node',
'<(node_root_dir)/src',
'<(node_root_dir)/deps/openssl/config',
Index: node-v21.7.1/tools/build_addons.py
===================================================================
--- node-v21.7.1.orig/tools/build_addons.py
+++ node-v21.7.1/tools/build_addons.py
@@ -27,7 +27,7 @@ def generate_headers(headers_dir, instal
def rebuild_addons(args):
headers_dir = os.path.abspath(args.headers_dir)
out_dir = os.path.abspath(args.out_dir)
- node_bin = os.path.join(out_dir, 'node')
+ node_bin = os.path.join(out_dir, 'node22')
if args.is_win:
node_bin += '.exe'

BIN
node-v22.11.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
node-v22.12.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
node-v22.13.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
node-v22.13.1.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
node-v22.3.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
node_modules.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

54
nodejs-libpath.patch Normal file
View File

@ -0,0 +1,54 @@
Index: node-v22.12.0/tools/install.py
===================================================================
--- node-v22.12.0.orig/tools/install.py
+++ node-v22.12.0/tools/install.py
@@ -7,6 +7,7 @@ import os
import platform
import shutil
import sys
+from distutils import sysconfig
import re
current_system = platform.system()
@@ -72,6 +73,10 @@ def try_copy(options, path, dest):
try_unlink(target_path) # prevent ETXTBSY errors
return shutil.copy2(source_path, target_path)
+def libdir(options):
+ libdir_fq = sysconfig.get_config_var("LIBDIR")
+ return re.sub("^" + re.escape(options.prefix + "/"), "", libdir_fq)
+
def try_remove(options, path, dest):
source_path, target_path = mkpaths(options, path, dest)
if not options.silent:
@@ -88,7 +93,7 @@ def uninstall(options, paths, dest):
try_remove(options, path, dest)
def package_files(options, action, name, bins):
- target_path = os.path.join('lib/node_modules', name)
+ target_path = os.path.join(libdir(options), 'node_modules', name)
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -109,7 +114,7 @@ def package_files(options, action, name,
if action == uninstall:
action(options, [link_path], os.path.join('bin', bin_name))
elif action == install:
- try_symlink(options, os.path.join('../lib/node_modules', name, bin_target), link_path)
+ try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name, bin_target), link_path)
else:
assert 0 # unhandled action type
Index: node-v22.12.0/lib/internal/modules/cjs/loader.js
===================================================================
--- node-v22.12.0.orig/lib/internal/modules/cjs/loader.js
+++ node-v22.12.0/lib/internal/modules/cjs/loader.js
@@ -1798,7 +1798,7 @@ Module._initPaths = function() {
path.resolve(process.execPath, '..') :
path.resolve(process.execPath, '..', '..');
- const paths = [path.resolve(prefixDir, 'lib', 'node')];
+ const paths = ['/usr/lib/node'];
if (homeDir) {
ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries'));

BIN
nodejs.keyring Normal file

Binary file not shown.

228
nodejs22.changes Normal file
View File

@ -0,0 +1,228 @@
-------------------------------------------------------------------
Wed Jan 22 10:10:36 UTC 2025 - Adam Majer <adam.majer@suse.de>
- Update to 22.13.1:
* src,loader,permission: throw on InternalWorker use when
permission model is enabled (bsc#1236251, CVE-2025-23083)
* src: fix HTTP2 mem leak on premature close and ERR_PROTO
(bsc#1236250, CVE-2025-23085)
* deps: Use of Insufficiently Random Values in undici fetch()
(bsc#1236258, CVE-2025-22150)
-------------------------------------------------------------------
Thu Jan 16 15:00:55 UTC 2025 - Adam Majer <adam.majer@suse.de>
- Update to 22.13.0:
* Upgrades the Permission Model status from Active Development to Stable.
* Graduate WebCryptoAPI Ed25519 and X25519 algorithms as stable
* net: support blocklist in net.connect and net.Server
* dgram: support blocklist in udp
* deps updated:
> cares -- '1.34.3' -> '1.34.4'
> ngtcp2 -- '1.3.0' -> '1.9.1'
> npm -- '10.9.0' -> '10.9.2'
> simdjson -- '3.10.0' -> '3.10.1'
> simdutf -- '5.6.1' -> '5.6.4'
> uv -- '1.49.1' -> '1.49.2'
- CVE-2024-21538.patch: upstreamed, dropped
- linker_lto_jobs.patch: refreshed
-------------------------------------------------------------------
Mon Dec 30 22:17:20 UTC 2024 - Adam Majer <adam.majer@suse.de>
- test/report/test-report-exclude-network.js - removed unit tests that fail in staging
-------------------------------------------------------------------
Fri Dec 20 12:56:09 UTC 2024 - Adam Majer <adam.majer@suse.de>
- fix_ci_tests.patch: skip wpt/test-webcrypto on s390x as it has
unexpected differences between z13 and z15
- external sqlite support only on TW and SLFO
-------------------------------------------------------------------
Thu Dec 5 13:53:22 UTC 2024 - Adam Majer <adam.majer@suse.de>
- add python3-setuptools requirements (needed for python 3.13+)
-------------------------------------------------------------------
Wed Dec 4 16:59:08 UTC 2024 - Adam Majer <adam.majer@suse.de>
- Update to 22.12.0:
* require(esm) is now enabled by default
* Added resizable ArrayBuffer support in Buffer
- CVE-2024-21538.patch: fixes regular expression denial of service
(bsc#1233856, CVE-2024-21538)
- icu76.1.patch: upstreamed, dropped
- linker_lto_jobs.patch, nodejs-libpath.patch, fix_ci_tests.patch: refreshed
- nodejs.keyring: updated with upstream releaser list
- old_cares.patch: fix with older c-ares
-------------------------------------------------------------------
Wed Nov 20 10:04:23 UTC 2024 - Adam Majer <adam.majer@suse.de>
- BuildRequire python311 for SLE15
-------------------------------------------------------------------
Mon Nov 18 12:02:26 UTC 2024 - Adam Majer <adam.majer@suse.de>
- Update to 22.11.0:
* This release marks the transition of Node.js 22.x into
Long Term Support (LTS) with the codename 'Jod'.
Other than updating metadata, such as the process.release object,
to reflect that the release is LTS, no further changes from
Node.js 22.10.0 are included.
- icu76.1.patch: fix linking to ICU 76.1 (bsc#1232061)
-------------------------------------------------------------------
Mon Oct 28 11:43:07 UTC 2024 - Adam Majer <adam.majer@suse.de>
- Update to 22.10.0:
* crypto: add KeyObject.prototype.toCryptoKey
* crypto: add Date fields for validTo and validFrom
* http2: expose nghttp2_option_set_stream_reset_rate_limit as an option
* lib: propagate aborted state to dependent signals before firing events
* module: support loading entrypoint as url
* module: implement flushCompileCache()
* module: throw when invalid argument is passed to enableCompileCache()
* module: write compile cache to temporary file and then rename it
* process: add process.features.require_module
* process: add process.features.typescript
* test_runner: support custom arguments in run()
* test_runner: add 'test:summary' event
* test_runner: add support for coverage via run()
* worker: add markAsUncloneable api
- Changes since 22.9.0:
* util: getCallSite has been introduced. It allows users to retrieve the stacktrace of the current execution.
* tls: Exposes X509_V_FLAG_PARTIAL_CHAIN to tls.createSecureContext
* src: create handle scope in FastInternalModuleStat
* stream: relocate the status checking code in the onwritecomplete
* repl: doc-deprecate instantiating node:repl classes without new
* zlib: deprecate instantiating classes without new
- Changes since 22.8.0:
* vm: New option for vm.createContext() to create a context with a freezable globalThis
* src,lib: add performance.uvMetricsInfo
* net: exclude ipv6 loopback addresses from server.listen
* test_runner: support running tests in process
* test_runner: defer inheriting hooks until run()
- Changes since 22.7.0:
* Experimental transform types support
* Module syntax detection (the --experimental-detect-module flag) is now enabled by default.
* Performance Improvements to Buffer
- Changes since 22.6.0:
* lib,src: drop --experimental-network-imports
* http: add diagnostics channel http.client.request.error
* deps: V8: backport 7857eb34db42
* stream: expose DuplexPair API
* test_runner: fix support watch with run(), add globPatterns option
* meta: add jake to collaborators
* test_runner: refactor snapshots to get file from context
* test_runner: add context.filePath
- Changes since 22.5.0:
* http: expose websockets
* lib: add node:sqlite module
* module: add __esModule to require()'d ESM
* path: add matchesGlob method
* process: port on-exit-leak-free to core
* stream: pipeline wait for close before calling the callback
* test_runner: support glob matching coverage files
* worker: add postMessageToThread
- Changes since 22.4.1:
* (CVE-2024-36138, bsc#1227560) - Bypass incomplete fix of CVE-2024-27980 (High)
* (CVE-2024-22020, bsc#1227554) - Bypass network import restriction via data URL (Medium)
* (CVE-2024-22018, bsc#1227562) - fs.lstat bypasses permission model (Low)
* (CVE-2024-36137, bsc#1227561) - fs.fchown/fchmod bypasses permission model (Low)
* (CVE-2024-37372, bsc#1227563) - Permission model improperly processes UNC paths (Low)
- Changes since 22.4.0:
* deps,lib,src: add experimental web storage
* doc: doc-only deprecate OpenSSL engine-based APIs
* inspector: fix disable async hooks on Debugger.setAsyncCallStackDepth
* lib: add diagnostics_channel events to module loading
* util: support --no- for argument with boolean type for parseArgs
- fix_ci_tests.patch: refreshed, add compat for c-ares 1.30
- linker_lto_jobs.patch, versioned.patch, qemu_timeouts_arches.patch: refreshed
- nodejs.keyring: add C0D6248439F1D5604AAFFB4021D900FFDB233756
-------------------------------------------------------------------
Fri Jun 14 10:58:52 UTC 2024 - Adam Majer <adam.majer@suse.de>
- Update to 22.3.0:
* buffer: add .bytes() method to Blob
* doc: add context.assert docs
* doc: improve explanation about built-in modules
* fs: mark recursive cp methods as stable
* net: add new net.server.listen tracing channel
* module: print amount of load time of a cjs module
* process: add process.getBuiltinModule(id)
* cli: add NODE_RUN_PACKAGE_JSON_PATH env
* cli: add NODE_RUN_SCRIPT_NAME env to node --run
* lib: add EventSource Client
* lib: replace MessageEvent with undici's
* src: traverse parent folders while running --run
* src,permission: --allow-wasi & prevent WASI exec
* test_runner: support module mocking
* test_runner: add snapshot testing
* test_runner: add context.fullName
- fix_ci_tests.patch: partially upstreamed and refreshed
-------------------------------------------------------------------
Wed May 22 10:49:02 UTC 2024 - Adam Majer <adam.majer@suse.de>
- Update to 22.2.0:
* cli: allow running wasm in limited vmem with --disable-wasm-trap-handler
* doc: add pimterry to collaborators
* fs: allow 'withFileTypes' to be used with globs
* inspector: introduce the --inspect-wait flag
* lib,src: remove --experimental-policy
* perf_hooks: add deliveryType and responseStatus fields
* test_runner: support test plans
* zlib: expose zlib.crc32()
- linker_lto_jobs.patch: refreshed
- fix_ci_tests.patch: partially upstreamed, refreshed
- skip_no_console.patch: dropped, upstreamed
-------------------------------------------------------------------
Wed May 22 09:04:46 UTC 2024 - Adam Majer <adam.majer@suse.de>
- fix_ci_tests.patch: add fix for issue #53085
-------------------------------------------------------------------
Tue May 14 14:25:41 UTC 2024 - Adam Majer <adam.majer@suse.de>
- New nodejs major version 22.1.0
For overview of changes and details since 21.x and earlier see
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.1.0
- v8-i586.patch: fix 32bit build with new gcc
- Imported patches from 21.x:
* cares_public_headers.patch
* fix_ci_tests.patch
* flaky_test_rerun.patch
* gcc13.patch
* legacy_python.patch
* linker_lto_jobs.patch
* manual_configure.patch
* node-gyp-addon-gypi.patch
* node-gyp-config.patch
* nodejs-libpath.patch
* npm_search_paths.patch
* openssl_binary_detection.patch
* qemu_timeouts_arches.patch
* skip_no_console.patch
* sle12_python3_compat.patch
* test-skip-y2038-on-32bit-time_t.patch
* versioned.patch

1160
nodejs22.spec Normal file

File diff suppressed because it is too large Load Diff

32
npm_search_paths.patch Normal file
View File

@ -0,0 +1,32 @@
Index: node-v22.1.0/deps/npm/lib/commands/help-search.js
===================================================================
--- node-v22.1.0.orig/deps/npm/lib/commands/help-search.js
+++ node-v22.1.0/deps/npm/lib/commands/help-search.js
@@ -17,7 +17,7 @@ class HelpSearch extends BaseCommand {
throw this.usageError()
}
- const docPath = path.resolve(this.npm.npmRoot, 'docs/content')
+ const docPath = '/usr/share/doc/packages/nodejs'
let files = await glob(`${globify(docPath)}/*/*.md`)
// preserve glob@8 behavior
files = files.sort((a, b) => a.localeCompare(b, 'en'))
Index: node-v22.1.0/deps/npm/lib/npm.js
===================================================================
--- node-v22.1.0.orig/deps/npm/lib/npm.js
+++ node-v22.1.0/deps/npm/lib/npm.js
@@ -338,7 +338,13 @@ class Npm {
}
get globalPrefix () {
- return this.config.globalPrefix
+ let prefix = this.config.globalPrefix
+
+ // don't poop all over distro territory - use /usr/local instead
+ if (prefix === '/usr')
+ return '/usr/local'
+
+ return prefix;
}
get localPrefix () {

155
old_cares.patch Normal file
View File

@ -0,0 +1,155 @@
temporary revert changes until we can upgrade c-ares in SLE-15:Update
commit bf68733e7f61bf4ff51a456e27123f44a526aebc
Author: Aviv Keller <redyetidev@gmail.com>
Date: Wed Oct 30 10:10:28 2024 -0400
dns: stop using deprecated `ares_query`
PR-URL: https://github.com/nodejs/node/pull/55430
Refs: https://github.com/nodejs/node/issues/52464
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Index: node-v22.12.0/src/cares_wrap.cc
===================================================================
--- node-v22.12.0.orig/src/cares_wrap.cc
+++ node-v22.12.0/src/cares_wrap.cc
@@ -825,62 +825,62 @@ void ChannelWrap::EnsureServers() {
}
int AnyTraits::Send(QueryWrap<AnyTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_ANY);
+ wrap->AresQuery(name, ns_c_in, ns_t_any);
return ARES_SUCCESS;
}
int ATraits::Send(QueryWrap<ATraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_A);
+ wrap->AresQuery(name, ns_c_in, ns_t_a);
return ARES_SUCCESS;
}
int AaaaTraits::Send(QueryWrap<AaaaTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_AAAA);
+ wrap->AresQuery(name, ns_c_in, ns_t_aaaa);
return ARES_SUCCESS;
}
int CaaTraits::Send(QueryWrap<CaaTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_CAA);
+ wrap->AresQuery(name, ns_c_in, T_CAA);
return ARES_SUCCESS;
}
int CnameTraits::Send(QueryWrap<CnameTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_CNAME);
+ wrap->AresQuery(name, ns_c_in, ns_t_cname);
return ARES_SUCCESS;
}
int MxTraits::Send(QueryWrap<MxTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_MX);
+ wrap->AresQuery(name, ns_c_in, ns_t_mx);
return ARES_SUCCESS;
}
int NsTraits::Send(QueryWrap<NsTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_NS);
+ wrap->AresQuery(name, ns_c_in, ns_t_ns);
return ARES_SUCCESS;
}
int TxtTraits::Send(QueryWrap<TxtTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_TXT);
+ wrap->AresQuery(name, ns_c_in, ns_t_txt);
return ARES_SUCCESS;
}
int SrvTraits::Send(QueryWrap<SrvTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_SRV);
+ wrap->AresQuery(name, ns_c_in, ns_t_srv);
return ARES_SUCCESS;
}
int PtrTraits::Send(QueryWrap<PtrTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_PTR);
+ wrap->AresQuery(name, ns_c_in, ns_t_ptr);
return ARES_SUCCESS;
}
int NaptrTraits::Send(QueryWrap<NaptrTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_NAPTR);
+ wrap->AresQuery(name, ns_c_in, ns_t_naptr);
return ARES_SUCCESS;
}
int SoaTraits::Send(QueryWrap<SoaTraits>* wrap, const char* name) {
- wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_SOA);
+ wrap->AresQuery(name, ns_c_in, ns_t_soa);
return ARES_SUCCESS;
}
Index: node-v22.12.0/src/cares_wrap.h
===================================================================
--- node-v22.12.0.orig/src/cares_wrap.h
+++ node-v22.12.0/src/cares_wrap.h
@@ -246,20 +246,18 @@ class QueryWrap final : public AsyncWrap
return Traits::Send(this, name);
}
- void AresQuery(const char* name,
- ares_dns_class_t dnsclass,
- ares_dns_rec_type_t type) {
+ void AresQuery(const char* name, int dnsclass, int type) {
channel_->EnsureServers();
TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(
TRACING_CATEGORY_NODE2(dns, native), trace_name_, this,
"name", TRACE_STR_COPY(name));
- ares_query_dnsrec(channel_->cares_channel(),
- name,
- dnsclass,
- type,
- Callback,
- MakeCallbackPointer(),
- nullptr);
+ ares_query(
+ channel_->cares_channel(),
+ name,
+ dnsclass,
+ type,
+ Callback,
+ MakeCallbackPointer());
}
void ParseError(int status) {
@@ -306,20 +304,19 @@ class QueryWrap final : public AsyncWrap
return wrap;
}
- static void Callback(void* arg,
- ares_status_t status,
- size_t timeouts,
- const ares_dns_record_t* dnsrec) {
+ static void Callback(
+ void* arg,
+ int status,
+ int timeouts,
+ unsigned char* answer_buf,
+ int answer_len) {
QueryWrap<Traits>* wrap = FromCallbackPointer(arg);
if (wrap == nullptr) return;
unsigned char* buf_copy = nullptr;
- size_t answer_len = 0;
if (status == ARES_SUCCESS) {
- // No need to explicitly call ares_free_string here,
- // as it is a wrapper around free, which is already
- // invoked when MallocedBuffer is destructed.
- ares_dns_write(dnsrec, &buf_copy, &answer_len);
+ buf_copy = node::Malloc<unsigned char>(answer_len);
+ memcpy(buf_copy, answer_buf, answer_len);
}
wrap->response_data_ = std::make_unique<ResponseData>();

View File

@ -0,0 +1,42 @@
Allow non-standard openssl binary names
Index: node-v14.15.1/test/common/index.js
===================================================================
--- node-v14.15.1.orig/test/common/index.js
+++ node-v14.15.1/test/common/index.js
@@ -797,20 +797,28 @@ const common = {
get opensslCli() {
if (opensslCli !== null) return opensslCli;
+ let cli_candidates = [];
+
if (process.config.variables.node_shared_openssl) {
// Use external command
- opensslCli = 'openssl';
+ cli_candidates = cli_candidates.concat(['openssl-1_1', 'openssl']);
} else {
// Use command built from sources included in Node.js repository
- opensslCli = path.join(path.dirname(process.execPath), 'openssl-cli');
+ cli_candidates.push(path.join(path.dirname(process.execPath), 'openssl-cli'));
}
- if (exports.isWindows) opensslCli += '.exe';
+ let checkOpensslCli = function(opensslCli) {
+ if (exports.isWindows) opensslCli += '.exe';
+ const opensslCmd = spawnSync(opensslCli, ['version']);
+ if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) {
+ // OpenSSL command cannot be executed
+ opensslCli = false;
+ }
+ return opensslCli;
+ };
- const opensslCmd = spawnSync(opensslCli, ['version']);
- if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) {
- // OpenSSL command cannot be executed
- opensslCli = false;
+ for (let i=0; i<cli_candidates.length && !opensslCli; i=i+1) {
+ opensslCli = checkOpensslCli(cli_candidates[i]);
}
return opensslCli;
},

View File

@ -0,0 +1,14 @@
Index: node-v22.10.0/test/common/index.js
===================================================================
--- node-v22.10.0.orig/test/common/index.js
+++ node-v22.10.0/test/common/index.js
@@ -293,6 +293,9 @@ function platformTimeout(ms) {
return multipliers.four * ms;
}
+ if (process.arch === 'riscv64') // usermode qemu slow
+ return multipliers.seven * ms;
+
return ms;
}

View File

@ -0,0 +1,35 @@
Index: node-v19.1.0/configure
===================================================================
--- node-v19.1.0.orig/configure
+++ node-v19.1.0/configure
@@ -23,7 +23,7 @@ except ImportError:
from distutils.spawn import find_executable as which
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
-acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6), (3, 4))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
Index: node-v19.1.0/deps/npm/node_modules/node-gyp/lib/find-python.js
===================================================================
--- node-v19.1.0.orig/deps/npm/node_modules/node-gyp/lib/find-python.js
+++ node-v19.1.0/deps/npm/node_modules/node-gyp/lib/find-python.js
@@ -15,7 +15,7 @@ const programFiles = process.env.Program
const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)`
const winDefaultLocationsArray = []
-for (const majorMinor of ['39', '38', '37', '36']) {
+for (const majorMinor of ['39', '38', '37', '36', '34']) {
if (foundLocalAppData) {
winDefaultLocationsArray.push(
`${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`,
@@ -49,7 +49,7 @@ PythonFinder.prototype = {
log: logWithPrefix(log, 'find Python'),
argsExecutable: ['-c', 'import sys; print(sys.executable);'],
argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'],
- semverRange: '>=3.6.0',
+ semverRange: '>=3.4.0',
// These can be overridden for testing:
execFile: cp.execFile,

View File

@ -0,0 +1,45 @@
Skip 'test/parallel/test-fs-utimes-y2K38.js' on some platforms.
This test fails if coreutils' touch was built with 64-bit time_t,
while nodejs was built with 32-bit time_t. This is currently the case
on i586, ppc and arm. Skip the failing last command on those
platforms.
The failure was seen since coreutils-9.0.
Remove this patch once nodejs(1) also builds with 64-bit time_t.
---
test/parallel/test-fs-utimes-y2K38.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: node-v16.6.2/test/parallel/test-fs-utimes-y2K38.js
===================================================================
--- node-v16.6.2.orig/test/parallel/test-fs-utimes-y2K38.js
+++ node-v16.6.2/test/parallel/test-fs-utimes-y2K38.js
@@ -20,6 +20,26 @@ if (!common.isWindows) {
common.skip('File system appears to lack Y2K38 support (touch failed)');
}
+ // SUSE: touch-9.0 may succeed on platforms with 32-bit time_t,
+ // but the test would fail. Skip on those platforms for now.
+ const unameResult = spawnSync('uname',
+ ['-m'],
+ { encoding: 'utf8' });
+ if (unameResult.status === 0) {
+ if (unameResult.stdout.trim() === 'i686') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'ppc') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'armv6l') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'armv7l') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ }
+
// On some file systems that lack Y2K38 support, `touch` will succeed but
// the time will be incorrect.
const dateResult = spawnSync('date',

13
update_npm_tarball.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
#
# Fetch npm module tarball that is required to run unit tests
# which are not provided by upstream tarball
#
set -e
tar Jxf node-v*.tar.xz
cd node-v*/tools/doc
npm ci
cd ../..
exec tar Jcf ../node_modules.tar.xz tools/doc/node_modules

40
v8-i586.patch Normal file
View File

@ -0,0 +1,40 @@
Index: node-v22.1.0/deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc
===================================================================
--- node-v22.1.0.orig/deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc
+++ node-v22.1.0/deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc
@@ -1161,7 +1161,7 @@ template <typename Adapter>
void VisitAtomicExchange(InstructionSelectorT<Adapter>* selector,
typename Adapter::node_t node, ArchOpcode opcode,
MachineRepresentation rep) {
- using node_t = Adapter::node_t;
+ using node_t = typename Adapter::node_t;
IA32OperandGeneratorT<Adapter> g(selector);
node_t base = selector->input_at(node, 0);
node_t index = selector->input_at(node, 1);
@@ -1732,7 +1732,7 @@ template <typename Adapter>
void VisitWord32PairShift(InstructionSelectorT<Adapter>* selector,
InstructionCode opcode,
typename Adapter::node_t node) {
- using node_t = Adapter::node_t;
+ using node_t = typename Adapter::node_t;
IA32OperandGeneratorT<Adapter> g(selector);
node_t shift = selector->input_at(node, 2);
@@ -2507,7 +2507,7 @@ template <typename Adapter>
void VisitAtomicBinOp(InstructionSelectorT<Adapter>* selector,
typename Adapter::node_t node, ArchOpcode opcode,
MachineRepresentation rep) {
- using node_t = Adapter::node_t;
+ using node_t = typename Adapter::node_t;
AddressingMode addressing_mode;
IA32OperandGeneratorT<Adapter> g(selector);
node_t base = selector->input_at(node, 0);
@@ -2528,7 +2528,7 @@ void VisitAtomicBinOp(InstructionSelecto
template <typename Adapter>
void VisitPairAtomicBinOp(InstructionSelectorT<Adapter>* selector,
typename Adapter::node_t node, ArchOpcode opcode) {
- using node_t = Adapter::node_t;
+ using node_t = typename Adapter::node_t;
IA32OperandGeneratorT<Adapter> g(selector);
node_t base = selector->input_at(node, 0);
node_t index = selector->input_at(node, 1);

227
versioned.patch Normal file
View File

@ -0,0 +1,227 @@
Author: Adam Majer <amajer@suse.de>
Date: Fri May 11 16:10:16 CEST 2018
Summary: Generate versioned binaries
Generate versioned binaries and install paths
so we can allow concurrent installations and
management via update_alternatives.
This is also important for generation of binary
modules for multiple versions of NodeJS
Index: node-v22.10.0/Makefile
===================================================================
--- node-v22.10.0.orig/Makefile
+++ node-v22.10.0/Makefile
@@ -79,7 +79,7 @@ BUILDTYPE_LOWER := $(shell echo $(BUILDT
EXEEXT := $(shell $(PYTHON) -c \
"import sys; print('.exe' if sys.platform == 'win32' else '')")
-NODE_EXE = node$(EXEEXT)
+NODE_EXE = node22$(EXEEXT)
# Use $(PWD) so we can cd to anywhere before calling this
NODE ?= "$(PWD)/$(NODE_EXE)"
NODE_G_EXE = node_g$(EXEEXT)
Index: node-v22.10.0/tools/install.py
===================================================================
--- node-v22.10.0.orig/tools/install.py
+++ node-v22.10.0/tools/install.py
@@ -87,7 +87,7 @@ def uninstall(options, paths, dest):
try_remove(options, path, dest)
def package_files(options, action, name, bins):
- target_path = os.path.join(libdir(options), 'node_modules', name)
+ target_path = os.path.join(libdir(options), 'node_modules', name + '22')
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -108,19 +108,19 @@ def package_files(options, action, name,
if action == uninstall:
action(options, [link_path], os.path.join('bin', bin_name))
elif action == install:
- try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name, bin_target), link_path)
+ try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name + '22', bin_target), link_path)
else:
assert 0 # unhandled action type
def npm_files(options, action):
package_files(options, action, 'npm', {
- 'npm': 'bin/npm-cli.js',
- 'npx': 'bin/npx-cli.js',
+ 'npm22': 'bin/npm-cli.js',
+ 'npx22': 'bin/npx-cli.js',
})
def corepack_files(options, action):
package_files(options, action, 'corepack', {
- 'corepack': 'dist/corepack.js',
+ 'corepack22': 'dist/corepack.js',
# Not the default just yet:
# 'yarn': 'dist/yarn.js',
# 'yarnpkg': 'dist/yarn.js',
@@ -149,7 +149,7 @@ def subdir_files(options, path, dest, ac
action(options, files_in_path, subdir + os.path.sep)
def files(options, action):
- node_bin = 'node'
+ node_bin = 'node22'
if options.is_win:
node_bin += '.exe'
action(options, [os.path.join(options.build_dir, node_bin)], os.path.join('bin', node_bin))
@@ -190,7 +190,7 @@ def files(options, action):
if 'openbsd' in sys.platform:
action(options, ['doc/node.1'], 'man/man1/')
else:
- action(options, ['doc/node.1'], 'share/man/man1/')
+ action(options, ['doc/node.1'], 'share/man/man1/node22.1')
if 'true' == options.variables.get('node_install_npm'):
npm_files(options, action)
@@ -333,28 +333,28 @@ def headers(options, action):
'src/node_buffer.h',
'src/node_object_wrap.h',
'src/node_version.h',
- ], 'include/node/')
+ ], 'include/node22/')
# Add the expfile that is created on AIX
if sys.platform.startswith('aix') or sys.platform == "os400":
- action(options, ['out/Release/node.exp'], 'include/node/')
+ action(options, ['out/Release/node.exp'], 'include/node22/')
- subdir_files(options, os.path.join(options.v8_dir, 'include'), 'include/node/', wanted_v8_headers)
+ subdir_files(options, os.path.join(options.v8_dir, 'include'), 'include/node22/', wanted_v8_headers)
if 'false' == options.variables.get('node_shared_libuv'):
- subdir_files(options, 'deps/uv/include', 'include/node/', action)
+ subdir_files(options, 'deps/uv/include', 'include/node22/', action)
if 'true' == options.variables.get('node_use_openssl') and \
'false' == options.variables.get('node_shared_openssl'):
- subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
- subdir_files(options, 'deps/openssl/config/archs', 'include/node/openssl/archs', action)
- subdir_files(options, 'deps/openssl/config', 'include/node/openssl', action)
+ subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node22/openssl/', action)
+ subdir_files(options, 'deps/openssl/config/archs', 'include/node22/openssl/archs', action)
+ subdir_files(options, 'deps/openssl/config', 'include/node22/openssl', action)
if 'false' == options.variables.get('node_shared_zlib'):
action(options, [
'deps/zlib/zconf.h',
'deps/zlib/zlib.h',
- ], 'include/node/')
+ ], 'include/node22/')
if sys.platform == 'zos':
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
Index: node-v22.10.0/doc/node.1
===================================================================
--- node-v22.10.0.orig/doc/node.1
+++ node-v22.10.0/doc/node.1
@@ -28,24 +28,24 @@
.Dt NODE 1
.
.Sh NAME
-.Nm node
+.Nm node22
.Nd server-side JavaScript runtime
.
.\"======================================================================
.Sh SYNOPSIS
-.Nm node
+.Nm node22
.Op Ar options
.Op Ar v8-options
.Op Fl e Ar string | Ar script.js | Fl
.Op Fl -
.Op Ar arguments ...
.
-.Nm node
+.Nm node22
.Cm inspect
.Op Fl e Ar string | Ar script.js | Fl | Ar <host>:<port>
.Ar ...
.
-.Nm node
+.Nm node22
.Op Fl -v8-options
.
.\"======================================================================
Index: node-v22.10.0/src/node_main.cc
===================================================================
--- node-v22.10.0.orig/src/node_main.cc
+++ node-v22.10.0/src/node_main.cc
@@ -94,6 +94,7 @@ int wmain(int argc, wchar_t* wargv[]) {
// UNIX
int main(int argc, char* argv[]) {
+ setenv("NODE_VERSION", "22", 0);
return node::Start(argc, argv);
}
#endif
Index: node-v22.10.0/tools/test.py
===================================================================
--- node-v22.10.0.orig/tools/test.py
+++ node-v22.10.0/tools/test.py
@@ -972,7 +972,7 @@ class Context(object):
if self.vm is not None:
return self.vm
if arch == 'none':
- name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
+ name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node22'
else:
name = 'out/%s.%s/node' % (arch, mode)
Index: node-v22.10.0/node.gyp
===================================================================
--- node-v22.10.0.orig/node.gyp
+++ node-v22.10.0/node.gyp
@@ -27,8 +27,8 @@
'node_shared_openssl%': 'false',
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
- 'node_core_target_name%': 'node',
- 'node_lib_target_name%': 'libnode',
+ 'node_core_target_name%': 'node22',
+ 'node_lib_target_name%': 'libnode22',
'node_intermediate_lib_type%': 'static_library',
'node_builtin_modules_path%': '',
'linked_module_files': [
Index: node-v22.10.0/test/parallel/test-snapshot-warning.js
===================================================================
--- node-v22.10.0.orig/test/parallel/test-snapshot-warning.js
+++ node-v22.10.0/test/parallel/test-snapshot-warning.js
@@ -60,7 +60,7 @@ tmpdir.refresh();
stderr(output) {
let match = output.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = output.match(/Use `node --trace-warnings/g);
+ match = output.match(/Use `node22 --trace-warnings/g);
assert.strictEqual(match.length, 1);
return true;
}
@@ -79,7 +79,7 @@ tmpdir.refresh();
// Warnings should not be handled more than once.
let match = output.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = output.match(/Use `node --trace-warnings/g);
+ match = output.match(/Use `node22 --trace-warnings/g);
assert.strictEqual(match.length, 1);
return true;
}
@@ -114,7 +114,7 @@ tmpdir.refresh();
console.log(warningFile1, ':', warnings1);
let match = warnings1.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = warnings1.match(/Use `node --trace-warnings/g);
+ match = warnings1.match(/Use `node22 --trace-warnings/g);
assert.strictEqual(match.length, 1);
fs.rmSync(warningFile1, {
maxRetries: 3, recursive: false, force: true
@@ -140,6 +140,6 @@ tmpdir.refresh();
console.log(warningFile2, ':', warnings1);
match = warnings2.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = warnings2.match(/Use `node --trace-warnings/g);
+ match = warnings2.match(/Use `node22 --trace-warnings/g);
assert.strictEqual(match.length, 1);
}