Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v18.10.0 proposal #44799

Merged
merged 106 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
1315a83
build: fix bad upstream merge
sgallagher Sep 14, 2022
d8d34ae
lib: reset `RegExp` statics before running user code
aduh95 Aug 5, 2022
667e8bf
stream: fix `writableStream.abort()`
daeyeon Sep 5, 2022
01e584e
doc: move policy docs to the permissions scope
RafaelGSS Sep 5, 2022
eb25fe7
test: add more cases for parse-encoding
tony-go Sep 6, 2022
20e04c6
test: fix DebugSymbolsTest.ReqWrapList on PPC64LE
danbev Aug 22, 2022
19f67db
bootstrap: remove unused global parameter in per-context scripts
joyeecheung Sep 1, 2022
4e6f786
doc: document attribute Script.cachedDataRejected
legendecas Sep 6, 2022
3cc8f4b
deps: update to uvwasi 0.0.13
cjihrig Sep 5, 2022
2baf532
lib: fix reference leak
falsandtru Sep 7, 2022
9c5c145
bootstrap: clean up inspector console methods during serialization
joyeecheung Sep 7, 2022
6878448
src: consolidate environment cleanup queue
legendecas Aug 24, 2022
9aa6a56
v8: add setHeapSnapshotNearHeapLimit
theanarkh Sep 8, 2022
5db9779
tools: fix shebang to use python3 by default
himself65 Sep 8, 2022
a733f7f
Revert "build: go faster, drop -fno-omit-frame-pointer"
bnoordhuis Sep 8, 2022
a3360b1
doc: emphasize that createCipher is never secure
tniessen Sep 8, 2022
2f2f8d5
stream: add `ReadableByteStream.tee()`
daeyeon Sep 8, 2022
0af6e42
stream: remove `abortReason` from `WritableStreamDefaultController`
daeyeon Sep 9, 2022
f5549af
doc: remove ebpf from supported tooling list
RafaelGSS Sep 9, 2022
6c35f33
test: use python3 instead of python
lpinca Sep 10, 2022
39b65d2
doc: do not use weak MODP group in example
tniessen Sep 10, 2022
993bd9b
crypto: restrict PBKDF2 args to signed int
tniessen Sep 10, 2022
f8ec946
module: exports & imports map invalid slash deprecation
guybedford Sep 11, 2022
fe56efd
meta: update AUTHORS
nodejs-github-bot Sep 11, 2022
ea7b44d
doc: fix link in `process.md`
aduh95 Sep 11, 2022
2813323
doc: mention how to get commit release
RafaelGSS Sep 11, 2022
caad474
tools: increase timeout of running WPT
joyeecheung Sep 11, 2022
70898b4
build: rewritten the Android build system
MeowShe Sep 12, 2022
48d944b
doc: fix vm.Script createCachedData example
legendecas Sep 12, 2022
6c55734
doc: fix errors in http.md
lpinca Sep 12, 2022
0370563
doc: fix heading levels for test runner hooks
meyfa Sep 12, 2022
2d92610
doc: remove old OpenSSL ENGINE constants
tniessen Sep 12, 2022
4ad1b0a
doc: deprecate modp1, modp2, and modp5 groups
tniessen Sep 12, 2022
7db2974
test: ignore stale process cleanup failures on Windows
joyeecheung Sep 13, 2022
1b16051
inspector: expose inspector.close on workers
legendecas Sep 13, 2022
360b74e
win: fix fs.realpath.native for long paths
StefanStojanovic Sep 13, 2022
729dd95
dns: refactor default resolver
joyeecheung Sep 13, 2022
81ea507
src: dump isolate stats when process exits
qdaoming Sep 13, 2022
73ad9db
stream: refactor use es2020 statement
xtx1130 Sep 6, 2022
0c9a946
benchmark: add stream destroy benchmark
xtx1130 Sep 7, 2022
5dd86c3
tools: update lint-md-dependencies to @rollup/plugin-node-resolve@14.0.1
nodejs-github-bot Sep 13, 2022
c12abb5
src: make NearHeapLimitCallback() more robust
joyeecheung Sep 13, 2022
5ae142d
tools: update gyp-next to v0.13.0
gengjiawen Sep 14, 2022
9da1142
build: remove redundant entry in crypto
gengjiawen Sep 14, 2022
75cfb13
src: make ReqWrap weak
RafaelGSS Sep 14, 2022
3f710fa
doc: remove empty line in YAML block
ovflowd Sep 14, 2022
85ab2f8
fs: remove unused option in `fs.fstatSync()`
LiviaMedeiros Sep 14, 2022
226d90a
doc: use serial comma in stream docs
daeyeon Sep 14, 2022
5ab3bc9
test_runner: include stack of uncaught exceptions
MoLow Sep 14, 2022
29f57b7
src: avoid copy when creating Blob
tniessen Sep 14, 2022
a3095d2
test: fix `test-repl` not validating leaked globals properly
aduh95 Sep 14, 2022
b9cfb71
tools: update lint-md-dependencies to @rollup/plugin-node-resolve@14.1.0
nodejs-github-bot Sep 15, 2022
3dabb44
doc: use serial comma in report docs
daeyeon Sep 15, 2022
dd43489
tools: update eslint to 8.23.1
nodejs-github-bot Sep 15, 2022
c62dfe0
meta: update test_runner in label-pr-config
shrujalshah28 Sep 15, 2022
9341fb4
doc: remove comma in README.md
Taha-Chaudhry Sep 15, 2022
eb36351
lib,test: fix bug in InternalSocketAddress
tniessen Sep 15, 2022
752e147
tls: fix out-of-bounds read in ClientHelloParser
tniessen Sep 15, 2022
c209bd6
doc,inspector: document changes of inspector.close
legendecas Sep 13, 2022
55de013
test: improve lib/readline.js coverage
fossamagna Sep 15, 2022
0df181a
tools: add timezone update workflow
98lenvi Sep 15, 2022
ef0dc47
tools: fix typo in update-nghttp2.sh
lpinca Sep 16, 2022
ec1cbdb
doc: add legendecas to TSC list
mhdawson Sep 15, 2022
8a68a80
test: fix test-performance-measure
smitley Sep 14, 2022
05b17e9
doc: maintain only one list of MODP groups
tniessen Sep 17, 2022
b209c83
doc: improve building doc for Windows Powershell
bmuenzenmeyer Sep 13, 2022
4686579
dns: remove unnecessary parameter from validateOneOf
anonrig Sep 17, 2022
7129106
deps: upgrade npm to 8.19.2
npm-cli-bot Sep 17, 2022
6ef9af2
doc: make legacy banner slightly less bright
Trott Sep 17, 2022
c5c1bc4
meta: move dnlup to emeriti
dnlup Sep 18, 2022
f158656
http: throw error on content-length mismatch
sidwebworks Aug 24, 2022
d36c4a3
deps: update ngtcp2 update instructions
tniessen Sep 18, 2022
8da1d6e
deps: update corepack to 0.14.1
nodejs-github-bot Sep 18, 2022
4436ffb
module: open stat/readPackage to mutations
arcanis Sep 18, 2022
ca5fb67
deps: update to ngtcp2 0.8.1 and nghttp3 0.7.0
tniessen Sep 18, 2022
3036b85
src: remove <unistd.h> from node_os.cc
tniessen Sep 18, 2022
35fbd2c
meta: update AUTHORS
nodejs-github-bot Sep 18, 2022
0cddb0a
tools: add update-llhttp.sh
ShogunPanda Sep 15, 2022
97d2ed7
meta: add mailmap entry for dnlup
Trott Sep 19, 2022
9b3b7d6
esm,loader: tidy ESMLoader internals
JakobJingleheimer Sep 19, 2022
64cb43a
node-api: add deprecation code of uncaught exception
legendecas Sep 13, 2022
82cb815
doc: remove extra space on threadpool usage
connorjburton Sep 20, 2022
4dbe4a0
doc: mention where to push security commits
RafaelGSS Sep 16, 2022
a6091f5
gyp: libnode for ios app embedding
chexiongsheng Sep 21, 2022
ce1704c
src: avoid using v8 on Isolate termination
santigimeno Sep 21, 2022
10a0d75
doc: include code examples for webstreams consumers
khaosdoctor Aug 24, 2022
f497368
benchmark: fix startup benchmark
evanlucas Sep 21, 2022
57dac53
doc,crypto: cleanup removed pbkdf2 behaviours
panva Sep 22, 2022
a56cb65
test: fix addon tests compilation with OpenSSL 1.1.1
AdamMajer Sep 22, 2022
33a2f17
doc: add registry number for Electron 22
VerteDinde Sep 23, 2022
3d42aaa
stream: handle a pending pull request from a released reader
daeyeon Sep 23, 2022
79f0f48
test: change promise to async/await in debugger-watcher
Pooja444 Sep 16, 2022
064543d
doc: update guidance for adding new modules
mhdawson Sep 8, 2022
2502f23
doc: update the deprecation for exit code to clarify its scope
daeyeon Sep 24, 2022
74dc4d1
meta: update AUTHORS
nodejs-github-bot Sep 25, 2022
945aa74
test: check that sysconf returns a positive value
tniessen Sep 25, 2022
a2eb55a
lib: don't match `sourceMappingURL` in strings
alan-agius4 Sep 16, 2022
6c9ded8
test: update test-debugger-low-level to use await/async
ml7181 Sep 25, 2022
858631f
test: use async/await in test-debugger-invalid-args
nupurchauhan6 Sep 25, 2022
f274b08
doc: fix description for `napi_get_cb_info()` in `n-api.md`
daeyeon Sep 26, 2022
b512436
test: change promises to async/await
MadhulikaSharma95 Sep 26, 2022
daf63d2
fs: fix typo in mkdir example
SergeyTsukanov Sep 26, 2022
3112d5d
test: verify napi_remove_wrap with napi_delete_reference
legendecas Sep 26, 2022
fd971f5
doc: ensure to revert node_version changes
RafaelGSS Sep 23, 2022
6dc0382
doc: mention git node backport
RafaelGSS Sep 23, 2022
bdf069b
2022-09-28, Version 18.10.0 (Current)
RafaelGSS Sep 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/label-pr-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ subSystemLabels:
/^lib\/internal\/url\.js$/: whatwg-url
/^lib\/internal\/modules\/esm/: esm
/^lib\/internal\/webstreams/: web streams
/^lib\/internal\/test_runner/: dont-land-on-v14.x

