nodejs-lts: Bump to latest 14.x (#7524)

This commit is contained in:
YAKSH BARIYA 2021-09-14 18:33:10 +05:30 committed by GitHub
parent f018360a18
commit ba717665bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 126 additions and 142 deletions

View File

@ -1,11 +1,12 @@
TERMUX_PKG_HOMEPAGE=https://nodejs.org/
TERMUX_PKG_DESCRIPTION="Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications"
TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environment"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=12.18.3
TERMUX_PKG_REVISION=3
TERMUX_PKG_MAINTAINER="Yaksh Bariya <yakshbari4@gmail.com>"
# Note: package build may fail on Github Actions CI due to out-of-memory
# condition. It should be built locally instead.
TERMUX_PKG_VERSION=14.17.6
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=71158026579487422fd13cc2553b34cddb76519098aa6030faab52f88c6e0d0e
TERMUX_PKG_SHA256=f458cd0b1cb1540611cb08709d833c0c59c74da79310ae1984cc8bad1404ad5e
# 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.
@ -17,6 +18,18 @@ TERMUX_PKG_SUGGESTS="clang, make, pkg-config, python"
TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
# Build fails on x86_64 with:
# g++ -rdynamic -m64 -pthread -m64 -fPIC -o /home/builder/.termux-build/nodejs/src/out/Release/mksnapshot ...
# /usr/bin/ld: /home/builder/.termux-build/nodejs/src/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/api/api.o:
# in function `v8::TryHandleWebAssemblyTrapPosix(int, siginfo_t*, void*)':
# api.cc:(.text._ZN2v829TryHandleWebAssemblyTrapPosixEiP9siginfo_tPv+0x5):
# undefined reference to `v8::internal::trap_handler::TryHandleSignal(int, siginfo_t*, void*)'
# /usr/bin/ld: /home/builder/.termux-build/nodejs/src/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/trap-handler/handler-outside.o:
# in function `v8::internal::trap_handler::EnableTrapHandler(bool)':
# handler-outside.cc:(.text._ZN2v88internal12trap_handler17EnableTrapHandlerEb+0x25):
# undefined reference to `v8::internal::trap_handler::RegisterDefaultTrapHandler()'
# collect2: error: ld returned 1 exit status
TERMUX_PKG_BLACKLISTED_ARCHES="x86_64"
termux_step_post_get_source() {
# Prevent caching of host build:
@ -74,12 +87,11 @@ termux_step_configure() {
--shared-openssl \
--shared-zlib \
--with-intl=system-icu \
--without-snapshot \
--without-node-snapshot \
--cross-compiling
export LD_LIBRARY_PATH=$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib
perl -p -i -e "s@LIBS := \\$\\(LIBS\\)@LIBS := -L$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib -lpthread -licui18n -licuuc -licudata@" \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/mksnapshot.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/torque.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/bytecode_builtins_list_generator.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/v8_libbase.host.mk \

View File

@ -1,12 +0,0 @@
diff -u -r ../node-v12.1.0/configure.py ./configure.py
--- ../node-v12.1.0/configure.py 2019-04-29 12:57:51.000000000 +0000
+++ ./configure.py 2019-05-05 21:21:04.289245037 +0000
@@ -931,7 +931,7 @@
else target_arch != host_arch)
want_snapshots = not options.without_snapshot
o['variables']['want_separate_host_toolset'] = int(
- cross_compiling and want_snapshots)
+ cross_compiling)
if options.with_node_snapshot:
o['variables']['node_use_node_snapshot'] = 'true'

View File

@ -0,0 +1,31 @@
diff -uNr node-v12.10.0/deps/uv/src/unix/process.c node-v12.10.0.mod/deps/uv/src/unix/process.c
--- node-v12.10.0/deps/uv/src/unix/process.c 2019-09-04 18:36:23.000000000 +0300
+++ node-v12.10.0.mod/deps/uv/src/unix/process.c 2019-09-23 01:39:39.069030779 +0300
@@ -351,27 +351,6 @@
_exit(127);
}
- if (options->flags & (UV_PROCESS_SETUID | UV_PROCESS_SETGID)) {
- /* When dropping privileges from root, the `setgroups` call will
- * remove any extraneous groups. If we don't call this, then
- * even though our uid has dropped, we may still have groups
- * that enable us to do super-user things. This will fail if we
- * aren't root, so don't bother checking the return value, this
- * is just done as an optimistic privilege dropping function.
- */
- SAVE_ERRNO(setgroups(0, NULL));
- }
-
- if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid)) {
- uv__write_int(error_fd, UV__ERR(errno));
- _exit(127);
- }
-
- if ((options->flags & UV_PROCESS_SETUID) && setuid(options->uid)) {
- uv__write_int(error_fd, UV__ERR(errno));
- _exit(127);
- }
-
if (options->env != NULL) {
environ = options->env;
}

