178 Commits

Author SHA1 Message Date
Martin Jansa
61c47294c9 nodejs: Revert io_uring support from bundled libuv-1.46.0
* Pseudo fails to intercept some of the syscalls used by the
  new version as documented in:
  https://github.com/shr-project/com.webos.app.minimal/tree/recipes

Now we have 3 options:

1) every use of nodejs-native where io_uring might be used (like in webpack)
   needs to export UV_USE_IO_URING=0 before using node, but be aware that
   the PR says it's only temporary and this variable might be removed in future.
   Unfortunately many people are lucky enough not to know what pseudo even is,
   so they might not realize that host-user-contamination QA issues or
   "KeyError: 'getpwuid(): uid not found" might be related to this (and they
   probably won't find this e-mail as well:
   https://lists.openembedded.org/g/openembedded-devel/message/105583

2) revert the io_uring changes from bundled libuv, to make sure it stays disabled.
   The changes are massive and it will be PIA to update them for every nodejs release
   I've already separated them for nodejs-20.3.0 where I've initialy tested this
   on top of libuv-1.45.0 and for 20.4.0 this need another patch for changes
   from libuv-1.46.0.
   Patch for keeping UV_USE_IO_URING support after it's removed from upstream libuv
   will be much smaller, but PIA to use UV_USE_IO_URING whenever using nodejs-native
   during build.

3) fix pseudo to correctly work with io_uring calls, definitely best long-term solution
   as more and more tools will now switch to io_uring, but without active maintainer
   of pseudo it might be _very_ difficult to implement this and there aren't many
   people willing to touch this beast.

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit d08453978c31ee41d28206c6ff198d7d9d701d88)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-10-30 07:14:02 -04:00
Martin Jansa
344427bf60 nodejs: update to latest v20 version 20.8.1
* updates to latest v20 version

* LIC_FILES_CHKSUM changed due to small Copyright update from:
  660da785e6

* this still doesn't resolve the issue with pseudo reported in:
  https://lists.openembedded.org/g/openembedded-devel/message/105308
  and further debugged in:
  https://github.com/shr-project/com.webos.app.minimal/tree/recipes
  which shows that it's easily reproducible with plain webpack "Hello world".

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit fca128559b07f21d30ef3297f87af8701a1dbee2)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-10-30 07:14:02 -04:00
Khem Raj
dbfe83d4c5 nodejs: Fix ptest result reporting
This fixes
  AssertionError:-
  ptests which had no test results:
  ['nodejs']

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit cd629b722db82b6ec0e97f6564ba52abfe57d93c)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-10-04 07:52:49 -07:00
Archana Polampalli
470af9d6bb nodejs: upgrade 18.17.1 -> 20.5.1
Update to latest release of latest LTS 20 release

    * node v20 introduces several new features and fixes many bugs and CVEs as shown in [1]

    * Refresh 0001-liftoff-Correct-function-signatures.patch against 20.5.1

    * License-Update:
       - Change zlib version 1.2.13, October 13th, 2022 to version 1.2.13.1, October xxth, 2022 [2]
       - Change Copyright 2023 from Ada authors to Yagiz Nizipli and Daniel Lemire [4]

    * Remove big-endian.patch as it is merged in v20.x [5] [6]

    * Remove below list of patches since mips32 is deleted from v8 as part of update V8 to 10.7.193.13 [7] [8]
       - mips-less-memory.patch
       - 0001-mips-Use-32bit-cast-for-operand-on-mips32.patch

    * Update Using-native-binaries.patch for node_js2c, it resolved below do_compile error [9]
       Error:
       /bin/sh: line 1: build/tmp/work/core2-64-poky-linux/nodejs/20.5.1/node-v20.5.1/out/Release/node_js2c: No such file or directory

    * Remove obsolete dtrace & etw configure options (we had: --without-<feature>) from the recipe [10]

https://github.com/nodejs/node/releases/tag/v20.5.1