# All other lib/ files map directly
/^lib\/_(\w+)_\w+\.js?$/: $1 # e.g. _(stream)_wrap
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/timezone-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Timezone update
on:
schedule:
# Run once a week at 00:05 AM UTC on Sunday.
- cron: 5 0 * * 0

workflow_dispatch:

jobs:
timezone_update:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest

steps:
- name: Checkout nodejs/node
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Checkout unicode-org/icu-data
uses: actions/checkout@v3
with:
path: icu-data
persist-credentials: false
repository: unicode-org/icu-data

- run: ./tools/update-timezone.mjs

- name: Open Pull Request
uses: gr2m/create-or-update-pull-request-action@6720400cad8e74d7adc64640e4e6ea6748b83d8f # Create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
body: |
This PR was generated by tools/timezone-update.yml.

Updates the ICU files as per the instructions present in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining-icu.md#time-zone-data

To test, build node off this branch & log the version of tz using
```js
console.log(process.versions.tz)
```
branch: actions/timezone-update
commit-message: 'deps: update timezone'
labels: dependencies
title: 'deps: update timezone'
reviewers: \@nodejs/i18n-api
3 changes: 2 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ David Mark Clements <david.clements@nearform.com> <huperekchuno@googlemail.com>
David Siegel <david@artcom.de> <david.siegel@artcom.de>
DC <dcposch@dcpos.ch>
Deepjyoti Mondal <djmdeveloper060796@gmail.com>
dnlup <dnlup.dev@gmail.com> <dwon.dnl@gmail.com>
Domenic Denicola <domenic@domenicdenicola.com>
Domenic Denicola <domenic@domenicdenicola.com> <d@domenic.me>
Doug Wade <doug@dougwade.io> <doug.wade@redfin.com>
Expand Down Expand Up @@ -200,7 +201,6 @@ Hannes Magnusson <hannes.magnusson@gmail.com> <hannes.magnusson@creditkarma.com>
Hassaan Pasha <pasha.hassaan@gmail.com> <hassaan.pasha@teamo.io>
Hendrik Schwalm <mail@hendrikschwalm.de>
Henry Chin <hheennrryy@gmail.com>
Nick Sia <nicholas.sia@vgw.co> <31839263+nicksia-vgw@users.noreply.github.com>
Herbert Vojčík <herby@mailbox.sk>
Hitesh Kanwathirtha <hiteshk@microsoft.com> <digitalinfinity@gmail.com>
Icer Liang <liangshuangde@163.com> <wizicer@users.noreply.github.com>
Expand Down Expand Up @@ -374,6 +374,7 @@ Nam Nguyen <nam.nguyen@de.ibm.com>
Nebu Pookins <nebu@nebupookins.net>
Netto Farah <nettofarah@gmail.com>
Nicholas Kinsey <pyrotechnick@feistystudios.com>
Nick Sia <nicholas.sia@vgw.co> <31839263+nicksia-vgw@users.noreply.github.com>
Nick Soggin <nicksoggin@gmail.com> <iSkore@users.noreply.github.com>
Nigel Kibodeaux <nigelmail@gmail.com> <nigel@team.about.me>
Nikola Glavina <glavina.nikola5@gmail.com> <nikola.glavina@student.um.si>
Expand Down
16 changes: 15 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,7 @@ Yann Hamon <yann.hamon@contentful.com>
Ben Swinburne <ben.swinburne@gmail.com>
Colin Prince <col@colinprince.com>
TJKoury <TJKoury@gmail.com>
dnlup <dwon.dnl@gmail.com>
dnlup <dnlup.dev@gmail.com>
Hang Jiang <jianghangscu@gmail.com>
Vladislav Kaminsky <wlodzislav@outlook.com>
Daiki Ihara <sasurau4@gmail.com>
Expand Down Expand Up @@ -3514,5 +3514,19 @@ Jeff Dickey <216188+jdxcode@users.noreply.github.com>
Matías Zúñiga <matias.nicolas.zc@gmail.com>
metonym <ericyl.us@gmail.com>
Brian Evans <53117772+mrbrianevans@users.noreply.github.com>
falsandtru <falsandtru@users.noreply.github.com>
东灯 <43312495+Lampese@users.noreply.github.com>
Fabian Meyer <3982806+meyfa@users.noreply.github.com>
StefanStojanovic <StefanStojanovic@users.noreply.github.com>
Claudio Wunder <cwunder@gnome.org>
Shrujal Shah <shrujalshah@hotmail.com>
Taha-Chaudhry <46199675+Taha-Chaudhry@users.noreply.github.com>
smitley <brandon.smitley@gmail.com>
Brian Muenzenmeyer <Brian.Muenzenmeyer@target.com>
sidwebworks <xodedeveloper@gmail.com>
Connor Burton <me@connorburton.com>
chexiongsheng <chexiongsheng@qq.com>
Lucas Santos <lhs.santoss@gmail.com>
“Pooja <pakcutie14@gmail.com>

