Skip to content

Commit a4fce8c

Browse files
committed
chromium: Add nodejs v22.11.0 recipes
The current nodejs version in scarthgap is v20.18.2, but chromium requires v22.11.0. As scarthgap is LTS release, a major update can't be merged upstream, thus we add the dependency backport here. This commit backports nodejs v22.11.0 from meta-openembedded master branch commit: commit 6652b031d7d4d9cabf16d481f3b82115f7d8e15a Author: J. S. <[email protected]> Date: Fri Nov 1 13:18:40 2024 -0400 nodejs: upgrade 20.18.0 -> 22.11.0 This moves us from the previous Long Term Support version codenamed 'Iron' to the newly released Long Term Support version 22.11.0 Codename 'Jod' Changelog: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.11.0 License-Update: Add amaro dependency under MIT License. Add swc dependency under Aapche License Version 2.0. Add simdjson dependency under Apache License Version 2.0. Add on-exit-leak-free under MIT License. Remove ESLint. Remove base64 dependency. Removed patchs: 182d9c05e78.patch - This was a backport to 20.x it is now integrated in 22.x Added patches: Two small patches here to use Bourne Shell instad of BASH. 0001-custom-env.patch 0001-positional-args.patch This patch from nodejs/node@686da19abb that addressed CVE-2024-22017 0001-deps-disable-io_uring-support-in-libuv.patch Other patches were refreshed. Signed-off-by: Jason Schonberg <[email protected]> Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Ariel D'Alessandro <[email protected]>
1 parent e76e895 commit a4fce8c

14 files changed