[1] https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md
[2] f100732575
[3] 900ae1bda7
[4] d246536924
[5] 3cea5d5425
[6] f226350fcb
[7] a26ca5ed14
[8] 6bd756d7c6
[9] 4da7bc915c
[10] aa3a572e6b

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 13e83bd009200f42741083c5a6f1fbc653205c49)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-10-04 07:52:48 -07:00
Archana Polampalli
77efa60d5b nodejs: upgrade 18.17.0 -> 18.17.1
This is a security release.
The following CVEs are fixed in this release:
    CVE-2023-32002
    CVE-2023-32006
    CVE-2023-32559

https://github.com/nodejs/node/releases/tag/v18.17.1

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-08-28 08:55:26 -07:00
Khem Raj
976ccae201 nodejs: Upgrade to 18.17.0
Update to latest release of latest LTS 18 release

License-Update: [1] [2] [3]

[1] 0cfdb3affa
[2] 2ea6e03003
[3] 261e1d23d1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-08-05 13:40:26 -07:00
Martin Jansa
33c96b7ed8 nodejs: use PIE for host binaries
* mksnapshot is built as host binary, but then gets executed under
  qemu-arm, because for 32bit target we need to run 32bit mksnapshot
  even when building on x86-64 host

* unfortunately since upgrade to qemu-8 in:
  https://git.openembedded.org/openembedded-core/commit/?id=fe8125565af07b73f9b29db2188ecb6e884bcc70

  the mksnapshot fails to execute with:
  LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/lib.host:/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni; "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/v8-qemu-wrapper.sh" "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/mksnapshot" --turbo_instruction_scheduling "--target_os=linux" "--target_arch=arm" --startup_src "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" --embedded_variant Default --embedded_src "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni/embedded.S" --no-native-code-counters

  #
  # Fatal process OOM in Failed to reserve virtual memory for CodeRange
  #

  /OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/v8-qemu-wrapper.sh: line 7: 669880 Trace/breakpoint trap   (core dumped) PSEUDO_UNLOAD=1 qemu-arm -r 5.15 -L /OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot -E LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot/usr/lib:/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot/lib "$@"

  It was failing only in some of my builds first, in the end
  I was able to narrow the difference between the build where
  it fails and where it doesn't fail to
  require conf/distro/include/security_flags.inc
  then
  GCCPIE = "--enable-default-pie"
  and lastly this PIE enabled just for nodejs to work around
  this issue without downgrading qemu-native.

* using -strace with qemu doesn't help much, just confirms that
  the OOM error message is really caused by failed mmap2:

  --- SIGPROF {si_signo=SIGPROF, si_code=SI_TKILL, si_pid=2908258, si_uid=1026} ---
  clock_gettime64(CLOCK_MONOTONIC,0x407ef640) = 0 ({tv_sec=20187,tv_nsec=678404286})
  rt_sigreturn(0x407efb70) = -1 errno=513 (Successful exit from sigreturn)
  write(3,0x141e538,28) = 28
  write(3,0x141e538,28) = 28
  write(3,0x141e538,32) = 32
  mmap2(0x0097a000,33554432,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,-1,0) = -1 errno=12 (Cannot allocate memory)
  mmap2(0x0097a000,33554432,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,-1,0) = -1 errno=12 (Cannot allocate memory)

* diffoscope on this 1.7G binary didn't really help as it got killed by OOMK after a while
  Out of memory: Killed process 1136999 (diffoscope) total-vm:404300108kB, anon-rss:122594688kB, file-rss:512kB, shmem-rss:0kB, UID:1026 pgtables:764240kB oom_score_adj:0

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-28 13:53:12 -07:00
Martin Jansa
be8c765c7c *.patch: add Upstream-Status to all patches
There is new patch-status QA check in oe-core:
https://git.openembedded.org/openembedded-core/commit/?id=76a685bfcf927593eac67157762a53259089ea8a

This is temporary work around just to hide _many_ warnings from
optional patch-status (if you add it to WARN_QA).

This just added
Upstream-Status: Pending
everywhere without actually investigating what's the proper status.