# Generated by tools/update-authors.mjs
1 change: 1 addition & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ Set-ExecutionPolicy Unrestricted -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1'))
get-boxstarter -Force
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -DisableReboots
refreshenv
```

The entire installation using Boxstarter will take up approximately 10 GB of
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.9.1">18.9.1</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.10.0">18.10.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.9.1">18.9.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.9.0">18.9.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.8.0">18.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.7.0">18.7.0</a><br/>
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Node.js

Node.js is an open-source, cross-platform, JavaScript runtime environment.
Node.js is an open-source, cross-platform JavaScript runtime environment.

For information on using Node.js, see the [Node.js website][].

Expand Down Expand Up @@ -178,6 +178,8 @@ For information about the governance of the Node.js project, see
**James M Snell** <<jasnell@gmail.com>> (he/him)
* [joyeecheung](https://github.com/joyeecheung) -
**Joyee Cheung** <<joyeec9h3@gmail.com>> (she/her)
* [legendecas](https://github.com/legendecas) -
**Chengzhong Wu** <<legendecas@gmail.com>> (he/him)
* [mcollina](https://github.com/mcollina) -
**Matteo Collina** <<matteo.collina@gmail.com>> (he/him)
* [mhdawson](https://github.com/mhdawson) -
Expand Down Expand Up @@ -310,8 +312,6 @@ For information about the governance of the Node.js project, see
**Gus Caplan** <<me@gus.host>> (they/them)
* [dmabupt](https://github.com/dmabupt) -
**Xu Meng** <<dmabupt@gmail.com>> (he/him)
* [dnlup](https://github.com/dnlup)
**Daniele Belardi** <<dwon.dnl@gmail.com>> (he/him)
* [edsadr](https://github.com/edsadr) -
**Adrian Estrada** <<edsadr@gmail.com>> (he/him)
* [erickwendel](https://github.com/erickwendel) -
Expand Down Expand Up @@ -494,6 +494,8 @@ For information about the governance of the Node.js project, see
**Jamie Davis** <<davisjam@vt.edu>> (he/him)
* [digitalinfinity](https://github.com/digitalinfinity) -
**Hitesh Kanwathirtha** <<digitalinfinity@gmail.com>> (he/him)
* [dnlup](https://github.com/dnlup)
**dnlup** <<dnlup.dev@gmail.com>>
* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
**Robert Jefe Lindstaedt** <<robert.lindstaedt@gmail.com>>
* [estliberitas](https://github.com/estliberitas) -
Expand Down
118 changes: 35 additions & 83 deletions android-configure
Original file line number Diff line number Diff line change
@@ -1,83 +1,35 @@
#!/bin/bash

# In order to cross-compile node for Android using NDK, run:
# source android-configure <path_to_ndk> [arch]
#
# By running android-configure with source, will allow environment variables to
# be persistent in current session. This is useful for installing native node
# modules with npm. Also, don't forget to set the arch in npm config using
# 'npm config set arch=<arch>'

if [ $# -ne 3 ]; then
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
return 1
fi

NDK_PATH=$1
ARCH="$2"
ANDROID_SDK_VERSION=$3

if [ $ANDROID_SDK_VERSION -lt 24 ]; then
echo "$ANDROID_SDK_VERSION should equal or later than 24 (Android 7.0)"
fi

case $ARCH in
arm)
DEST_CPU="arm"
TOOLCHAIN_NAME="armv7a-linux-androideabi"
;;
x86)
DEST_CPU="ia32"
TOOLCHAIN_NAME="i686-linux-android"
;;
x86_64)
DEST_CPU="x64"
TOOLCHAIN_NAME="x86_64-linux-android"
ARCH="x64"
;;
arm64|aarch64)
DEST_CPU="arm64"
TOOLCHAIN_NAME="aarch64-linux-android"
ARCH="arm64"
;;
*)
echo "Unsupported architecture provided: $ARCH"
return 1
;;
esac

HOST_OS="linux"
HOST_ARCH="x86_64"
export CC_host=$(command -v gcc)
export CXX_host=$(command -v g++)

host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}')
major=$(echo $host_gcc_version | awk -F . '{print $1}')
minor=$(echo $host_gcc_version | awk -F . '{print $2}')
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || ( [ $major -eq 6 ] && [ $minor -lt 3 ] ); then
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
return 1
fi

SUFFIX="$TOOLCHAIN_NAME$ANDROID_SDK_VERSION"
TOOLCHAIN=$NDK_PATH/toolchains/llvm/prebuilt/$HOST_OS-$HOST_ARCH

export PATH=$TOOLCHAIN/bin:$PATH
export CC=$TOOLCHAIN/bin/$SUFFIX-clang
export CXX=$TOOLCHAIN/bin/$SUFFIX-clang++


GYP_DEFINES="target_arch=$ARCH"
GYP_DEFINES+=" v8_target_arch=$ARCH"
GYP_DEFINES+=" android_target_arch=$ARCH"
GYP_DEFINES+=" host_os=$HOST_OS OS=android"
export GYP_DEFINES

if [ -f "configure" ]; then
./configure \
--dest-cpu=$DEST_CPU \
--dest-os=android \
--without-snapshot \
--openssl-no-asm \
--cross-compiling
fi
#!/bin/sh

# Locate an acceptable Python interpreter and then re-execute the script.
# Note that the mix of single and double quotes is intentional,
# as is the fact that the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
command -v python3.7 >/dev/null && exec python3.7 "$0" "$@"
command -v python3.6 >/dev/null && exec python3.6 "$0" "$@"
command -v python3 >/dev/null && exec python3 "$0" "$@"
exec python "$0" "$@"
''' "$0" "$@"
]
del _

import sys
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which

print('Node.js android configure: Found Python {}.{}.{}...'.format(*sys.version_info))
acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
if sys.version_info[:2] in acceptable_pythons:
import android_configure
else:
python_cmds = ['python{}.{}'.format(*vers) for vers in acceptable_pythons]
sys.stderr.write('Please use {}.\n'.format(' or '.join(python_cmds)))
for python_cmd in python_cmds:
python_cmd_path = which(python_cmd)
if python_cmd_path and 'pyenv/shims' not in python_cmd_path:
sys.stderr.write('\t{} {}\n'.format(python_cmd_path, ' '.join(sys.argv[:1])))
sys.exit(1)
26 changes: 26 additions & 0 deletions android-patches/trap-handler.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- trap-handler.h 2022-08-11 09:01:23.384000000 +0800
+++ fixed-trap-handler.h 2022-08-11 09:09:15.352000000 +0800
@@ -17,23 +17,7 @@
namespace internal {
namespace trap_handler {

-// X64 on Linux, Windows, MacOS, FreeBSD.
-#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \
- V8_OS_FREEBSD)
-#define V8_TRAP_HANDLER_SUPPORTED true
-// Arm64 (non-simulator) on Mac.
-#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.
-#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && \
- (V8_OS_LINUX || V8_OS_DARWIN)
-#define V8_TRAP_HANDLER_VIA_SIMULATOR
-#define V8_TRAP_HANDLER_SUPPORTED true
-// Everything else is unsupported.
-#else
#define V8_TRAP_HANDLER_SUPPORTED false
-#endif

// Setup for shared library export.
#if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN)
76 changes: 76 additions & 0 deletions android_configure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import platform
import sys
import os

# TODO: In next version, it will be a JSON file listing all the patches, and then it will iterate through to apply them.
def patch_android():
print("- Patches List -")
print("[1] [deps/v8/src/trap-handler/trap-handler.h] related to https://github.com/nodejs/node/issues/36287")
if platform.system() == "Linux":
os.system('patch -f ./deps/v8/src/trap-handler/trap-handler.h < ./android-patches/trap-handler.h.patch')
print("\033[92mInfo: \033[0m" + "Tried to patch.")

if platform.system() == "Windows":
print("android-configure is not supported on Windows yet.")
sys.exit(1)

if len(sys.argv) == 2 and sys.argv[1] == "patch":
patch_android()
sys.exit(0)

if len(sys.argv) != 4:
print("Usage: ./android-configure [patch] <path to the Android NDK> <Android SDK version> <target architecture>")
sys.exit(1)

if not os.path.exists(sys.argv[1]) or not os.listdir(sys.argv[1]):
print("\033[91mError: \033[0m" + "Invalid path to the Android NDK")
sys.exit(1)

if int(sys.argv[2]) < 24:
print("\033[91mError: \033[0m" + "Android SDK version must be at least 24 (Android 7.0)")
sys.exit(1)

android_ndk_path = sys.argv[1]
android_sdk_version = sys.argv[2]
arch = sys.argv[3]

if arch == "arm":
DEST_CPU = "arm"
TOOLCHAIN_PREFIX = "armv7a-linux-androideabi"
elif arch in ("aarch64", "arm64"):
DEST_CPU = "arm64"
TOOLCHAIN_PREFIX = "aarch64-linux-android"
arch = "arm64"
elif arch == "x86":
DEST_CPU = "ia32"
TOOLCHAIN_PREFIX = "i686-linux-android"
elif arch == "x86_64":
DEST_CPU = "x64"
TOOLCHAIN_PREFIX = "x86_64-linux-android"
arch = "x64"
else:
print("\033[91mError: \033[0m" + "Invalid target architecture, must be one of: arm, arm64, aarch64, x86, x86_64")
sys.exit(1)

print("\033[92mInfo: \033[0m" + "Configuring for " + DEST_CPU + "...")

if platform.system() == "Darwin":
host_os = "darwin"
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/darwin-x86_64"

elif platform.system() == "Linux":
host_os = "linux"
toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/linux-x86_64"

os.environ['PATH'] += os.pathsep + toolchain_path + "/bin"
os.environ['CC'] = toolchain_path + "/bin/" + TOOLCHAIN_PREFIX + android_sdk_version + "-" + "clang"
os.environ['CXX'] = toolchain_path + "/bin/" + TOOLCHAIN_PREFIX + android_sdk_version + "-" + "clang++"

GYP_DEFINES = "target_arch=" + arch
GYP_DEFINES += " v8_target_arch=" + arch
GYP_DEFINES += " android_target_arch=" + arch
GYP_DEFINES += " host_os=" + host_os + " OS=android"
os.environ['GYP_DEFINES'] = GYP_DEFINES

if os.path.exists("./configure"):
os.system("./configure --dest-cpu=" + DEST_CPU + " --dest-os=android --openssl-no-asm --cross-compiling")
4 changes: 2 additions & 2 deletions benchmark/fixtures/require-cachable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const { internalBinding } = require('internal/test/binding');
const {
moduleCategories: { canBeRequired }
} = internalBinding('native_module');
builtinCategories: { canBeRequired }
} = internalBinding('builtins');

for (const key of canBeRequired) {
require(`node:${key}`);
Expand Down
Loading