View File

@ -1,7 +1,7 @@
diff -u -r ../node-v12.14.0/deps/uv/uv.gyp ./deps/uv/uv.gyp
--- ../node-v12.14.0/deps/uv/uv.gyp 2019-12-17 07:05:03.000000000 +0000
+++ ./deps/uv/uv.gyp 2020-01-02 19:42:31.757217000 +0000
@@ -40,7 +40,7 @@
diff -u -r ../node-v9.7.1/deps/uv/uv.gyp ./deps/uv/uv.gyp
--- ../node-v9.7.1/deps/uv/uv.gyp 2018-03-02 01:58:02.000000000 +0000
+++ ./deps/uv/uv.gyp 2018-03-05 10:51:15.530165566 +0000
@@ -39,7 +39,7 @@
{
'target_name': 'libuv',
'type': '<(uv_library)',
@ -10,7 +10,7 @@ diff -u -r ../node-v12.14.0/deps/uv/uv.gyp ./deps/uv/uv.gyp
'include',
'src/',
],
@@ -55,7 +55,7 @@
@@ -54,7 +54,7 @@
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],

View File

@ -1,12 +1,12 @@
diff -u -r ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h
--- ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h 2019-08-20 17:14:50.000000000 +0000
+++ ./deps/v8/src/flags/flag-definitions.h 2019-08-24 22:38:43.754905700 +0000
@@ -1373,7 +1373,7 @@
DEFINE_BOOL(perf_prof_unwinding_info, false,
"Enable unwinding info for perf linux profiler (experimental).")
DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info)
diff -u -r ../node-v14.0.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h
--- ../node-v14.0.0/deps/v8/src/flags/flag-definitions.h 2020-04-21 11:38:50.000000000 +0000
+++ ./deps/v8/src/flags/flag-definitions.h 2020-04-28 23:22:24.894254000 +0000
@@ -1555,7 +1555,7 @@
#undef DEFINE_PERF_PROF_BOOL
#undef DEFINE_PERF_PROF_IMPLICATION
-DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
+DEFINE_STRING(gc_fake_mmap, "/@TERMUX_PREFIX@/tmp/__v8_gc__",
+DEFINE_STRING(gc_fake_mmap, "@TERMUX_PREFIX@/tmp/__v8_gc__",
"Specify the name of the file for fake gc mmap used in ll_prof")
DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")
DEFINE_IMPLICATION(log_internal_timer_events, prof)

View File

@ -1,12 +1,11 @@
diff -u -r ../node-v10.9.0/lib/os.js ./lib/os.js
--- ../node-v10.9.0/lib/os.js 2018-08-15 13:53:34.000000000 +0000
+++ ./lib/os.js 2018-08-23 20:42:39.611186774 +0000
@@ -130,7 +130,7 @@
--- ./lib/os.js.orig 2021-09-14 11:38:18.226906330 +0530
+++ ./lib/os.js 2021-09-14 11:39:16.286906308 +0530
@@ -183,7 +183,7 @@
path = safeGetenv('TMPDIR') ||
safeGetenv('TMP') ||
safeGetenv('TEMP') ||
- '/tmp';
+ '@TERMUX_PREFIX@/tmp';
if (path.length > 1 && path.endsWith('/'))
path = path.slice(0, -1);
if (path.length > 1 && StringPrototypeEndsWith(path, '/'))
path = StringPrototypeSlice(path, 0, -1);
}

