Skip to contentSkip to conversation

nodejs: Upgrade to 16.11.1

PATCH In review Khem Raj 2 participants 4 messages Oct 20, 2021 – Mar 4, 2022 4 messages not in the archive

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 nodejs: Upgrade to 16.11.1

* This is new LTS release
* Add patch to fix build on mips/mips64
* Add patch to build with new c-ares 2.17+
* Enhance native binaries patch to include additional native torque use
* Drop mips-warnings.patch and python 3.10 support patch which is already available in 16.x
* Refresh rest of patches against 16.x base

---
 .../0001-jinja-tests.py-add-py-3.10-fix.patch | 41 -----------
 ...-liftoff-Correct-function-signatures.patch | 71 +++++++++++++++++++
 ...4-Do-not-use-mminimal-toc-with-clang.patch |  7 +-
 ...nstall-both-binaries-and-use-libdir.patch} | 36 ++++++----
 .../nodejs/0002-Using-native-binaries.patch   | 20 ++++--
 .../nodejs/nodejs/libatomic.patch             |  2 +-
 .../nodejs/nodejs/mips-warnings.patch         | 19 -----
 .../nodejs/nodejs/system-c-ares.patch         | 24 +++++++
 .../{nodejs_14.18.1.bb => nodejs_16.11.1.bb}  | 18 ++---
 9 files changed, 145 insertions(+), 93 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-jinja-tests.py-add-py-3.10-fix.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-liftoff-Correct-function-signatures.patch
 rename meta-oe/recipes-devtools/nodejs/nodejs/{0003-Install-both-binaries-and-use-libdir.patch => 0002-Install-both-binaries-and-use-libdir.patch} (72%)
 delete mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/mips-warnings.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/system-c-ares.patch
 rename meta-oe/recipes-devtools/nodejs/{nodejs_14.18.1.bb => nodejs_16.11.1.bb} (93%)
meta-oe/recipes-devtools/nodejs/nodejs/0001-jinja-tests.py-add-py-3.10-fix.patch deleted +0 -41
deleted file mode 100644
index b2a2da959d..0000000000
@@ -1,41 +0,0 @@
-From e1d838089cd461d9efcf4d29d9f18f65994d2d6b Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Sun, 3 Oct 2021 22:48:39 +0200
-Subject: [PATCH] jinja/tests.py: add py 3.10 fix
-
-Upstream-Status: Pending
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- deps/v8/third_party/jinja2/tests.py      | 2 +-
- tools/inspector_protocol/jinja2/tests.py | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/deps/v8/third_party/jinja2/tests.py b/deps/v8/third_party/jinja2/tests.py
-index 0adc3d4..b14f85f 100644
---- a/deps/v8/third_party/jinja2/tests.py
-+++ b/deps/v8/third_party/jinja2/tests.py
-@@ -10,7 +10,7 @@
- """
- import operator
- import re
--from collections import Mapping
-+from collections.abc import Mapping
- from jinja2.runtime import Undefined
- from jinja2._compat import text_type, string_types, integer_types
- import decimal
-diff --git a/tools/inspector_protocol/jinja2/tests.py b/tools/inspector_protocol/jinja2/tests.py
-index 0adc3d4..b14f85f 100644
---- a/tools/inspector_protocol/jinja2/tests.py
-+++ b/tools/inspector_protocol/jinja2/tests.py
-@@ -10,7 +10,7 @@
- """
- import operator
- import re
--from collections import Mapping
-+from collections.abc import Mapping
- from jinja2.runtime import Undefined
- from jinja2._compat import text_type, string_types, integer_types
- import decimal
--- 
-2.20.1
-
meta-oe/recipes-devtools/nodejs/nodejs/0001-liftoff-Correct-function-signatures.patch new file +71 -0

71 lines not on this page · raw message

meta-oe/recipes-devtools/nodejs/nodejs/0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch +1 -6
index 00b2e9baa9..4773f05109 100644
@@ -10,11 +10,9 @@ Signed-off-by: Khem Raj <[email protected]>
  common.gypi | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/common.gypi b/common.gypi