This is just to hide current QA warnings and to catch new .patch files being
added without Upstream-Status, but the number of Pending patches is now terrible:

5 (26%) 	meta-xfce
6 (50%) 	meta-perl
15 (42%)        meta-webserver
21 (36%)        meta-gnome
25 (57%)        meta-filesystems
26 (43%)        meta-initramfs
45 (45%)        meta-python
47 (55%)        meta-multimedia
312 (63%)       meta-networking
756 (61%)       meta-oe

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-21 09:15:20 -07:00
Khem Raj
5c3518c2a5 nodejs: Upgrade to 18.16.0
License-Update: Add missing licenses for Ada [1] BSD, Simduf [2] BSD, posteject
[3] MIT

[1] 0bc4c17e57
[2] c9845fc334
[3] 4aaec07266

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-10 11:06:33 -07:00
Archana Polampalli
2144e93beb Nodejs: add missing run_ptest script
ptest-runner is not available for Nodejs on target hence added run-ptest script

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-25 08:54:59 -07:00
Jan Feemers
4488418a29 nodejs: package-split between nodejs and nodejs-npm
The nodejs package contains a symbolic link `/usr/bin/corepack` to a
file from the nodejs-npm package.

```shell
build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/packages-split/nodejs/usr/bin$ ls -l
total 31932
lrwxrwxrwx 1 jan jan       45 Feb 21 05:08 corepack -> ../lib/node_modules/corepack/dist/corepack.js
-rwxr-xr-x 2 jan jan 32694304 Feb 21 05:08 node

build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/packages-split/nodejs-npm/usr/lib/node_modules/corepack/dist$ ls -l
total 2428
-rwxr-xr-x 2 jan jan  614216 Feb 21 05:08 corepack.js
```

Due to the link, the build system detects a dependency from package
`nodejs` to package `nodejs-npm`.
Since the `nodejs-npm` package depends on plenty more packages the link
should be moved to the `nodejs-npm` package.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-23 15:03:29 -07:00
Khem Raj
093077adc1 nodejs: Depend on file-native
Some older distribution e.g. alma8 has a version of file utility which
is version 5.33 but more importantly missing this patch [1] from version
5.40 which causes package failures in wasm files e.g.