View File

@ -0,0 +1,36 @@
diff -uNr node-v14.0.0/deps/v8/BUILD.gn node-v14.0.0.mod/deps/v8/BUILD.gn
--- node-v14.0.0/deps/v8/BUILD.gn 2020-04-21 11:38:50.000000000 +0000
+++ node-v14.0.0.mod/deps/v8/BUILD.gn 2020-05-07 14:11:12.247429516 +0000
@@ -28,7 +28,7 @@
declare_args() {
# Print to stdout on Android.
- v8_android_log_stdout = false
+ v8_android_log_stdout = true
# Dynamically set an additional dependency from v8/custom_deps.
v8_custom_deps = ""
diff -uNr node-v14.0.0/deps/v8/infra/mb/mb_config.pyl node-v14.0.0.mod/deps/v8/infra/mb/mb_config.pyl
--- node-v14.0.0/deps/v8/infra/mb/mb_config.pyl 2020-04-21 11:38:50.000000000 +0000
+++ node-v14.0.0.mod/deps/v8/infra/mb/mb_config.pyl 2020-05-07 14:12:44.653746359 +0000
@@ -565,7 +565,7 @@
'mixins': {
'android': {
- 'gn_args': 'target_os="android" v8_android_log_stdout=true',
+ 'gn_args': 'target_os="android" v8_android_log_stdout=false',
},
'android_strip_outputs': {
diff -uNr node-v14.0.0/src/debug_utils.cc node-v14.0.0.mod/src/debug_utils.cc
--- node-v14.0.0/src/debug_utils.cc 2020-04-21 11:38:51.000000000 +0000
+++ node-v14.0.0.mod/src/debug_utils.cc 2020-05-07 14:12:00.694741330 +0000
@@ -500,7 +500,7 @@
WriteConsoleW(handle, wbuf.data(), n, nullptr, nullptr);
return;
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) && !defined(__TERMUX__)
if (file == stderr) {
__android_log_print(ANDROID_LOG_ERROR, "nodejs", "%s", str.data());
return;

View File

@ -1,10 +1,17 @@
diff -uNr node-v12.18.1/node.gyp node-v12.18.1.mod/node.gyp
--- node-v12.18.1/node.gyp 2020-06-17 04:25:39.000000000 +0300
+++ node-v12.18.1.mod/node.gyp 2020-06-21 20:33:32.686358740 +0300
@@ -1100,101 +1100,6 @@
} ],
]
}, # specialize_node_d
--- ./node.gyp.orig 2021-08-30 23:04:29.000000000 +0530
+++ ./node.gyp 2021-09-14 14:06:54.617184886 +0530
@@ -550,6 +550,7 @@
'include_dirs': [
'src',
+ 'deps/cares/src/lib',
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
],
'dependencies': [
@@ -1215,101 +1216,6 @@
}],
],
}, # fuzz_env
- {
- 'target_name': 'cctest',
- 'type': 'executable',
@ -101,5 +108,5 @@ diff -uNr node-v12.18.1/node.gyp node-v12.18.1.mod/node.gyp
- ],
- }, # cctest
# TODO(joyeecheung): do not depend on node_lib,
# instead create a smaller static library node_lib_base that does
{
'target_name': 'embedtest',

View File

@ -1,12 +0,0 @@
diff -u -r ../node-v6.0.0/src/cares_wrap.cc ./src/cares_wrap.cc
--- ../node-v6.0.0/src/cares_wrap.cc 2016-04-26 15:50:22.000000000 -0400
+++ ./src/cares_wrap.cc 2016-05-02 00:24:26.349502775 -0400
@@ -15,8 +15,7 @@
#include <stdlib.h>
#include <string.h>
-#if defined(__ANDROID__) || \
- defined(__MINGW32__) || \
+#if defined(__MINGW32__) || \
defined(__OpenBSD__) || \
defined(_MSC_VER)

View File

@ -1,11 +1,10 @@
diff -u -r ../node-v12.9.0/tools/v8_gypfiles/v8.gyp ./tools/v8_gypfiles/v8.gyp
--- ../node-v12.9.0/tools/v8_gypfiles/v8.gyp 2019-08-20 17:14:53.000000000 +0000
+++ ./tools/v8_gypfiles/v8.gyp 2019-08-24 22:02:57.943558855 +0000
@@ -1010,6 +1010,7 @@
--- ./tools/v8_gypfiles/v8.gyp 2021-06-03 07:15:33.000000000 +0530
+++ ./tools/v8_gypfiles/v8.gyp.mod 2021-06-18 21:18:09.722327631 +0530
@@ -928,6 +928,7 @@
'<(V8_ROOT)/src/base/platform/platform-posix.h',
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
'<(V8_ROOT)/src/base/platform/platform-posix-time.h',
+ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
+ '<(V8_ROOT)/src/base/platform/platform-linux.h',
],
'conditions': [
['_toolset=="host"', {
'link_settings': {
'target_conditions': [

View File

@ -1,76 +0,0 @@
--- ./deps/v8/src/objects/js-list-format.cc 2021-06-16 19:23:07.331725972 +0530
+++ ./deps/v8/src/objects/js-list-format.cc.mod 2021-06-16 20:40:50.674620156 +0530
@@ -29,46 +29,27 @@
namespace internal {
namespace {
-const char* kStandard = "standard";
-const char* kOr = "or";
-const char* kUnit = "unit";
-const char* kStandardShort = "standard-short";
-const char* kOrShort = "or-short";
-const char* kUnitShort = "unit-short";
-const char* kStandardNarrow = "standard-narrow";
-const char* kOrNarrow = "or-narrow";
-const char* kUnitNarrow = "unit-narrow";
-
-const char* GetIcuStyleString(JSListFormat::Style style,
- JSListFormat::Type type) {
- switch (type) {
+
+UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
+ switch (style) {
+ case JSListFormat::Style::LONG:
+ return ULISTFMT_WIDTH_WIDE;
+ case JSListFormat::Style::SHORT:
+ return ULISTFMT_WIDTH_SHORT;
+ case JSListFormat::Style::NARROW:
+ return ULISTFMT_WIDTH_NARROW;
+ }
+ UNREACHABLE();
+}
+
+UListFormatterType GetIcuType(JSListFormat::Type type) {
+ switch (type ) {
case JSListFormat::Type::CONJUNCTION:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kStandard;
- case JSListFormat::Style::SHORT:
- return kStandardShort;
- case JSListFormat::Style::NARROW:
- return kStandardNarrow;
- }
+ return ULISTFMT_TYPE_AND;
case JSListFormat::Type::DISJUNCTION:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kOr;
- case JSListFormat::Style::SHORT:
- return kOrShort;
- case JSListFormat::Style::NARROW:
- return kOrNarrow;
- }
+ return ULISTFMT_TYPE_OR;
case JSListFormat::Type::UNIT:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kUnit;
- case JSListFormat::Style::SHORT:
- return kUnitShort;
- case JSListFormat::Style::NARROW:
- return kUnitNarrow;
- }
+ return ULISTFMT_TYPE_UNITS;
}
UNREACHABLE();
}
@@ -170,7 +151,7 @@
icu::Locale icu_locale = r.icu_locale;
UErrorCode status = U_ZERO_ERROR;
icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
- icu_locale, GetIcuStyleString(style_enum, type_enum), status);
+ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
if (U_FAILURE(status)) {
delete formatter;
FATAL("Failed to create ICU list formatter, are ICU data files missing?");