Skip to contentSkip to conversation

nodejs: upgrade 20.18.0 -> 22.11.0

PATCH New J. S. 1 participant 1 message Nov 1, 2024

lore
Share & tools
lore

J. S.

author
#0 lore raw

PATCH 1/1 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 https://github.com/nodejs/node/commit/686da19abb that addressed CVE-2024-22017
0001-deps-disable-io_uring-support-in-libuv.patch

Other patches were refreshed.

---
 .../oe-npm-cache                              |   0
 ....18.bb => nodejs-oe-cache-native_22.11.bb} |   0
 ...e-running-gyp-files-for-bundled-deps.patch |  15 +-
 .../nodejs/nodejs/0001-custom-env.patch       |  18 ++
 ...ps-disable-io_uring-support-in-libuv.patch |  52 +++++
 ...-liftoff-Correct-function-signatures.patch |  38 ++--
 .../nodejs/nodejs/0001-positional-args.patch  |  19 ++
 .../0004-v8-don-t-override-ARM-CFLAGS.patch   |  11 +-
 .../nodejs/nodejs/182d9c05e78.patch           | 182 ------------------
 .../nodejs/nodejs/system-c-ares.patch         |  12 +-
 .../{nodejs_20.18.0.bb => nodejs_22.11.0.bb}  |  12 +-
 11 files changed, 136 insertions(+), 223 deletions(-)
 rename meta-oe/recipes-devtools/nodejs/{nodejs-oe-cache-20.18 => nodejs-oe-cache-22.11}/oe-npm-cache (100%)
 rename meta-oe/recipes-devtools/nodejs/{nodejs-oe-cache-native_20.18.bb => nodejs-oe-cache-native_22.11.bb} (100%)
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-custom-env.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-positional-args.patch
 delete mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/182d9c05e78.patch
 rename meta-oe/recipes-devtools/nodejs/{nodejs_20.18.0.bb => nodejs_22.11.0.bb} (95%)
meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-22.11/oe-npm-cache renamed from meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.18/oe-npm-cache +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.18/oe-npm-cache
rename to meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-22.11/oe-npm-cache
meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-native_22.11.bb renamed from meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-native_20.18.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-native_20.18.bb
rename to meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-native_22.11.bb
meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch +8 -7
index 12f6cd8b9..f692eedd4 100644
@@ -1,4 +1,4 @@
-From 7d94bfe53beeb2d25eb5f2ff6b1d509df7e6ab80 Mon Sep 17 00:00:00 2001
+From 689e098cbde130ecde523ae39df3567456271fda Mon Sep 17 00:00:00 2001
 From: Zuzana Svetlikova <[email protected]>
 Date: Thu, 27 Apr 2017 14:25:42 +0200
 Subject: [PATCH] Disable running gyp on shared deps
@@ -28,19 +28,20 @@ python prune_sources() {
         shutil.rmtree(d.getVar('S') + '/deps/zlib')
 }
 do_unpack[postfuncs] += "prune_sources"
-
 ---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
+diff --git a/Makefile b/Makefile
+index dba16e5e..da4faffc 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -169,7 +169,7 @@ with-code-cache test-code-cache:
+@@ -173,7 +173,7 @@ with-code-cache test-code-cache:
  	$(warning '$@' target is a noop)
  
- out/Makefile: config.gypi common.gypi node.gyp \
+ out/Makefile: config.gypi common.gypi common_node.gypi node.gyp \
 -	deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
 +	deps/llhttp/llhttp.gyp \
- 	deps/simdutf/simdutf.gyp deps/ada/ada.gyp \
- 	tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
- 	tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
+ 	deps/simdutf/simdutf.gyp deps/ada/ada.gyp deps/nbytes/nbytes.gyp \
+ 	tools/v8_gypfiles/toolchain.gypi \
+ 	tools/v8_gypfiles/features.gypi \
meta-oe/recipes-devtools/nodejs/nodejs/0001-custom-env.patch new file +18 -0
new file mode 100644
index 000000000..532d3c5f5
@@ -0,0 +1,18 @@
+From 9c1a31afdcf368f794b9f5378cb3fe759570f905 Mon Sep 17 00:00:00 2001
+From: Jason Schonberg <[email protected]>
+Date: Tue, 30 Apr 2024 21:48:33 -0400
+Subject: [PATCH] Update to nodejs 22.0.0
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ test/fixtures/run-script/node_modules/.bin/custom-env | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/fixtures/run-script/node_modules/.bin/custom-env b/test/fixtures/run-script/node_modules/.bin/custom-env
+index e6f291c6..1430f2e9 100755
+--- a/test/fixtures/run-script/node_modules/.bin/custom-env
++++ b/test/fixtures/run-script/node_modules/.bin/custom-env
+@@ -1,2 +1,2 @@
+-#!/bin/bash
++#!/bin/sh
+ echo "$CUSTOM_ENV"
meta-oe/recipes-devtools/nodejs/nodejs/0001-deps-disable-io_uring-support-in-libuv.patch new file +52 -0

52 lines not on this page · raw message