+855
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env node
2+
3+
/// Usage: oe-npm-cache <cache-dir> <type> <key> <file-name>
4+
/// <type> ... meta - metainformation about package
5+
/// tgz - tarball
6+
7+
const process = require("node:process");
8+
9+
module.paths.unshift("@@libdir@@/node_modules/npm/node_modules");
10+
11+
const cacache = require('cacache')
12+
const fs = require('fs')
13+
14+
// argv[0] is 'node', argv[1] is this script
15+
const cache_dir = process.argv[2]
16+
const type = process.argv[3]
17+
const key = process.argv[4]
18+
const file = process.argv[5]
19+
20+
const data = fs.readFileSync(file)
21+
22+
// metadata content is highly nodejs dependent; when cache entries are not
23+
// found, place debug statements in 'make-fetch-happen/lib/cache/policy.js'
24+
// (CachePolicy::satisfies())
25+
const xlate = {
26+
'meta': {
27+
'key_prefix': 'make-fetch-happen:request-cache:',
28+
'metadata': function() {
29+
return {
30+
time: Date.now(),
31+
url: key,
32+
reqHeaders: {
33+
'accept': 'application/json',
34+
},
35+
resHeaders: {
36+
"content-type": "application/json",
37+
"status": 200,
38+
},
39+
options: {
40+
compress: true,
41+
}
42+
};
43+
},
44+
},
45+
46+
'tgz': {
47+
'key_prefix': 'make-fetch-happen:request-cache:',
48+
'metadata': function() {
49+
return {
50+
time: Date.now(),
51+
url: key,
52+
reqHeaders: {
53+
'accept': '*/*',
54+
},
55+
resHeaders: {
56+
"content-type": "application/octet-stream",
57+
"status": 200,
58+
},
59+
options: {
60+
compress: true,
61+
},
62+
};
63+
},
64+
},
65+
};
66+
67+
const info = xlate[type];
68+
let opts = {}
69+
70+
if (info.metadata) {
71+
opts['metadata'] = info.metadata();
72+
}
73+
74+
cacache.put(cache_dir, info.key_prefix + key, data, opts)
75+
.then(integrity => {
76+
console.log(`Saved content of ${key} (${file}).`);
77+
})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
DESCRIPTION = "OE helper for manipulating npm cache"
2+
LICENSE = "Apache-2.0"
3+
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
4+
5+
SRC_URI = "\
6+
file://oe-npm-cache \
7+
"
8+
9+
inherit native
10+
11+
S = "${WORKDIR}/sources"
12+
UNPACKDIR = "${S}"
13+
14+
B = "${WORKDIR}/build"
15+
16+
do_configure() {
17+
sed -e 's!@@libdir@@!${libdir}!g' < '${UNPACKDIR}/oe-npm-cache' > '${B}/oe-npm-cache'
18+
}
19+
20+
do_install() {
21+
install -D -p -m 0755 ${B}/oe-npm-cache ${D}${bindir}/oe-npm-cache
22+
}
23+
24+
RDEPENDS:${PN} = "nodejs-native"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From 689e098cbde130ecde523ae39df3567456271fda Mon Sep 17 00:00:00 2001
2+
From: Zuzana Svetlikova <[email protected]>
3+
Date: Thu, 27 Apr 2017 14:25:42 +0200
4+
Subject: [PATCH] Disable running gyp on shared deps
5+
6+
Upstream-Status: Inappropriate [embedded specific]
7+
8+
Probably imported from:
9+
https://src.fedoraproject.org/rpms/nodejs/c/41af04f2a3c050fb44628e91ac65fd225b927acb?branch=22609d8c1bfeaa21fe0057645af20b3a2ccc7f53
10+
which is probably based on dont-run-gyp-files-for-bundled-deps.patch added in:
11+
https://github.com/alpinelinux/aports/commit/6662eb3199902e8451fb20dce82554ad96f796bb
12+
13+
We also explicitly prune some dependencies from source in the bitbake recipe:
14+
15+
python prune_sources() {
16+
import shutil
17+
18+
shutil.rmtree(d.getVar('S') + '/deps/openssl')
19+
if 'ares' in d.getVar('PACKAGECONFIG'):
20+
shutil.rmtree(d.getVar('S') + '/deps/cares')
21+
if 'brotli' in d.getVar('PACKAGECONFIG'):
22+
shutil.rmtree(d.getVar('S') + '/deps/brotli')
23+
if 'libuv' in d.getVar('PACKAGECONFIG'):
24+
shutil.rmtree(d.getVar('S') + '/deps/uv')
25+
if 'nghttp2' in d.getVar('PACKAGECONFIG'):
26+
shutil.rmtree(d.getVar('S') + '/deps/nghttp2')
27+
if 'zlib' in d.getVar('PACKAGECONFIG'):
28+
shutil.rmtree(d.getVar('S') + '/deps/zlib')
29+
}
30+
do_unpack[postfuncs] += "prune_sources"
31+
---
32+
Makefile | 2 +-
33+
1 file changed, 1 insertion(+), 1 deletion(-)
34+
35+
diff --git a/Makefile b/Makefile
36+
index dba16e5e..da4faffc 100644
37+
--- a/Makefile
38+
+++ b/Makefile
39+
@@ -173,7 +173,7 @@ with-code-cache test-code-cache:
40+
$(warning '$@' target is a noop)
41+
42+
out/Makefile: config.gypi common.gypi common_node.gypi node.gyp \
43+
- deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
44+
+ deps/llhttp/llhttp.gyp \
45+
deps/simdutf/simdutf.gyp deps/ada/ada.gyp deps/nbytes/nbytes.gyp \
46+
tools/v8_gypfiles/toolchain.gypi \
47+
tools/v8_gypfiles/features.gypi \
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
From 6c3ac20477a4bac643088f24df3c042e627fafa9 Mon Sep 17 00:00:00 2001
2+
From: Guillaume Burel <[email protected]>
3+
Date: Fri, 3 Jan 2020 11:25:54 +0100
4+
Subject: [PATCH] Using native binaries
5+
6+
Upstream-Status: Inappropriate [embedded specific]
7+
8+
Originally added in:
9+
https://git.openembedded.org/meta-openembedded/commit/?id=1c8e4a679ae382f953b2e5c7a4966a4646314f3e
10+
later extended and renamed in:
11+
https://git.openembedded.org/meta-openembedded/commit/?id=feeb172d1a8bf010490d22b8df9448b20d9d2aed
12+
13+
Signed-off-by: Archana Polampalli <[email protected]>
14+
---
15+
node.gyp | 3 +
16+
tools/v8_gypfiles/v8.gyp | 5 +++++
17+
2 files changed, 6 insertions(+)
18+
19+
diff --git a/node.gyp b/node.gyp
20+
index e8e1d9f9..e60ccc10 100644
21+
--- a/node.gyp
22+
+++ b/node.gyp
23+
@@ -320,6 +320,7 @@
24+
'action_name': 'node_mksnapshot',
25+
'process_outputs_as_sources': 1,
26+
'inputs': [
27+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
28+
'<(node_mksnapshot_exec)',
29+
'<(node_snapshot_main)',
30+
],
31+
@@ -935,6 +935,7 @@
32+
'action_name': 'node_js2c',
33+
'process_outputs_as_sources': 1,
34+
'inputs': [
35+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
36+
'<(node_js2c_exec)',
37+
'<@(library_files)',
38+
'<@(deps_files)',
39+
@@ -944,6 +945,7 @@
40+
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
41+
],
42+
'action': [
43+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
44+
'<(node_js2c_exec)',
45+
'<@(_outputs)',
46+
'lib',
47+
48+
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
49+
index 42e26cd9..bc721991 100644
50+
--- a/tools/v8_gypfiles/v8.gyp
51+
+++ b/tools/v8_gypfiles/v8.gyp
52+
@@ -68,6 +68,7 @@
53+
{
54+
'action_name': 'run_torque_action',
55+
'inputs': [ # Order matters.
56+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
57+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
58+
'<@(torque_files)',
59+
],
60+
@@ -99,6 +100,7 @@
61+
'<@(torque_outputs_inc)',
62+
],
63+
'action': [
64+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
65+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
66+
'-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
67+
'-v8-root', '<(V8_ROOT)',
68+
@@ -211,6 +213,7 @@
69+
{
70+
'action_name': 'generate_bytecode_builtins_list_action',
71+
'inputs': [
72+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
73+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
74+
],
75+
'outputs': [
76+
@@ -400,6 +403,7 @@
77+
],
78+
},
79+
'inputs': [
80+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
81+
'<(mksnapshot_exec)',
82+
],
83+
'outputs': [
84+
@@ -1539,6 +1543,7 @@
85+
{
86+
'action_name': 'run_gen-regexp-special-case_action',
87+
'inputs': [
88+
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
89+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
90+
],
91+
'outputs': [
92+
--
93+
2.34.1
94+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
From 9c1a31afdcf368f794b9f5378cb3fe759570f905 Mon Sep 17 00:00:00 2001
2+
From: Jason Schonberg <[email protected]>
3+
Date: Tue, 30 Apr 2024 21:48:33 -0400
4+
Subject: [PATCH] Update to nodejs 22.0.0
5+
6+
Upstream-Status: Inappropriate [embedded specific]
7+
---
8+
test/fixtures/run-script/node_modules/.bin/custom-env | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/test/fixtures/run-script/node_modules/.bin/custom-env b/test/fixtures/run-script/node_modules/.bin/custom-env
12+
index e6f291c6..1430f2e9 100755
13+
--- a/test/fixtures/run-script/node_modules/.bin/custom-env
14+
+++ b/test/fixtures/run-script/node_modules/.bin/custom-env
15+
@@ -1,2 +1,2 @@
16+
-#!/bin/bash
17+
+#!/bin/sh
18+
echo "$CUSTOM_ENV"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 2bb296f169f86dbb04ee47e9a0dc1e3ee13d4f73 Mon Sep 17 00:00:00 2001
2+
From: Jason Schonberg <[email protected]>
3+
Date: Thu, 7 Mar 2024 12:55:56 -0500
4+
Subject: [PATCH] Update to nodejs 20.11.1
5+
6+
Upstream-Status: Inappropriate [embedded specific]
7+
---
8+
...ps-disable-io_uring-support-in-libuv.patch | 35 +++++++++++++++++++
9+
1 file changed, 35 insertions(+)
10+
create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch
11+
12+
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch
13+
new file mode 100644
14+
index 00000000..5ac711fb
15+
--- /dev/null
16+
+++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch
17+
@@ -0,0 +1,35 @@
18+
+From 9838be9c710ab4249df86726fa390232a3b6a6e7 Mon Sep 17 00:00:00 2001
19+
+From: Changqing Li <[email protected]>
20+
+Date: Fri, 1 Mar 2024 15:46:11 +0800
21+
+Subject: [PATCH] deps: disable io_uring support in libuv
22+
+
23+
+Refer [1], Pseudo fails to intercept some of the syscalls when io_uring
24+
+enabled. Refer [2], always disable io_uring support in libuv to fix
25+
+issue in [1].
26+
+
27+
+[1] https://git.openembedded.org/meta-openembedded/commit/?id=d08453978c31ee41d28206c6ff198d7d9d701d88
28+
+[2] https://github.com/nodejs/node/commit/686da19abb
29+
+
30+
+Upstream-Status: Inappropriate [oe-specific]
31+
+
32+
+Signed-off-by: Changqing Li <[email protected]>
33+
+---
34+
+ deps/uv/src/unix/linux.c | 2 +-
35+
+ 1 file changed, 1 insertion(+), 1 deletion(-)
36+
+
37+
+diff --git a/deps/uv/src/unix/linux.c b/deps/uv/src/unix/linux.c
38+
+index 0c997185..7508409d 100644
39+
+--- a/deps/uv/src/unix/linux.c
40+
++++ b/deps/uv/src/unix/linux.c
41+
+@@ -433,7 +433,7 @@ static int uv__use_io_uring(void) {
42+
+ if (use == 0) {
43+
+ /* Disable io_uring by default due to CVE-2024-22017. */
44+
+ val = getenv("UV_USE_IO_URING");
45+
+- use = val != NULL && atoi(val) ? 1 : -1;
46+
++ use = 0;
47+
+ atomic_store_explicit(&use_io_uring, use, memory_order_relaxed);
48+
+ }
49+
+
50+
+--
51+
+2.25.1
52+
+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 33393507ba8209f0d6b85b391c525b4c70807275 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Mon, 3 Jul 2023 12:33:16 +0000
4+
Subject: [PATCH] Correct function signatures
5+
6+
Fixes builds on mips where clang reports an error
7+
../deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h:661:5: error: no matching member function for call to 'Move'
8+
Move(tmp, src, type.value_type());
9+
^~~~
10+
11+
Upstream-Status: Submitted [https://chromium-review.googlesource.com/c/v8/v8/+/3235674]
12+
13+
Signed-off-by: Archana Polampalli <[email protected]>
14+
---
15+
deps/v8/src/wasm/baseline/liftoff-assembler.h | 6 +++---
16+
.../src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h | 2 +-
17+
.../src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h | 2 +-
18+
3 files changed, 5 insertions(+), 5 deletions(-)
19+
20+
diff --git a/deps/v8/src/wasm/baseline/liftoff-assembler.h b/deps/v8/src/wasm/baseline/liftoff-assembler.h
21+
index 7cb2f500..713d16db 100644
22+
--- a/deps/v8/src/wasm/baseline/liftoff-assembler.h
23+
+++ b/deps/v8/src/wasm/baseline/liftoff-assembler.h
24+
@@ -681,7 +681,7 @@ class LiftoffAssembler : public MacroAssembler {
25+
void FinishCall(const ValueKindSig*, compiler::CallDescriptor*);
26+
27+
// Move {src} into {dst}. {src} and {dst} must be different.
28+
- void Move(LiftoffRegister dst, LiftoffRegister src, ValueKind);
29+
+ void Move(LiftoffRegister dst, LiftoffRegister src, ValueKind kind);
30+
31+
// Parallel register move: For a list of tuples <dst, src, kind>, move the
32+
// {src} register of kind {kind} into {dst}. If {src} equals {dst}, ignore
33+
@@ -851,8 +851,8 @@ class LiftoffAssembler : public MacroAssembler {
34+
inline void MoveStackValue(uint32_t dst_offset, uint32_t src_offset,
35+
ValueKind);
36+
37+
- inline void Move(Register dst, Register src, ValueKind);
38+
- inline void Move(DoubleRegister dst, DoubleRegister src, ValueKind);
39+
+ inline void Move(Register dst, Register src, ValueKind kind);
40+
+ inline void Move(DoubleRegister dst, DoubleRegister src, ValueKind kind);
41+
42+
inline void Spill(int offset, LiftoffRegister, ValueKind);
43+
inline void Spill(int offset, WasmValue);
44+
diff --git a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h
45+
index bd59f162..56b4d70c 100644
46+
--- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h
47+
+++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h
48+
@@ -672,7 +672,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
49+
pinned.set(dst_op.rm());
50+
LiftoffRegister tmp = kScratchReg2;
51+
// Save original value.
52+
- Move(tmp, src, type.value_type());
53+
+ Move(tmp, src, type.value_type().kind());
54+
55+
src = tmp;
56+
pinned.set(tmp);
57+
diff --git a/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h b/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h
58+
index a3c94af0..456e5334 100644
59+
--- a/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h
60+
+++ b/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h
61+
@@ -452,7 +452,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
62+
pinned.set(dst_op.rm());
63+
LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
64+
// Save original value.
65+
- Move(tmp, src, type.value_type());
66+
+ Move(tmp, src, type.value_type().kind());
67+
68+
src = tmp;
69+
pinned.set(tmp);

0 commit comments

Comments
 (0)