Skip to content

Commit

Permalink
updated nodejs to 18.18.0 by adapting our nodejs buildroot upstream
Browse files Browse the repository at this point in the history
patchset.
  • Loading branch information
jens-maus committed Sep 23, 2023
1 parent c7d30b2 commit dd9c2ff
Show file tree
Hide file tree
Showing 7 changed files with 289 additions and 2 deletions.
82 changes: 82 additions & 0 deletions buildroot-patches/0013-nodejs.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,87 @@
--- buildroot/package/nodejs/0001-add-qemu-wrapper-support.patch.orig
+++ buildroot/package/nodejs/0001-add-qemu-wrapper-support.patch
@@ -16,6 +16,7 @@
host-builds.

Signed-off-by: Adam Duskett <[email protected]>
+Refresh for 18.18.0
---
node.gyp | 4 ++--
tools/v8_gypfiles/v8.gyp | 10 +++++-----
@@ -25,16 +26,7 @@
index 97cdbb531d..db5cf51ce6 100644
--- a/node.gyp
+++ b/node.gyp
-@@ -319,7 +319,7 @@
- 'action_name': 'run_mkcodecache',
- 'process_outputs_as_sources': 1,
- 'inputs': [
-- '<(mkcodecache_exec)',
-+ @MAYBE_WRAPPER@ '<(mkcodecache_exec)',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
-@@ -346,7 +346,7 @@
+@@ -322,7 +322,7 @@
'action_name': 'node_mksnapshot',
'process_outputs_as_sources': 1,
'inputs': [
@@ -43,6 +35,15 @@
'<(node_snapshot_main)',
],
'outputs': [
+@@ -342,7 +342,7 @@
+ 'action_name': 'node_mksnapshot',
+ 'process_outputs_as_sources': 1,
+ 'inputs': [
+- '<(node_mksnapshot_exec)',
++ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index 73099a03e4..88ca91efb4 100644
--- a/tools/v8_gypfiles/v8.gyp
@@ -74,7 +75,7 @@
],
'outputs': [
'<(generate_bytecode_builtins_list_output)',
-@@ -395,7 +395,7 @@
+@@ -400,7 +400,7 @@
],
},
'inputs': [
@@ -83,7 +84,7 @@
],
'outputs': [
'<(INTERMEDIATE_DIR)/snapshot.cc',
-@@ -1505,7 +1505,7 @@
+@@ -1569,7 +1569,7 @@
{
'action_name': 'run_gen-regexp-special-case_action',
'inputs': [
--- buildroot/package/nodejs/nodejs.hash.orig
+++ buildroot/package/nodejs/nodejs.hash
@@ -1,5 +1,5 @@
-# From https://nodejs.org/dist/v16.20.0/SHASUMS256.txt
-sha256 e0990f992234e40a51fe11f92c3816c93a77e1b081145d3dd762cd1026345349 node-v16.20.0.tar.xz
+# From https://nodejs.org/dist/v18.18.0/SHASUMS256.txt
+sha256 e4d4dbac3634d99f892f00db47da78f98493c339582e8a95fb2dd59f5cfe0f90 node-v18.18.0.tar.xz

# Hash for license file
-sha256 ba325815d3df8819bebaf37cad67d6e1f82271e1e4a1189b53abd28e261977d6 LICENSE
+sha256 a6871483905199033882d66453649675f0e88ffaa07f9f8acb257ce7504bc758 LICENSE
--- buildroot/package/nodejs/nodejs.mk.orig
+++ buildroot/package/nodejs/nodejs.mk
@@ -4,7 +4,7 @@
#
################################################################################

-NODEJS_VERSION = 16.20.0
+NODEJS_VERSION = 18.18.0
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
NODEJS_DEPENDENCIES = \
@@ -47,14 +47,16 @@
CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \
LDFLAGS.host="$(HOST_LDFLAGS)" \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
From 1f6c55d7318e7075169004b4314708f4766ec193 Mon Sep 17 00:00:00 2001
From: Adam Duskett <[email protected]>
Date: Mon, 27 Sep 2021 12:55:09 -0700
Subject: [PATCH] add qemu-wrapper support

V8's JIT infrastructure requires binaries such as mksnapshot and mkpeephole to
be run in the host during the build. However, these binaries must have the
same bit-width as the target (e.g. a x86_64 host targeting ARMv6 needs to
produce a 32-bit binary). To work around this issue, cross-compile the
binaries for the target and run them on the host with QEMU, much like
gobject-introspection.

However, for the host-variant we do not want to use a
qemu-wrapper, so add @MAYBE_WRAPPER@ to the needed files and sed the path to
the qemu-wrapper on target builds, and remove @MAYBE_WRAPPER@ entirely on
host-builds.

Signed-off-by: Adam Duskett <[email protected]>
Refresh for 18.18.0
---
node.gyp | 4 ++--
tools/v8_gypfiles/v8.gyp | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/node.gyp b/node.gyp
index 97cdbb531d..db5cf51ce6 100644
--- a/node.gyp
+++ b/node.gyp
@@ -322,7 +322,7 @@
'action_name': 'node_mksnapshot',
'process_outputs_as_sources': 1,
'inputs': [
- '<(node_mksnapshot_exec)',
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
'<(node_snapshot_main)',
],
'outputs': [
@@ -342,7 +342,7 @@
'action_name': 'node_mksnapshot',
'process_outputs_as_sources': 1,
'inputs': [
- '<(node_mksnapshot_exec)',
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index 73099a03e4..88ca91efb4 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -68,7 +68,7 @@
{
'action_name': 'run_torque_action',
'inputs': [ # Order matters.
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
'<@(torque_files)',
],
'outputs': [
@@ -99,7 +99,7 @@
'<@(torque_outputs_inc)',
],
'action': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
'-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
'-v8-root', '<(V8_ROOT)',
'<@(torque_files_without_v8_root)',
@@ -211,7 +211,7 @@
{
'action_name': 'generate_bytecode_builtins_list_action',
'inputs': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
],
'outputs': [
'<(generate_bytecode_builtins_list_output)',
@@ -400,7 +400,7 @@
],
},
'inputs': [
- '<(mksnapshot_exec)',
+ @MAYBE_WRAPPER@ '<(mksnapshot_exec)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/snapshot.cc',
@@ -1569,7 +1569,7 @@
{
'action_name': 'run_gen-regexp-special-case_action',
'inputs': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
--
2.37.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
From 1f6c55d7318e7075169004b4314708f4766ec193 Mon Sep 17 00:00:00 2001
From: Adam Duskett <[email protected]>
Date: Mon, 27 Sep 2021 12:55:09 -0700
Subject: [PATCH] add qemu-wrapper support

V8's JIT infrastructure requires binaries such as mksnapshot and mkpeephole to
be run in the host during the build. However, these binaries must have the
same bit-width as the target (e.g. a x86_64 host targeting ARMv6 needs to
produce a 32-bit binary). To work around this issue, cross-compile the
binaries for the target and run them on the host with QEMU, much like
gobject-introspection.

However, for the host-variant we do not want to use a
qemu-wrapper, so add @MAYBE_WRAPPER@ to the needed files and sed the path to
the qemu-wrapper on target builds, and remove @MAYBE_WRAPPER@ entirely on
host-builds.

Signed-off-by: Adam Duskett <[email protected]>
---
node.gyp | 4 ++--
tools/v8_gypfiles/v8.gyp | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/node.gyp b/node.gyp
index 97cdbb531d..db5cf51ce6 100644
--- a/node.gyp
+++ b/node.gyp
@@ -319,7 +319,7 @@
'action_name': 'run_mkcodecache',
'process_outputs_as_sources': 1,
'inputs': [
- '<(mkcodecache_exec)',
+ @MAYBE_WRAPPER@ '<(mkcodecache_exec)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
@@ -346,7 +346,7 @@
'action_name': 'node_mksnapshot',
'process_outputs_as_sources': 1,
'inputs': [
- '<(node_mksnapshot_exec)',
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
'<(node_snapshot_main)',
],
'outputs': [
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index 73099a03e4..88ca91efb4 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -68,7 +68,7 @@
{
'action_name': 'run_torque_action',
'inputs': [ # Order matters.
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
'<@(torque_files)',
],
'outputs': [
@@ -99,7 +99,7 @@
'<@(torque_outputs_inc)',
],
'action': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
'-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
'-v8-root', '<(V8_ROOT)',
'<@(torque_files_without_v8_root)',
@@ -211,7 +211,7 @@
{
'action_name': 'generate_bytecode_builtins_list_action',
'inputs': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
],
'outputs': [
'<(generate_bytecode_builtins_list_output)',
@@ -395,7 +395,7 @@
],
},
'inputs': [
- '<(mksnapshot_exec)',
+ @MAYBE_WRAPPER@ '<(mksnapshot_exec)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/snapshot.cc',
@@ -1505,7 +1505,7 @@
{
'action_name': 'run_gen-regexp-special-case_action',
'inputs': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
--
2.37.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# From https://nodejs.org/dist/v18.18.0/SHASUMS256.txt
sha256 e4d4dbac3634d99f892f00db47da78f98493c339582e8a95fb2dd59f5cfe0f90 node-v18.18.0.tar.xz

# Hash for license file
sha256 a6871483905199033882d66453649675f0e88ffaa07f9f8acb257ce7504bc758 LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# From https://nodejs.org/dist/v16.20.0/SHASUMS256.txt
sha256 e0990f992234e40a51fe11f92c3816c93a77e1b081145d3dd762cd1026345349 node-v16.20.0.tar.xz

# Hash for license file
sha256 ba325815d3df8819bebaf37cad67d6e1f82271e1e4a1189b53abd28e261977d6 LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

NODEJS_VERSION = 16.16.0
NODEJS_VERSION = 18.18.0
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
NODEJS_DEPENDENCIES = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

NODEJS_VERSION = 16.16.0
NODEJS_VERSION = 16.20.0
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
NODEJS_DEPENDENCIES = \
Expand Down

0 comments on commit dd9c2ff

Please sign in to comment.