meta-oe/recipes-devtools/nodejs/nodejs/0001-liftoff-Correct-function-signatures.patch +18 -20
index 5af87d866..5e617e655 100644
@@ -1,7 +1,7 @@
-From dc3652c0abcdf8573fd044907b19d8eda7ca1124 Mon Sep 17 00:00:00 2001
+From 33393507ba8209f0d6b85b391c525b4c70807275 Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Mon, 3 Jul 2023 12:33:16 +0000
-Subject: [PATCH] [liftoff] Correct function signatures
+Subject: [PATCH] Correct function signatures
 
 Fixes builds on mips where clang reports an error
 ../deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h:661:5: error: no matching member function for call to 'Move'
@@ -13,15 +13,15 @@ Upstream-Status: Submitted [https://chromium-review.googlesource.com/c/v8/v8/+/3
 Signed-off-by: Archana Polampalli <[email protected]>
 ---
  deps/v8/src/wasm/baseline/liftoff-assembler.h               | 6 +++---
- deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h | 2 +-
- deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64.h | 2 +-
+ .../src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h | 2 +-
+ .../src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h | 2 +-
  3 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/deps/v8/src/wasm/baseline/liftoff-assembler.h b/deps/v8/src/wasm/baseline/liftoff-assembler.h
-index aef63c64..f2a11b01 100644
+index 7cb2f500..713d16db 100644
 --- a/deps/v8/src/wasm/baseline/liftoff-assembler.h
 +++ b/deps/v8/src/wasm/baseline/liftoff-assembler.h
-@@ -717,7 +717,7 @@ class LiftoffAssembler : public MacroAssembler {
+@@ -681,7 +681,7 @@ class LiftoffAssembler : public MacroAssembler {
    void FinishCall(const ValueKindSig*, compiler::CallDescriptor*);
  
    // Move {src} into {dst}. {src} and {dst} must be different.
@@ -30,7 +30,7 @@ index aef63c64..f2a11b01 100644
  
    // Parallel register move: For a list of tuples <dst, src, kind>, move the
    // {src} register of kind {kind} into {dst}. If {src} equals {dst}, ignore
-@@ -884,8 +884,8 @@ class LiftoffAssembler : public MacroAssembler {
+@@ -851,8 +851,8 @@ class LiftoffAssembler : public MacroAssembler {
    inline void MoveStackValue(uint32_t dst_offset, uint32_t src_offset,
                               ValueKind);
  
@@ -41,24 +41,24 @@ index aef63c64..f2a11b01 100644
  
    inline void Spill(int offset, LiftoffRegister, ValueKind);
    inline void Spill(int offset, WasmValue);
-diff --git a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
-index 96cba24c..53e1842d 100644
---- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
-+++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
-@@ -592,7 +592,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+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
+index bd59f162..56b4d70c 100644
+--- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h
++++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h
+@@ -672,7 +672,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
      pinned.set(dst_op.rm());
-     LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
+     LiftoffRegister tmp = kScratchReg2;
      // Save original value.
 -    Move(tmp, src, type.value_type());
 +    Move(tmp, src, type.value_type().kind());
  
      src = tmp;
      pinned.set(tmp);
-diff --git a/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64.h b/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64.h
-index 1d6ae09e..397e82b2 100644
---- a/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64.h
-+++ b/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64.h
-@@ -286,7 +286,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+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
+index a3c94af0..456e5334 100644
+--- a/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h
++++ b/deps/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv64-inl.h
+@@ -452,7 +452,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
      pinned.set(dst_op.rm());
      LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
      // Save original value.
@@ -67,5 +67,3 @@ index 1d6ae09e..397e82b2 100644
  
      src = tmp;
      pinned.set(tmp);
---
-2.40.0
meta-oe/recipes-devtools/nodejs/nodejs/0001-positional-args.patch new file +19 -0
new file mode 100644
index 000000000..5fd6aee35
@@ -0,0 +1,19 @@
+From 07ee84863fa4a9e4d5f155632478587b0acbf71a Mon Sep 17 00:00:00 2001
+From: Jason Schonberg <[email protected]>
+Date: Tue, 30 Apr 2024 21:48:33 -0400
+Subject: [PATCH] Update to nodejs 22.0.0
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ test/fixtures/run-script/node_modules/.bin/positional-args | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/fixtures/run-script/node_modules/.bin/positional-args b/test/fixtures/run-script/node_modules/.bin/positional-args
+index 2d809237..3dc5314f 100755
+--- a/test/fixtures/run-script/node_modules/.bin/positional-args
++++ b/test/fixtures/run-script/node_modules/.bin/positional-args
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ echo "Arguments: '$@'"
+ echo "The total number of arguments are: $#"
meta-oe/recipes-devtools/nodejs/nodejs/0004-v8-don-t-override-ARM-CFLAGS.patch +4 -7
index 97ed972ce..cc920118a 100644
@@ -1,4 +1,4 @@
-From 47ee5cc5501289205d3e8e9f27ea9daf18cebac1 Mon Sep 17 00:00:00 2001
+From afc085af7b6b935a5e14fc3f40db47df02ca3af2 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]>
 Date: Sat, 9 Nov 2019 14:45:30 +0000
 Subject: [PATCH] v8: don't override ARM CFLAGS
@@ -28,10 +28,10 @@ Signed-off-by: André Draszik <[email protected]>
  1 file changed, 2 insertions(+), 50 deletions(-)
 
 diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
-index 264b3e478e..0b41848145 100644
+index 9d1b0987..4df15e60 100644
 --- a/tools/v8_gypfiles/toolchain.gypi
 +++ b/tools/v8_gypfiles/toolchain.gypi
-@@ -211,31 +211,7 @@
+@@ -203,31 +203,7 @@
          'target_conditions': [
            ['_toolset=="host"', {
              'conditions': [
@@ -64,7 +64,7 @@ index 264b3e478e..0b41848145 100644
                  # Host not built with an Arm CXX compiler (simulator build).
                  'conditions': [
                    [ 'arm_float_abi=="hard"', {
-@@ -254,31 +230,7 @@
+@@ -246,31 +222,7 @@
            }],  # _toolset=="host"
            ['_toolset=="target"', {
              'conditions': [
@@ -97,6 +97,3 @@ index 264b3e478e..0b41848145 100644
                  # Target not built with an Arm CXX compiler (simulator build).
                  'conditions': [
                    [ 'arm_float_abi=="hard"', {
--- 
-2.20.1
-
meta-oe/recipes-devtools/nodejs/nodejs/182d9c05e78.patch deleted +0 -182

182 lines not on this page · raw message

meta-oe/recipes-devtools/nodejs/nodejs/system-c-ares.patch +10 -2
index 141889ad2..6f08c71e1 100644
@@ -1,11 +1,19 @@
-keep nodejs compatible with c-ares 1.17.1
+From ce931ad5f5aba60e8e77f39e0af43bce7d25d287 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 4 Mar 2024 11:05:25 -0500
+Subject: [PATCH] keep nodejs compatible with c-ares 1.17.1
 
 Upstream-Status: Inappropriate [c-ares specific]
 Signed-off-by: Khem Raj <[email protected]>
+---
+ src/cares_wrap.h | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
 
+diff --git a/src/cares_wrap.h b/src/cares_wrap.h
+index 021ef1c9..820c5d88 100644
 --- a/src/cares_wrap.h
 +++ b/src/cares_wrap.h
-@@ -22,7 +22,15 @@
+@@ -23,7 +23,15 @@
  # include <netdb.h>
  #endif  // __POSIX__
  
meta-oe/recipes-devtools/nodejs/nodejs_22.11.0.bb renamed from meta-oe/recipes-devtools/nodejs/nodejs_20.18.0.bb +7 -5
similarity index 95%
rename from meta-oe/recipes-devtools/nodejs/nodejs_20.18.0.bb
rename to meta-oe/recipes-devtools/nodejs/nodejs_22.11.0.bb
index cb11ad296..49a5f350d 100644
@@ -1,7 +1,7 @@
 DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
 HOMEPAGE = "http://nodejs.org"
 LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0 & Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=c83fcdcd43ab352be6429ee1fd8827a0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=25e89142a2f4b075904a9986c45fbdb2"
 
 CVE_PRODUCT = "nodejs node.js"
 
@@ -25,7 +25,9 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
            file://system-c-ares.patch \
            file://0001-liftoff-Correct-function-signatures.patch \
            file://libatomic.patch \
-           file://182d9c05e78.patch \
+           file://0001-deps-disable-io_uring-support-in-libuv.patch \
+           file://0001-positional-args.patch \
+           file://0001-custom-env.patch \
            file://run-ptest \
            "
 SRC_URI:append:class-target = " \
@@ -34,7 +36,7 @@ SRC_URI:append:class-target = " \
 SRC_URI:append:toolchain-clang:powerpc64le = " \
            file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
            "
-SRC_URI[sha256sum] = "7d9433e91fd88d82ba8de86e711ec41907638e227993d22e95126b02f6cd714a"
+SRC_URI[sha256sum] = "bbf0297761d53aefda9d7855c57c7d2c272b83a7b5bad4fea9cb29006d8e1d35"
 
 S = "${WORKDIR}/node-v${PV}"
 
@@ -98,7 +100,7 @@ do_unpack[postfuncs] += "prune_sources"
 # 1. If host and target have the different bit width, run those
 #    binaries for the target and run them on the host with QEMU.
 # 2. If host and target have the same bit width, enable upstream
-#    cross crompile support and no QEMU
+#    cross compile support and no QEMU
 python do_create_v8_qemu_wrapper () {
     """Creates a small wrapper that invokes QEMU to run some target V8 binaries
     on the host."""
@@ -192,7 +194,7 @@ python set_gyp_variables () {
         d.setVar("LDFLAGS_host", d.getVar("LDFLAGS"))
         d.setVar("AR_host", d.getVar("AR"))
     elif d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1":
-        # Enable upstream cross crompile support
+        # Enable upstream cross compile support
         d.setVar("CC_host", d.getVar("BUILD_CC"))
         d.setVar("CFLAGS_host", d.getVar("BUILD_CFLAGS"))
         d.setVar("CXX_host", d.getVar("BUILD_CXX"))
Signature · 1 line
2.43.0