-index ee91fb1d..049c8f8c 100644
 --- a/common.gypi
 +++ b/common.gypi
-@@ -413,7 +413,7 @@
+@@ -417,7 +417,7 @@
              'ldflags': [ '-m32' ],
            }],
            [ 'target_arch=="ppc64" and OS!="aix"', {
@@ -23,6 +21,3 @@ index ee91fb1d..049c8f8c 100644
              'ldflags': [ '-m64' ],
            }],
            [ 'target_arch=="s390x"', {
--- 
-2.32.0
-
meta-oe/recipes-devtools/nodejs/nodejs/0002-Install-both-binaries-and-use-libdir.patch renamed from meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch +24 -12
similarity index 72%
rename from meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch
rename to meta-oe/recipes-devtools/nodejs/nodejs/0002-Install-both-binaries-and-use-libdir.patch
index 6223920990..5cb2e97015 100644
@@ -1,10 +1,7 @@
-From 5b22fac923d1ca3e9fefb97f5a171124a88f5e22 Mon Sep 17 00:00:00 2001
+From 62ddf8499747fb1e366477d666c0634ad50039a9 Mon Sep 17 00:00:00 2001
 From: Elliott Sales de Andrade <[email protected]>
 Date: Tue, 19 Mar 2019 23:22:40 -0400
-Subject: [PATCH] Install both binaries and use libdir.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+Subject: [PATCH 2/2] Install both binaries and use libdir.
 
 This allows us to build with a shared library for other users while
 still providing the normal executable.
@@ -22,23 +19,29 @@ Signed-off-by: Khem Raj <[email protected]>
  2 files changed, 16 insertions(+), 12 deletions(-)
 
 diff --git a/configure.py b/configure.py
-index e6f7e4db..6cf5c45d 100755
+index 6efb98c2316f089f3167e486282593245373af3f..a6d2ec939e4480dfae703f3978067537abf9f0f0 100755
 --- a/configure.py
 +++ b/configure.py
-@@ -626,6 +626,12 @@ parser.add_option('--shared',
+@@ -721,10 +721,16 @@ parser.add_argument('--shared',
+     dest='shared',
+     default=None,
      help='compile shared library for embedding node in another project. ' +
           '(This mode is not officially supported for regular applications)')
  
-+parser.add_option('--libdir',
++parser.add_argument('--libdir',
 +    action='store',
 +    dest='libdir',
 +    default='lib',
 +    help='a directory to install the shared library into')
 +
- parser.add_option('--without-v8-platform',
+ parser.add_argument('--without-v8-platform',
      action='store_true',
      dest='without_v8_platform',
-@@ -1202,6 +1208,7 @@ def configure_node(o):
+     default=False,
+     help='do not initialize v8 platform during node.js startup. ' +
+@@ -1305,10 +1311,11 @@ def configure_node(o):
+     o['variables']['debug_nghttp2'] = 'false'
+ 
    o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
  
    o['variables']['node_shared'] = b(options.shared)
@@ -46,11 +49,15 @@ index e6f7e4db..6cf5c45d 100755
    node_module_version = getmoduleversion.get_version()
  
    if options.dest_os == 'android':
+     shlib_suffix = 'so'
+   elif sys.platform == 'darwin':
 diff --git a/tools/install.py b/tools/install.py
-index 729b416f..9bfc6234 100755
+index 41cc1cbc60a9480cc08df3aa0ebe582c2becc3a2..11208f9e7166ab60da46d5ace2257c239a7e9263 100755
 --- a/tools/install.py
 +++ b/tools/install.py
-@@ -121,22 +121,19 @@ def subdir_files(path, dest, action):
+@@ -128,26 +128,23 @@ def subdir_files(path, dest, action):
+   for subdir, files_in_path in ret.items():
+     action(files_in_path, subdir + '/')
  
  def files(action):
    is_windows = sys.platform == 'win32'
@@ -82,3 +89,8 @@ index 729b416f..9bfc6234 100755
  
    if 'true' == variables.get('node_use_dtrace'):
      action(['out/Release/node.d'], 'lib/dtrace/node.d')
+ 
+   # behave similarly for systemtap
+-- 
+2.33.0
+
meta-oe/recipes-devtools/nodejs/nodejs/0002-Using-native-binaries.patch +14 -6
index c6fc2dcd76..8db1f1dd54 100644
@@ -10,7 +10,7 @@ Subject: [PATCH] Using native binaries
 
 --- a/node.gyp
 +++ b/node.gyp
-@@ -487,6 +487,7 @@
+@@ -294,6 +294,7 @@
                'action_name': 'run_mkcodecache',
                'process_outputs_as_sources': 1,
                'inputs': [
@@ -18,7 +18,7 @@ Subject: [PATCH] Using native binaries
                  '<(mkcodecache_exec)',
                ],
                'outputs': [
-@@ -512,6 +513,7 @@
+@@ -319,6 +320,7 @@
                'action_name': 'node_mksnapshot',
                'process_outputs_as_sources': 1,
                'inputs': [
@@ -28,7 +28,7 @@ Subject: [PATCH] Using native binaries
                'outputs': [
 --- a/tools/v8_gypfiles/v8.gyp
 +++ b/tools/v8_gypfiles/v8.gyp
-@@ -220,6 +220,7 @@
+@@ -68,6 +68,7 @@
          {
            'action_name': 'run_torque_action',
            'inputs': [  # Order matters.
@@ -36,7 +36,15 @@ Subject: [PATCH] Using native binaries
              '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
              '<@(torque_files)',
            ],
-@@ -351,6 +352,7 @@
+@@ -99,6 +100,7 @@
+             '<@(torque_outputs_inc)',
+           ],
+           'action': [
++	    '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+             '-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
+             '-v8-root', '<(V8_ROOT)',
+@@ -225,6 +227,7 @@
          {
            'action_name': 'generate_bytecode_builtins_list_action',
            'inputs': [
@@ -44,7 +52,7 @@ Subject: [PATCH] Using native binaries
              '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
            ],
            'outputs': [
-@@ -533,6 +535,7 @@
+@@ -415,6 +418,7 @@
              ],
            },
            'inputs': [
@@ -52,7 +60,7 @@ Subject: [PATCH] Using native binaries
              '<(mksnapshot_exec)',
            ],
            'outputs': [
-@@ -1448,6 +1451,7 @@
+@@ -1548,6 +1552,7 @@
          {
            'action_name': 'run_gen-regexp-special-case_action',
            'inputs': [
meta-oe/recipes-devtools/nodejs/nodejs/libatomic.patch +1 -1
index cdf6bc8e23..cb0237309e 100644
@@ -11,7 +11,7 @@ Signed-off-by: Khem Raj <[email protected]>
 
 --- a/tools/v8_gypfiles/v8.gyp
 +++ b/tools/v8_gypfiles/v8.gyp
-@@ -1336,6 +1336,7 @@
+@@ -1436,6 +1436,7 @@
      {
        'target_name': 'mksnapshot',
        'type': 'executable',
meta-oe/recipes-devtools/nodejs/nodejs/mips-warnings.patch deleted +0 -19
deleted file mode 100644
index 1a773f23d8..0000000000
@@ -1,19 +0,0 @@
-Add explicit static cast to fix narrowing warning
-
-Fixes
-deps/v8/src/codegen/mips/assembler-mips.cc:3556:44: error: non-constant-expression cannot be narrowed from type 'int' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <[email protected]>
---- a/deps/v8/src/codegen/mips/assembler-mips.cc
-+++ b/deps/v8/src/codegen/mips/assembler-mips.cc
-@@ -3553,7 +3553,7 @@ void Assembler::GrowBuffer() {
-                                reloc_info_writer.last_pc() + pc_delta);
- 
-   // Relocate runtime entries.
--  Vector<byte> instructions{buffer_start_, pc_offset()};
-+  Vector<byte> instructions{buffer_start_, static_cast<size_t>(pc_offset())};
-   Vector<const byte> reloc_info{reloc_info_writer.pos(), reloc_size};
-   for (RelocIterator it(instructions, reloc_info, 0); !it.done(); it.next()) {
-     RelocInfo::Mode rmode = it.rinfo()->rmode();
meta-oe/recipes-devtools/nodejs/nodejs/system-c-ares.patch new file +24 -0
new file mode 100644
index 0000000000..141889ad23
@@ -0,0 +1,24 @@
+keep nodejs compatible with c-ares 1.17.1
+
+Upstream-Status: Inappropriate [c-ares specific]
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/src/cares_wrap.h
++++ b/src/cares_wrap.h
+@@ -22,7 +22,15 @@
+ # include <netdb.h>
+ #endif  // __POSIX__
+ 
+-# include <ares_nameser.h>
++#if defined(__ANDROID__) || \
++    defined(__MINGW32__) || \
++    defined(__OpenBSD__) || \
++    defined(_MSC_VER)
++
++# include <nameser.h>
++#else
++# include <arpa/nameser.h>
++#endif
+ 
+ namespace node {
+ namespace cares_wrap {
meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb renamed from meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb +10 -8
similarity index 93%
rename from meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb
rename to meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb
index 76ff980997..beed833c09 100644
@@ -1,7 +1,7 @@
 DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
 HOMEPAGE = "http://nodejs.org"
 LICENSE = "MIT & BSD & Artistic-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6768abdfc4dae4fde59d6b4df96930f3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=12f6b053282af96a218353ae7aff7cd8"
 
 DEPENDS = "openssl"
 DEPENDS:append:class-target = " qemu-native"
@@ -18,12 +18,12 @@ COMPATIBLE_HOST:riscv32 = "null"
 
 SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
            file://0001-Disable-running-gyp-files-for-bundled-deps.patch \
-           file://0003-Install-both-binaries-and-use-libdir.patch \
+           file://0002-Install-both-binaries-and-use-libdir.patch \
            file://0004-v8-don-t-override-ARM-CFLAGS.patch \
            file://big-endian.patch \
-           file://mips-warnings.patch \
            file://mips-less-memory.patch \
-           file://0001-jinja-tests.py-add-py-3.10-fix.patch \
+           file://system-c-ares.patch \
+           file://0001-liftoff-Correct-function-signatures.patch \
            "
 SRC_URI:append:class-target = " \
            file://0002-Using-native-binaries.patch \
@@ -34,7 +34,7 @@ SRC_URI:append:toolchain-clang:x86 = " \
 SRC_URI:append:toolchain-clang:powerpc64le = " \
            file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
            "
-SRC_URI[sha256sum] = "3fa1d71adddfab2f5e3e41874b4eddbdf92b65cade4a43922fb1e437afcf89ed"
+SRC_URI[sha256sum] = "67587f4de25e30a9cc0b51a6033eca3bc82d7b4e0d79bb84a265e88f76ab6278"
 
 S = "${WORKDIR}/node-v${PV}"
 
@@ -56,10 +56,11 @@ ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '-
                     bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
                     bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
                     '--with-arm-fpu=vfp', d), d), d)}"
-GYP_DEFINES:append:mipsel = " mips_arch_variant='r1' "
+ARCHFLAGS:append:mips = " --v8-lite-mode"
+ARCHFLAGS:append:mipsel = " --v8-lite-mode"
 ARCHFLAGS ?= ""
 
-PACKAGECONFIG ??= "brotli icu zlib"
+PACKAGECONFIG ??= "ares brotli icu zlib"
 
 PACKAGECONFIG[ares] = "--shared-cares,,c-ares"
 PACKAGECONFIG[brotli] = "--shared-brotli,,brotli"
@@ -87,7 +88,7 @@ python do_unpack() {
     import shutil
 
     bb.build.exec_func('base_do_unpack', d)
-
+    shutil.rmtree(d.getVar('S') + '/deps/openssl', True)
     if 'ares' in d.getVar('PACKAGECONFIG'):
         shutil.rmtree(d.getVar('S') + '/deps/cares', True)
     if 'brotli' in d.getVar('PACKAGECONFIG'):
@@ -137,6 +138,7 @@ do_configure () {
     GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
     # $TARGET_ARCH settings don't match --dest-cpu settings
     python3 configure.py --prefix=${prefix} --cross-compiling \
+               --shared-openssl \
                --without-dtrace \
                --without-etw \
                --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
Signature · 1 line
2.33.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 7 lines · Böszörményi Zoltán

2022. 03. 01. 18:12 keltezéssel, Khem Raj írta:

Quoted 6 lines · Böszörményi Zoltán
Quoted 3 lines

2021. 10. 21. 0:52 keltezéssel, Khem Raj írta:

Quoted 1 line

* This is new LTS release

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

16.14.0 is released since then, and 16.x is the LTS series. Can you please upgrade the recipe?

Currently, drowned in making meta-oe layers build. Perhaps it will

happen after that,

Quoted 1 line

unless someone beats me to it.

Would you accept a patch to add into Kirkstone?

Kirkstone is not branch yet so yes

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

Thanks in advance.

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw
Quoted 24 lines · Böszörményi Zoltán

2022. 03. 02. 16:59 keltezéssel, Khem Raj írta:

Quoted 3 lines

On Tue, Mar 1, 2022 at 11:13 PM Böszörményi Zoltán <[email protected]

<mailto:[email protected]>>

Quoted 13 lines

wrote:

    2022. 03. 01. 18:12 keltezéssel, Khem Raj írta:
     >
     >
     > On 3/1/22 5:35 AM, Böszörményi Zoltán wrote:
     >> 2021. 10. 21. 0:52 keltezéssel, Khem Raj írta:
     >>> * This is new LTS release
     >>
     >> 16.14.0 is released since then, and 16.x is the LTS series.
     >> Can you please upgrade the recipe?
     >
     > Currently, drowned in making meta-oe layers build. Perhaps it

will happen after that,

Quoted 5 lines

> unless someone beats me to it.

Would you accept a patch to add into Kirkstone?

Quoted 6 lines
Quoted 1 line

Kirkstone is not branch yet so yes

A question regarding branch policy:

Kirkstone will be an LTS release. It will get further nodejs 16.x LTS updates during its lifetime, right?

Yes usually bug fix releases are up reved

Quoted 11 lines
Quoted 9 lines




     >
     >>
     >> Thanks in advance.
#7 lore raw

Hi Zoltan,

Looks like, that you blindly removed my openssl legacy patch for nodejs. It has to stay there, until we won't upgrade to version v17.

Re-sent again: https://lists.openembedded.org/g/openembedded-devel/message/95782

Regards,
Andrej

On Wed, 2022-03-02 at 22:51 -0800, Khem Raj via lists.openembedded.org wrote:

On Wed, Mar 2, 2022 at 10:17 PM Böszörményi Zoltán <[email protected]<mailto:[email protected]>> wrote:
2022. 03. 02. 16:59 keltezéssel, Khem Raj írta:

Quoted 21 lines

On Tue, Mar 1, 2022 at 11:13 PM Böszörményi Zoltán <[email protected]<mailto:[email protected]> <mailto:[email protected]<mailto:[email protected]>>> wrote:

    2022. 03. 01. 18:12 keltezéssel, Khem Raj írta:
     >
     >
     > On 3/1/22 5:35 AM, Böszörményi Zoltán wrote:
     >> 2021. 10. 21. 0:52 keltezéssel, Khem Raj írta:
     >>> * This is new LTS release
     >>
     >> 16.14.0 is released since then, and 16.x is the LTS series.
     >> Can you please upgrade the recipe?
     >
     > Currently, drowned in making meta-oe layers build. Perhaps it will happen after that,
     > unless someone beats me to it.

    Would you accept a patch to add into Kirkstone?
Quoted 1 line

Kirkstone is not branch yet so yes

A question regarding branch policy:

Kirkstone will be an LTS release. It will get further nodejs 16.x LTS updates during its lifetime, right?

Yes usually bug fix releases are up reved

Quoted 7 lines


     >
     >>
     >> Thanks in advance.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95728): https://lists.openembedded.org/g/openembedded-devel/message/95728
Mute This Topic: https://lists.openembedded.org/mt/86478175/3619876
Group Owner: [email protected]<mailto:[email protected]>
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]<mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-