upgpkg(main/nodejs): update to v18.3.0

Also patches for tests have been commited which I had since a while but
never made them public.
This commit is contained in:
Yaksh Bariya 2022-06-04 12:12:48 +05:30
parent 0d95692efb
commit a765ae2ba1
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
13 changed files with 289 additions and 30 deletions

View File

@ -2,10 +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 <yakshbari4@gmail.com>"
TERMUX_PKG_VERSION=18.2.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_VERSION=18.3.0
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=2305b15ebf5547474e905b5002f9ba99c7eeef01d7394dfe6f3846cc6bcad66d
TERMUX_PKG_SHA256=3f694a81626e5057cda57898e771d213cfc5a649855f4cf1c6f6cd150c530625
# 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.

View File

@ -1,6 +1,6 @@
--- node-v18.0.0.orig/node.gyp 2022-04-21 15:15:48.561869784 +0530
+++ node-v18.0.0/node.gyp 2022-05-19 18:01:39.524596955 +0530
@@ -158,7 +158,8 @@
--- ./node.gyp.orig 2022-06-02 07:52:24.000000000 +0530
+++ ./node.gyp 2022-06-04 12:08:56.649547879 +0530
@@ -157,7 +157,8 @@
],
'sources': [
@ -10,7 +10,7 @@
],
'dependencies': [
@@ -461,6 +462,7 @@
@@ -452,6 +453,7 @@
'include_dirs': [
'src',
@ -18,10 +18,83 @@
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
],
'dependencies': [
@@ -1183,162 +1185,6 @@
}],
],
}, # fuzz_env
@@ -1104,306 +1106,6 @@
} ],
]
}, # specialize_node_d
- { # fuzz_url
- 'target_name': 'fuzz_url',
- 'type': 'executable',
- 'dependencies': [
- '<(node_lib_target_name)',
- ],
- 'includes': [
- 'node.gypi'
- ],
- 'include_dirs': [
- 'src',
- ],
- 'defines': [
- 'NODE_ARCH="<(target_arch)"',
- 'NODE_PLATFORM="<(OS)"',
- 'NODE_WANT_INTERNALS=1',
- ],
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'test/fuzzers/fuzz_url.cc',
- ],
- 'conditions': [
- ['OS=="linux"', {
- 'ldflags': [ '-fsanitize=fuzzer' ]
- }],
- # Ensure that ossfuzz flag has been set and that we are on Linux
- [ 'OS!="linux" or ossfuzz!="true"', {
- 'type': 'none',
- }],
- ],
- }, # fuzz_url
- { # fuzz_env
- 'target_name': 'fuzz_env',
- 'type': 'executable',
- 'dependencies': [
- '<(node_lib_target_name)',
- 'deps/histogram/histogram.gyp:histogram',
- 'deps/uvwasi/uvwasi.gyp:uvwasi',
- 'node_dtrace_header',
- 'node_dtrace_ustack',
- 'node_dtrace_provider',
- ],
- 'includes': [
- 'node.gypi'
- ],
- 'include_dirs': [
- 'src',
- 'tools/msvs/genfiles',
- 'deps/v8/include',
- 'deps/cares/include',
- 'deps/uv/include',
- 'deps/uvwasi/include',
- 'test/cctest',
- ],
- 'defines': [
- 'NODE_ARCH="<(target_arch)"',
- 'NODE_PLATFORM="<(OS)"',
- 'NODE_WANT_INTERNALS=1',
- ],
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'test/fuzzers/fuzz_env.cc',
- ],
- 'conditions': [
- ['OS=="linux"', {
- 'ldflags': [ '-fsanitize=fuzzer' ]
- }],
- # Ensure that ossfuzz flag has been set and that we are on Linux
- [ 'OS!="linux" or ossfuzz!="true"', {
- 'type': 'none',
- }],
- ],
- }, # fuzz_env
- {
- 'target_name': 'cctest',
- 'type': 'executable',
@ -59,7 +132,6 @@
-
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'src/node_code_cache_stub.cc',
- 'test/cctest/node_test_fixture.cc',
- 'test/cctest/node_test_fixture.h',
- 'test/cctest/test_aliased_buffer.cc',
@ -152,7 +224,6 @@
-
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'src/node_code_cache_stub.cc',
- 'test/embedding/embedtest.cc',
- ],
-
@ -178,15 +249,24 @@
- }],
- ],
- }, # embedtest
{
'target_name': 'overlapped-checker',
@@ -1417,59 +1263,13 @@
'Ws2_32.lib',
],
}],
- ],
- }, # mkcodecache
-
- {
- 'target_name': 'overlapped-checker',
- 'type': 'executable',
-
- 'conditions': [
- ['OS=="win"', {
- 'sources': [
- 'test/overlapped-checker/main_win.c'
- ],
- }],
- ['OS!="win"', {
- 'sources': [
- 'test/overlapped-checker/main_unix.c'
- ],
- }],
- ]
- }, # overlapped-checker
- {
- 'target_name': 'node_mksnapshot',
- 'type': 'executable',
@ -214,7 +294,6 @@
-
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'src/node_code_cache_stub.cc',
- 'tools/snapshot/node_mksnapshot.cc',
- ],
-
@ -224,23 +303,25 @@
- 'HAVE_OPENSSL=1',
- ],
- }],
- [ 'node_use_node_code_cache=="true"', {
- 'defines': [
- 'NODE_USE_NODE_CODE_CACHE=1',
- ],
- }],
- ['v8_enable_inspector==1', {
- 'defines': [
- 'HAVE_INSPECTOR=1',
- ],
- }],
- ['OS=="win"', {
+ ['target_arch=="ia32"', {
'libraries': [
- 'libraries': [
- 'Dbghelp.lib',
- 'winmm.lib',
- 'Ws2_32.lib',
+ '-latomic',
],
}],
],
- ],
- }],
- ],
- }, # node_mksnapshot
+ }, # mkcodecache
], # end targets
'conditions': [

View File

@ -0,0 +1,12 @@
--- ./src/node_report.cc.orig 2022-06-04 20:28:45.524998388 +0530
+++ ./src/node_report.cc 2022-06-04 20:30:09.764998356 +0530
@@ -425,6 +425,9 @@
}
writer->json_arrayend();
uv_free_cpu_info(cpu_info, count);
+ } else {
+ writer->json_arraystart("cpus");
+ writer->json_arrayend();
}
}

