From 2aa402b45b9dee5329b35ef9b76208c3d0e7064a Mon Sep 17 00:00:00 2001 From: WTNLXTBL Date: Thu, 8 Jun 2023 12:49:44 +0000 Subject: [PATCH] bump(main/nodejs): v20.2.0 cacache patch has been removed as it is no longer needed npm/cacache#195 --- packages/nodejs/build.sh | 8 ++- ...odules-cacache-lib-util-move-file.js.patch | 60 ------------------- packages/nodejs/deps-uv-uv.gyp.patch | 8 --- ...s-v8-src-trap-handler-trap-handler.h.patch | 18 ++++-- packages/nodejs/node.gyp.patch | 32 ++++++++-- 5 files changed, 45 insertions(+), 81 deletions(-) delete mode 100644 packages/nodejs/deps-npm-node_modules-cacache-lib-util-move-file.js.patch diff --git a/packages/nodejs/build.sh b/packages/nodejs/build.sh index 8a69ebbdac..5a42b8be49 100644 --- a/packages/nodejs/build.sh +++ b/packages/nodejs/build.sh @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://nodejs.org/ TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environment" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Yaksh Bariya " -TERMUX_PKG_VERSION=19.9.0 +TERMUX_PKG_VERSION=20.2.0 TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=c7fce9d46ca6ce0d8990433cbf601bb9279c0eaed8705b357018cf50be9bed29 +TERMUX_PKG_SHA256=22523df2316c35569714ff1f69b053c2e286ced460898417dee46945efcdf989 # Note that we do not use a shared libuv to avoid an issue with the Android # linker, which does not use symbols of linked shared libraries when resolving # symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462. @@ -85,6 +85,10 @@ termux_step_configure() { $TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/gen-regexp-special-case.host.mk } +termux_step_make_install() { + python ./tools/install.py install '' $TERMUX_PREFIX +} + termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh diff --git a/packages/nodejs/deps-npm-node_modules-cacache-lib-util-move-file.js.patch b/packages/nodejs/deps-npm-node_modules-cacache-lib-util-move-file.js.patch deleted file mode 100644 index 577896999c..0000000000 --- a/packages/nodejs/deps-npm-node_modules-cacache-lib-util-move-file.js.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- ./deps/npm/node_modules/cacache/lib/util/move-file.js.orig 2023-01-07 16:30:48.424580622 +0530 -+++ ./deps/npm/node_modules/cacache/lib/util/move-file.js 2023-01-07 16:34:52.650983798 +0530 -@@ -1,56 +1,9 @@ - 'use strict' - --const fs = require('fs/promises') - const { moveFile: move } = require('@npmcli/fs') --const pinflight = require('promise-inflight') - - module.exports = moveFile - - async function moveFile (src, dest) { -- const isWindows = process.platform === 'win32' -- -- // This isn't quite an fs.rename -- the assumption is that -- // if `dest` already exists, and we get certain errors while -- // trying to move it, we should just not bother. -- // -- // In the case of cache corruption, users will receive an -- // EINTEGRITY error elsewhere, and can remove the offending -- // content their own way. -- // -- // Note that, as the name suggests, this strictly only supports file moves. -- try { -- await fs.link(src, dest) -- } catch (err) { -- if (isWindows && err.code === 'EPERM') { -- // XXX This is a really weird way to handle this situation, as it -- // results in the src file being deleted even though the dest -- // might not exist. Since we pretty much always write files to -- // deterministic locations based on content hash, this is likely -- // ok (or at worst, just ends in a future cache miss). But it would -- // be worth investigating at some time in the future if this is -- // really what we want to do here. -- } else if (err.code === 'EEXIST' || err.code === 'EBUSY') { -- // file already exists, so whatever -- } else { -- throw err -- } -- } -- try { -- await Promise.all([ -- fs.unlink(src), -- !isWindows && fs.chmod(dest, '0444'), -- ]) -- } catch (e) { -- return pinflight('cacache-move-file:' + dest, async () => { -- await fs.stat(dest).catch((err) => { -- if (err.code !== 'ENOENT') { -- // Something else is wrong here. Bail bail bail -- throw err -- } -- }) -- // file doesn't already exist! let's try a rename -> copy fallback -- // only delete if it successfully copies -- return move(src, dest) -- }) -- } -+ return move(src, dest) - } diff --git a/packages/nodejs/deps-uv-uv.gyp.patch b/packages/nodejs/deps-uv-uv.gyp.patch index 4eb3ff866e..f320927bf3 100644 --- a/packages/nodejs/deps-uv-uv.gyp.patch +++ b/packages/nodejs/deps-uv-uv.gyp.patch @@ -18,14 +18,6 @@ 'conditions': [ ['OS == "linux"', { 'defines': [ '_POSIX_C_SOURCE=200112' ], -@@ -249,6 +249,7 @@ - 'src/unix/procfs-exepath.c', - 'src/unix/random-getrandom.c', - 'src/unix/random-sysctl-linux.c', -+ 'src/unix/epoll.c', - ], - 'link_settings': { - 'libraries': [ '-ldl', '-lrt' ], @@ -267,6 +267,7 @@ 'src/unix/random-sysctl-linux.c', 'src/unix/epoll.c', diff --git a/packages/nodejs/deps-v8-src-trap-handler-trap-handler.h.patch b/packages/nodejs/deps-v8-src-trap-handler-trap-handler.h.patch index 248d430da3..ad42ac1e2d 100644 --- a/packages/nodejs/deps-v8-src-trap-handler-trap-handler.h.patch +++ b/packages/nodejs/deps-v8-src-trap-handler-trap-handler.h.patch @@ -1,6 +1,6 @@ ---- ./deps/v8/src/trap-handler/trap-handler.h.orig 2022-11-23 18:22:22.422329609 +0530 -+++ ./deps/v8/src/trap-handler/trap-handler.h 2022-11-23 18:28:14.112329475 +0530 -@@ -17,23 +17,7 @@ +--- ./deps/v8/src/trap-handler/trap-handler.h.orig 2023-05-27 19:03:25.691202764 +0530 ++++ ./deps/v8/src/trap-handler/trap-handler.h 2023-05-27 19:05:56.783177361 +0530 +@@ -17,29 +17,7 @@ namespace internal { namespace trap_handler { @@ -13,8 +13,14 @@ -#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_DARWIN -#define V8_TRAP_HANDLER_SUPPORTED true -// Arm64 simulator on x64 on Linux, Mac, or Windows. +-// +-// The simulator case uses some inline assembly code, which cannot be +-// compiled with MSVC, so don't enable the trap handler in that case. +-// (MSVC #defines _MSC_VER, but so does Clang when targeting Windows, hence +-// the check for __clang__.) -#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && \ -- (V8_OS_LINUX || V8_OS_DARWIN || V8_OS_WIN) +- (V8_OS_LINUX || V8_OS_DARWIN || V8_OS_WIN) && \ +- (!defined(_MSC_VER) || defined(__clang__)) -#define V8_TRAP_HANDLER_VIA_SIMULATOR -#define V8_TRAP_HANDLER_SUPPORTED true -// Everything else is unsupported. @@ -22,5 +28,5 @@ #define V8_TRAP_HANDLER_SUPPORTED false -#endif - // Setup for shared library export. - #if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN) + #if V8_OS_ANDROID && V8_TRAP_HANDLER_SUPPORTED + // It would require some careful security review before the trap handler diff --git a/packages/nodejs/node.gyp.patch b/packages/nodejs/node.gyp.patch index 23288b4b73..455bf09b81 100644 --- a/packages/nodejs/node.gyp.patch +++ b/packages/nodejs/node.gyp.patch @@ -1,6 +1,6 @@ ---- ./node.gyp.orig 2023-04-11 01:28:53.000000000 +0530 -+++ ./node.gyp 2023-04-20 18:05:13.232655507 +0530 -@@ -156,7 +156,8 @@ +--- ./node.gyp.orig 2023-05-16 12:28:21.000000000 +0530 ++++ ./node.gyp 2023-05-27 19:10:17.150845679 +0530 +@@ -466,7 +466,8 @@ ], 'sources': [ @@ -10,7 +10,7 @@ ], 'dependencies': [ -@@ -451,6 +452,7 @@ +@@ -761,6 +762,7 @@ 'include_dirs': [ 'src', 'deps/postject', @@ -18,7 +18,7 @@ '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h ], 'dependencies': [ -@@ -905,272 +907,6 @@ +@@ -947,294 +949,6 @@ }, ], }, # node_lib_target_name @@ -59,6 +59,10 @@ - [ 'OS!="linux" or ossfuzz!="true"', { - 'type': 'none', - }], +- # Avoid excessive LTO +- ['enable_lto=="true"', { +- 'ldflags': [ '-fno-lto' ], +- }], - ], - }, # fuzz_env - { @@ -125,6 +129,8 @@ - 'sources': [ - 'test/cctest/test_crypto_clienthello.cc', - 'test/cctest/test_node_crypto.cc', +- 'test/cctest/test_quic_cid.cc', +- 'test/cctest/test_quic_tokens.cc', - ] - }], - ['v8_enable_inspector==1', { @@ -159,6 +165,10 @@ - 'Ws2_32.lib', - ], - }], +- # Avoid excessive LTO +- ['enable_lto=="true"', { +- 'ldflags': [ '-fno-lto' ], +- }], - ], - }, # cctest - @@ -212,6 +222,10 @@ - 'Ws2_32.lib', - ], - }], +- # Avoid excessive LTO +- ['enable_lto=="true"', { +- 'ldflags': [ '-fno-lto' ], +- }], - ], - }, # embedtest - @@ -230,6 +244,10 @@ - 'test/overlapped-checker/main_unix.c' - ], - }], +- # Avoid excessive LTO +- ['enable_lto=="true"', { +- 'ldflags': [ '-fno-lto' ], +- }], - ] - }, # overlapped-checker - { @@ -286,6 +304,10 @@ - 'Ws2_32.lib', - ], - }], +- # Avoid excessive LTO +- ['enable_lto=="true"', { +- 'ldflags': [ '-fno-lto' ], +- }], - ], - }, # node_mksnapshot ], # end targets