ERROR: nodejs-18.14.2-r0 do_package: Fatal errors occurred in subprocesses:
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/write_file.wasm']' returned non-zero exit status 1.
Subprocess output:ERROR: Bad magic format `version %#x (MVP)' (bad format char: #)
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/symlink_loop.wasm']' returned non-zero exit status 1.
Subprocess output:ERROR: Bad magic format `version %#x (MVP)' (bad format char: #)
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/notdir.wasm']' returned non-zero exit status 1.
Subprocess output:ERROR: Bad magic format `version %#x (MVP)' (bad format char: #)
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/preopen_populates.wasm']' returned non-zero exit status 1.
Subprocess output:ERROR: Bad magic format `version %#x (MVP)' (bad format char: #)
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/clock_getres.wasm']' returned non-zero exit status 1.
Subprocess output:ERROR: Bad magic format `version %#x (MVP)' (bad format char: #)
Command '['file', '-b', '/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/nodejs/18.14.2-r0/package/usr/lib/nodejs/ptest/test/wasi/wasm/main_args.wasm']' returned non-zero exit status 1.

[1] 85b7ab8325

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-14 21:04:13 -07:00
Khem Raj
a4491a3e3e nodejs: Upgrade to 18.14.2
License-Update: Add base64 license information [1] and postject [2]

[1] 2ec8092e2c
[2] 4aaec07266

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-04 13:41:13 -08:00
Ross Burton
d051d73bbb nodejs: remove redundant comment
This commented-out assignment should have been removed in 3ff0235.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-24 08:45:43 -08:00
Ross Burton
d37abd5f8c nodejs: no need to stage binaries for target
Target nodejs doesn't depend on nodejs-native to build anymore, so there
is no need to stage these binaries.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Ross Burton
3ff0235737 nodejs: remove LD assignment
The purpose of this appears to have been lost, and the build succeeds
without it.

If it is needed, then it should be added to EXTRA_OEMAKE alongside the
CC and CXX assignments.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Ross Burton
fcddf51b7c nodejs: don't force cross-compilation in native builds
By not forcing the cross-compile build logic in native builds the build
is a _lot_ faster.  Walltime in buildstats-diff on my machine:

  nodejs-native    do_compile  -475.6s   -41.2%    1153.4s -> 677.7s

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Ross Burton
1ed7324c57 nodejs: use a postfunc to prune source tree
Instead of overriding do_unpack entirely and calling into base_do_unpack,
use a postfunc.  This keeps the prune logic separated neatly.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Ross Burton
69439ee7bd nodejs: run configure.py in verbose mode
It's useful to know what configure is detecting, so pass --verbose.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Ross Burton
b4c3c0b279 nodejs: remove redundant expand=True to getVar()
The expand argument defaults to True, so there's no need to specify it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-22 01:07:43 -08:00
Martin Jansa
c64ebfa6d8 nodejs: add Upstream-Status
* unfortunately all 3 have very long unclear history, I've tried to at least partially
  document in commit message

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-18 13:19:36 -08:00
Martin Jansa
4efcbfbcbf nodejs: fix do_install failure with 'shared' PACKAGECONFIG
* tools/install.py uses:
  output_lib = 'libnode.' + variables.get('shlib_suffix')
  action([output_prefix + output_lib], variables.get('libdir') + '/'+ output_lib)

  and when libdir is absolute path (either ${D}${libdir} before:
  https://git.openembedded.org/meta-openembedded/commit/?id=42c0f0120ad1caf25118d079314c988d4633a437
  or just ${libdir} "/usr/lib") it doesn't respect prefix nor ${D}
  and fails to write to host's directory when "shared" PACKAGECONFIG
  is enabled:
  http://errors.yoctoproject.org/Errors/Details/689959/

if [ ! -r node ] || [ ! -L node ]; then \
  ln -fs out/Release/node node; fi
TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3 tools/install.py install 'TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/image' '/usr'
installing TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/image/usr/bin/node
installing /usr/lib/libnode.so.108
Traceback (most recent call last):
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/node-v18.12.1/tools/install.py", line 351, in <module>
    run(sys.argv[:])
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/node-v18.12.1/tools/install.py", line 342, in run
    files(install)
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/node-v18.12.1/tools/install.py", line 179, in files
    action([output_prefix + output_lib], variables.get('libdir') + '/' + output_lib)
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/node-v18.12.1/tools/install.py", line 77, in install
    try_copy(path, dst)
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/node-v18.12.1/tools/install.py", line 67, in try_copy
    return shutil.copy2(source_path, target_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/recipe-sysroot-native/usr/lib/python3.11/shutil.py", line 436, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "TOPDIR/tmp-glibc/work/core2-64-oe-linux/nodejs/18.12.1-r0/recipe-sysroot-native/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/usr/lib/libnode.so.108'
make: *** [Makefile:189: install] Error 1

* use just baselib "lib" so that it respects ${D} as well as ${prefix}
  while using e.g. lib32 or lib64 when multilib is enabled

* similarly as 'node' binary is installed to relative hardcoded path "bin" with:
  action([output_prefix + output_file], 'bin/' + output_file)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-15 14:37:35 -08:00
Archana Polampalli
42c0f0120a Nodejs: fix buildpaths warning
Correct libdir used at configure time to avoid packaging warnings
WARNING: nodejs-18.12.1-r0 do_package_qa: QA Issue:
File /usr/bin/node in package nodejs contains reference to TMPDIR [buildpaths]
File /usr/bin/.debug/node in package nodejs-dbg contains reference to TMPDIR
File /usr/lib64/nodejs/ptest/.debug/cctest in package nodejs-dbg contains reference to TMPDIR [buildpaths]
File /usr/lib64/nodejs/ptest/cctest in package nodejs-ptest contains reference to TMPDIR [buildpaths]
File /usr/include/node/config.gypi in package nodejs-dev contains reference to TMPDIR [buildpaths]

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-08 08:51:44 -08:00
Chen Qi
97ce920e5a nodejs: add CVE_PRODUCT
Some old nodejs CVEs use 'nodejs', and recent nodejs CVEs use
'node.js'. Add CVE_PRODUCT to include both.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-07 21:26:16 -08:00
Martin Jansa
49c1e98885 meta: remove True option to getVar calls (again)
* True is default since 2016 and most layers were already updated
  not to pass this parameter where not necessary, e.g. oe-core was
  updated couple times, first in:
  https://git.openembedded.org/openembedded-core/commit/?id=7c552996597faaee2fbee185b250c0ee30ea3b5f

  Updated with the same regexp as later oe-core update:
  https://git.openembedded.org/openembedded-core/commit/?id=9f551d588693328e4d99d33be94f26684eafcaba

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-01 09:28:47 -08:00
Khem Raj
df4f8a675f nodejs: Fix build with gcc13
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-01 09:11:46 -08:00
Archana Polampalli
75a836190a Nodejs: Upgrade to 18.12.1
Node-18 is the current LTS release, node-19 is a development release and
node-20 is scheduled to be released until 2023-04-18 which is too late for YP-4.2
https://github.com/nodejs/release

* Refresh below two patches
   - 0001-Using-native-binaries.patch
   - 0001-liftoff-Correct-function-signatures.patch

* Copy openssl.cnf from sysroot_native to nodejs-openssl.cnf
  otherwise do_compile failed:
     make[1]: *** No rule to make target '../deps/openssl/nodejs-openssl.cnf',
     needed by 'Release/obj.target/deps/openssl/openssl.cnf'.  Stop.

* Add initial ptest support using ctest only, it covered 20% of the nodejs tests.
  There are some more tests exist to add but will require additional work.

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-01-25 08:57:42 -08:00
Archana Polampalli
c4829fa338 Nodejs - Upgrade to 16.18.1
* Drop Openssl legacy provider patch and install both binaries patch
  which are already available in 16.x
* Refresh native binaries patch against 16.x base

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-11-18 11:10:25 -08:00
Enrico Scholz
5bffa3f2f2 nodejs-oe-cache-native: initial checkin
This implements an 'npm cache add' like functionality but allows to
specify the key of the data and sets metadata which are required to
find the data.

It is used to cache information as done during 'npm install'.

Keyformat and metadata are nodejs version specific.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-05-20 10:59:47 -07:00
Khem Raj
5a52bffde1 nodejs: Upgrade to 16.14.2
Fix build with mips32, found with gcc12

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-04-20 10:58:01 -07:00
Khem Raj
454017a8d4 nodejs: Disable for powerpc
Fixes
../deps/v8/src/objects/code.h:564:2: error: #error Unknown architecture.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-14 09:16:04 -07:00
Andrej Valek
93ec055d83 nodejs: add option to use openssl legacy providers again
Current nodejs version v16 does not fully support new OpenSSL, so add option
to use legacy provider.

|   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
|   library: 'digital envelope routines',
|   reason: 'unsupported',
|   code: 'ERR_OSSL_EVP_UNSUPPORTED'

It was blindly removed by upgrade to 16.14.0 version

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-09 07:37:42 -08:00
Zoltán Böszörményi
f8a274732f nodejs: Upgrade to 16.14.0
Remove two upstreamed patches.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-03 08:50:19 -08:00
Andrej Valek
6c258bd830 nodejs: add option to use openssl legacy providers
Current nodejs version does not fully support new OpenSSL, so add option
to use legacy provider.

|   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
|   library: 'digital envelope routines',
|   reason: 'unsupported',
|   code: 'ERR_OSSL_EVP_UNSUPPORTED'

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-02-20 17:14:10 -08:00
Peter Kjellerstedt
3670d61546 nodejs: A little clean up
* The destination file name does not need to be specified to install
  if it matches the source file name (and -D is not used).
* Mode 0755 does not need to be specified to install as it is the
  default.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-01-18 09:01:51 -08:00
Peter Kjellerstedt
a7fd038743 nodejs: Drop workaround for an absolute path in the npm shebang
The rewrite of the npm shebang to use an absolute path was removed in
version 7.0.0.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-01-18 09:01:51 -08:00
Peter Kjellerstedt
4229bddf42 nodejs: Drop workaround for a Python 2 dependency
The gyp samples directory was removed in version 15.0.0.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-01-18 09:01:51 -08:00
Nisha Parrakat
1bdbdf3a7e nodejs_16.11.1.bb: only handle npm if configured
npm-cli.js should be symlinked only when the file is present
the file may not be available if the configure option is --without-npm

Signed-off-by: Nisha Parrakat <nishaparrakat@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-01-12 09:35:18 -08:00
Ross Burton
4004a2279e nodejs: set precise BSD license
"BSD" is ambiguous, use the precise licenses BSD-2-Clause and BSD-3-Clause.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-11-18 11:07:10 -08:00
Martin Jansa
dc01472dd9 nodejs: fix build without scrypt
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-11-01 05:45:17 -07:00
Khem Raj
354eca1043 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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-20 15:48:54 -07:00
Khem Raj
246b20b92c nodejs: Upgrade to 14.18.1
License-Update: Reflect new location of gtest sources
                remove node-inspect from license
		update Acorn to v8.4.1

Use internal openssl until nodejs is fixed to work with openssl3

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-17 16:15:21 -07:00
Khem Raj
ed3392fdb2 nodejs: add -fpermissive BUILD_CXXFLAGS
fixes build with openssl3-native

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-16 08:25:21 -07:00
Alexander Kanavin
e8214b76e4 nodejs: add a python 3.10 compatibility patch
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-14 07:16:58 -07:00
Alexander Kanavin
01d24acb40 nodejs: use -fpermissive
This resolves openssl 3.x errors until upstream addresses them properly.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-14 07:16:58 -07:00
Martin Jansa
c61dc077bb Convert to new override syntax
This is the result of automated script (0.9.1) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-08-03 10:21:25 -07:00
Khem Raj
94e54c209d nodejs: Update to 14.17.1
Drop upstreamed v8-call-new-ListFormatter-createInstance.patch patch
Add a patch for ppc64/clang to drop -mminimal-toc since clang does not
have this option

License-Update: URLs updated [1] and copyright owners too [2]

[1] 2d7e0b6912 (diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7)
[2] b57785d89b (diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-18 08:33:07 -07:00
Khem Raj
440f11c497 nodejs: Enable snapshot
New build method lets mksnaphot run so thsi is no longer needed

Reported-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-23 21:41:26 -07:00
Khem Raj
37e0b6152c nodejs: Fix build with clang for x86 target
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Khem Raj
2f365001e2 nodejs: Fix build on mips
2G is too much for qemu-mips and perhaps also for real mips devices
as we use qemu-usermode during build to run host pieces like mksnapshot
they fail,  reducing the allocation range helps

Fixes
|   LD_LIBRARY_PATH=/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/lib.host:/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1
/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/obj.target/v
8_snapshot/geni; "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/v8-qemu-wrapper.sh" "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/nod
e-v14.16.1/out/Release/mksnapshot" --turbo_instruction_scheduling "--target_os=linux" "--target_arch=mips" --startup_src "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/ou
t/Release/obj.target/v8_snapshot/geni/snapshot.cc" --embedded_variant Default --embedded_src "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/obj.target/v8_snap
shot/geni/embedded.S" --no-native-code-counters
|
| #
| # Fatal process OOM in CodeRange setup: allocate virtual memory
| #
|
| /mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/v8-qemu-wrapper.sh: line 7: 2292880 Trace/breakpoint trap   (core dumped) PSEUDO_UNLOAD=1 qemu-mips -r 3.2.0 -

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00