View File

@ -0,0 +1,17 @@
--- ./test/parallel/test-blob-buffer-too-large.js.orig 2022-06-05 08:43:15.647600971 +0530
+++ ./test/parallel/test-blob-buffer-too-large.js 2022-06-05 08:55:58.717600680 +0530
@@ -4,10 +4,14 @@
const common = require('../common');
const assert = require('assert');
const { Blob } = require('buffer');
+const { platform } = require('os');
if (common.isFreeBSD)
common.skip('Oversized buffer make the FreeBSD CI runner crash');
+if (platform() === 'android')
+ common.skip('Android will kill heavy memory using processes sometimes crashing Termux');
+
try {
new Blob([new Uint8Array(0xffffffff), [1]]);
} catch (e) {

View File

@ -0,0 +1,11 @@
--- ./test/parallel/test-child-process-exec-env.js.orig 2022-06-05 08:57:52.717600637 +0530
+++ ./test/parallel/test-child-process-exec-env.js 2022-06-05 09:02:24.887600533 +0530
@@ -44,7 +44,7 @@
}
if (!isWindows) {
- child = exec('/usr/bin/env', { env: { 'HELLO': 'WORLD' } }, after);
+ child = exec('@TERMUX_PREFIX@/bin/env', { env: { 'HELLO': 'WORLD' } }, after);
} else {
child = exec('set',
{ env: { ...process.env, 'HELLO': 'WORLD' } },

View File

@ -0,0 +1,11 @@
--- ./test/parallel/test-child-process-spawnsync-shell.js.orig 2022-06-05 08:34:30.587601172 +0530
+++ ./test/parallel/test-child-process-spawnsync-shell.js 2022-06-05 08:34:48.497601165 +0530
@@ -82,7 +82,7 @@
test('darwin', '/bin/csh', '/bin/csh');
// Test Android platforms.
- test('android', true, '/system/bin/sh');
+ test('android', true, '@TERMUX_PREFIX@/bin/sh');
// Test Windows platforms with a user specified shell.
test('win32', 'powershell.exe', 'powershell.exe');

View File

@ -0,0 +1,17 @@
--- ./test/parallel/test-child-process-stdio-overlapped.js.orig 2022-06-05 09:57:50.337599264 +0530
+++ ./test/parallel/test-child-process-stdio-overlapped.js 2022-06-05 10:12:13.197598935 +0530
@@ -28,10 +28,13 @@
const assert = require('assert');
const path = require('path');
const child_process = require('child_process');
+const { mkdtempSync } = require('fs')
const exeExtension = process.platform === 'win32' ? '.exe' : '';
const exe = 'overlapped-checker' + exeExtension;
-const exePath = path.join(path.dirname(process.execPath), exe);
+const exePath = path.join(mkdtempSync(process.env.TMPDIR + '/' || '@TERMUX_PREFIX@/tmp/'), exe);
+
+child_process.spawnSync('clang', ['-O3', 'test/overlapped-checker/main_unix.c', '-o', exePath]);
const child = child_process.spawn(exePath, [], {
stdio: ['overlapped', 'pipe', 'pipe']

View File

@ -0,0 +1,19 @@
--- ./test/parallel/test-dgram-bind-fd.js.orig 2022-06-05 10:30:47.907598510 +0530
+++ ./test/parallel/test-dgram-bind-fd.js 2022-06-05 10:31:18.697598498 +0530
@@ -7,6 +7,7 @@
const assert = require('assert');
const dgram = require('dgram');
const { internalBinding } = require('internal/test/binding');
+const { platform } = require('os');
const { UDP } = internalBinding('udp_wrap');
const { UV_UDP_REUSEADDR } = require('os').constants;
@@ -77,7 +78,7 @@
const sendBufferSize = socket.getSendBufferSize();
// note: linux will double the buffer size
- const expectedBufferSize = common.isLinux ?
+ const expectedBufferSize = (common.isLinux || platform() === 'android') ?
BUFFER_SIZE * 2 : BUFFER_SIZE;
assert.strictEqual(recvBufferSize, expectedBufferSize);
assert.strictEqual(sendBufferSize, expectedBufferSize);

View File

@ -0,0 +1,40 @@
--- ./test/parallel/test-dgram-membership.js.orig 2022-06-05 10:44:44.687598191 +0530
+++ ./test/parallel/test-dgram-membership.js 2022-06-05 10:46:16.867598156 +0530
@@ -3,6 +3,7 @@
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');
+const { platform } = require('os');
const multicastAddress = '224.0.0.114';
const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true });
@@ -106,11 +107,12 @@
// addSourceSpecificMembership with invalid groupAddress should throw
{
const socket = setup();
+ const errCode = platform() === 'android' ? 'ENOSYS' : 'EINVAL';
assert.throws(() => {
socket.addSourceSpecificMembership(multicastAddress, '0');
}, {
- code: 'EINVAL',
- message: 'addSourceSpecificMembership EINVAL'
+ code: errCode,
+ message: `addSourceSpecificMembership ${errCode}`
});
socket.close();
}
@@ -144,11 +146,12 @@
// dropSourceSpecificMembership with invalid UDP should throw
{
const socket = setup();
+ const errCode = platform() === 'android' ? 'ENOSYS' : 'EINVAL';
assert.throws(() => {
socket.dropSourceSpecificMembership(multicastAddress, '0');
}, {
- code: 'EINVAL',
- message: 'dropSourceSpecificMembership EINVAL'
+ code: errCode,
+ message: `dropSourceSpecificMembership ${errCode}`
});
socket.close();
}

View File

@ -0,0 +1,19 @@
--- ./test/parallel/test-dgram-socket-buffer-size.js.orig 2022-06-05 10:48:41.037598101 +0530
+++ ./test/parallel/test-dgram-socket-buffer-size.js 2022-06-05 10:48:52.537598096 +0530
@@ -6,6 +6,7 @@
const dgram = require('dgram');
const { inspect } = require('util');
const { internalBinding } = require('internal/test/binding');
+const { platform } = require('os');
const {
UV_EBADF,
UV_EINVAL,
@@ -115,7 +116,7 @@
socket.setSendBufferSize(10000);
// note: linux will double the buffer size
- const expectedBufferSize = common.isLinux ? 20000 : 10000;
+ const expectedBufferSize = (common.isLinux || platform() === 'android') ? 20000 : 10000;
assert.strictEqual(socket.getRecvBufferSize(), expectedBufferSize);
assert.strictEqual(socket.getSendBufferSize(), expectedBufferSize);
socket.close();

View File

@ -0,0 +1,11 @@
--- ./test/parallel/test-gc-http-client-connaborted.js.orig 2022-06-05 08:39:51.327601049 +0530
+++ ./test/parallel/test-gc-http-client-connaborted.js 2022-06-05 08:40:14.897601040 +0530
@@ -8,7 +8,7 @@
const http = require('http');
const os = require('os');
-const cpus = os.cpus().length;
+const cpus = os.numcpus();
let createClients = true;
let done = 0;
let count = 0;

View File

@ -0,0 +1,11 @@
--- ./test/sequential/test-gc-http-client-onerror.js.orig 2022-06-05 10:18:02.427598802 +0530
+++ ./test/sequential/test-gc-http-client-onerror.js 2022-06-05 10:18:17.627598796 +0530
@@ -6,7 +6,7 @@
const common = require('../common');
const onGC = require('../common/ongc');
-const cpus = require('os').cpus().length;
+const cpus = require('os').numcpus();
function serverHandler(req, res) {
req.resume();

View File

@ -0,0 +1,11 @@
--- ./test/sequential/test-gc-http-client.js.orig 2022-06-05 10:17:44.127598809 +0530
+++ ./test/sequential/test-gc-http-client.js 2022-06-05 10:17:53.947598805 +0530
@@ -5,7 +5,7 @@
const common = require('../common');
const onGC = require('../common/ongc');
-const cpus = require('os').cpus().length;
+const cpus = require('os').numcpus();
function serverHandler(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });