Commit Graph

30983 Commits

Author SHA1 Message Date
Richard Lau
f2f7a454cc
Working on v12.22.5
PR-URL: https://github.com/nodejs/node/pull/39500
2021-07-29 15:28:36 +01:00
Richard Lau
2fdf98954d
2021-07-29, Version 12.22.4 'Erbium' (LTS)
This is a security release.

Notable changes:

- CVE-2021-22930: Use after free on close http2 on stream canceling (High)

PR-URL: https://github.com/nodejs/node/pull/39500
2021-07-29 10:53:19 +01:00
Antoine du Hamel
3e4bc1b0d3
module: fix legacy node specifier resolution to resolve "main" field
PR-URL: https://github.com/nodejs/node/pull/38979
Backport-PR-URL: https://github.com/nodejs/node/pull/39497
Fixes: https://github.com/nodejs/node/issues/32103
Fixes: https://github.com/nodejs/node/issues/38739
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-07-28 23:25:49 +01:00
Darcy Clarke
ddc8dde150
deps: upgrade npm to 6.14.14
PR-URL: https://github.com/nodejs/node/pull/39553
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-07-28 19:37:20 +01:00
Akshay K
b263f2585a
http2: on receiving rst_stream with cancel code add it to pending list
PR-URL: https://github.com/nodejs/node/pull/39423
Backport-PR-URL: https://github.com/nodejs/node/pull/39527
Fixes: https://github.com/nodejs/node/issues/38964
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-07-27 19:41:45 +01:00
Danny Sonnenschein
e11a862eed
deps: update to c-ares 1.17.1
PR-URL: https://github.com/nodejs/node/pull/36207
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-07-26 17:29:35 +01:00
Richard Lau
39e9cd540f
deps: restore minimum ICU version to 65
This modifies 40df0dc so that the changes it applies are only used
if ICU 67 or greater is used, and restores the previous code path for
versions of ICU below 67.

The minimum ICU version was bumped to 67 in Node.js 14.6.0 by
https://github.com/nodejs/node/pull/34356 but the referenced V8
commit[1] isn't on `v14.x-staging` and appears to have been reverted
on V8 8.4[2] so this PR also restores the minimum ICU version to 65.

[1] 611e412768
[2] eeccedee18

PR-URL: https://github.com/nodejs/node/pull/39068
Backport-PR-URL: https://github.com/nodejs/node/pull/39451
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-07-26 16:30:46 +01:00
Michaël Zasso
e459c79b02
deps: V8: cherry-pick 035c305ce776
Original commit message:

    [Intl] call new ListFormatter::createInstance

    The one we currently using is now marked as internal and to be removed
    for 68. Migrating to the style which already avaiable in ICU 67-1.

    Bug: v8:11031
    Change-Id: I668382a2e1b8602ddca02bf231c5008a6c92bf2d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477751
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Frank Tang <ftang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70638}

Refs: 035c305ce7

PR-URL: https://github.com/nodejs/node/pull/38497
Backport-PR-URL: https://github.com/nodejs/node/pull/39451
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2021-07-26 16:30:46 +01:00
Fedor Indutny
f552c45676
src: move CHECK in AddIsolateFinishedCallback
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData`
in the `per_isolate_` map, and not just a key with empty value. When
`it == per_isolate_.end()`, however, it means that we don't have the
isolate and the `CHECK(it->second)` is guaranteed to fail then!

PR-URL: https://github.com/nodejs/node/pull/38010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-26 16:30:46 +01:00
Anna Henningsen
30ce0e66ae
src: update cares_wrap OpenBSD defines
Move the `#define`s back into `cares_wrap.cc`, as they are part of
the implementation, not the declarations used in `cares_wrap.h`,
and apply the suggestion from
https://github.com/nodejs/node/pull/38572#discussion_r627809407
to make the defines a bit more generic and not check for OpenBSD
specifically.

Refs: https://github.com/nodejs/node/pull/38572

PR-URL: https://github.com/nodejs/node/pull/38670
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-07-26 16:30:43 +01:00
Guy Bedford
b3c698a5d8
deps: update to cjs-module-lexer@1.2.1
PR-URL: https://github.com/nodejs/node/pull/38450
Backport-PR-URL: https://github.com/nodejs/node/pull/39422
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-07-23 11:42:39 +01:00
Guy Bedford
7d5a2f9588
deps: update to cjs-module-lexer@1.1.1
PR-URL: https://github.com/nodejs/node/pull/37992
Backport-PR-URL: https://github.com/nodejs/node/pull/38003
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2021-07-23 11:41:16 +01:00
Michaël Zasso
906b43e586
deps: V8: update build dependencies
These updates are necessary to build V8 with recent GN versions.

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:16 +01:00
Michaël Zasso
15b91fa3fa
deps: V8: backport 895949419186
Original commit message:

    Add -Wno-string-concatenation to test/cctest:cctest_sources

    v8/test/cctest/interpreter/test-bytecode-generator.cc contains lots of string arrays with intentional concatenation.

    Bug: chromium:1114873
    Change-Id: Ie9d35c3849b5b0a6d1d01b6ce21fb80a320d8736
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2366829
    Commit-Queue: Arthur Eubanks <aeubanks@google.com>
    Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69625}

Refs: 8959494191

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:16 +01:00
Michaël Zasso
8046daf09f
deps: V8: cherry-pick 0b3a4ecf7083
Original commit message:

    Fix implicit conversion loses integer precision warning

    The type of m is long in 64 bits build, and results implicit conversion
    loses integer precision, which was found by improved clang warning
    (-Wshorten-64-to-32)

    Bug: chromium:1124085
    Change-Id: Ic9f22508bd817a06d5c90162b1ac3554a7171529
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2391323
    Commit-Queue: Zequan Wu <zequanwu@google.com>
    Auto-Submit: Zequan Wu <zequanwu@google.com>
    Reviewed-by: Nico Weber <thakis@chromium.org>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69686}

Refs: 0b3a4ecf70

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:16 +01:00
Michaël Zasso
f4377b13a6
deps: V8: cherry-pick 7c182bd65f42
Original commit message:

    Fix visiblity rules for configs enforced by the latest GN version.

    Prior versions of GN had a bug (gn:22) where visibility rules
    for configs weren't being enforced properly.

    This CL tweaks the visibility settings of some configs to
    conform to the latest version.

    Change-Id: Ic5d827a1f2774278d3894f67fe52bfca836c0409
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2360909
    Commit-Queue: Dirk Pranke <dpranke@google.com>
    Reviewed-by: Adam Klein <adamk@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69463}

Refs: 7c182bd65f

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:15 +01:00
Michaël Zasso
add7b5b4c2
deps: V8: cherry-pick cc641f6be756
Original commit message:

    Add a simple gclient_args.gni file to V8

    Bug: v8:9914
    Change-Id: I0bae9aadd89876e8505e1388903c86777694ee09
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1890100
    Reviewed-by: Michael Achenbach <machenbach@chromium.org>
    Commit-Queue: Maya Lekova <mslekova@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64680}

Refs: cc641f6be7

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:15 +01:00
Michaël Zasso
a73275f056
deps: V8: cherry-pick 7b3332844212
Original commit message:

    [build] Move split_static_library.gni from Chromium repo

    We'll remove the file from Chromium in a follow up after V8 has rolled
    + 2 days.

    Bug: v8:9911
    Change-Id: I69fe56855f1ba83bec0d39e0fb6acb7e4182c6b7
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1897826
    Reviewed-by: Nico Weber <thakis@chromium.org>
    Commit-Queue: Michael Achenbach <machenbach@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64742}

Refs: 7b33328442

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:15 +01:00
Michaël Zasso
492b0d6b37
deps: V8: cherry-pick e6f62a41f5ee
Original commit message:

    [build] Remove jumbo build configs

    Bug: chromium:994387
    Change-Id: I7b37a416ce6cc79903fe04923e86af1d0065ac37
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1890090
    Reviewed-by: Maya Lekova <mslekova@chromium.org>
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Michael Achenbach <machenbach@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64669}

Refs: e6f62a41f5

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:15 +01:00
Michaël Zasso
2b54156260
deps: V8: cherry-pick 92e6d3317082
Original commit message:

    build: Remove no-op calls to set_sources_assignment_filter

    Chromiun no longer use set_sources_assignment_filter() anywhere in the
    build, so these are no longer needed.

    Bug: chromium:1018739
    Change-Id: I7b33612d925563ebca0d93a7d3c9183d7305b7b0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456988
    Reviewed-by: Nico Weber <thakis@chromium.org>
    Commit-Queue: Nico Weber <thakis@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70405}

Refs: 92e6d33170

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:15 +01:00
Michaël Zasso
bbceab4d91
deps: V8: backport 1b1eda0876aa
Original commit message:

    tracing: Update proto library build rule and roll Perfetto

    This patch removes use of the deprecated sources_assignment_filter GN
    feature from gni/proto_library.gni, since the extra descriptor files are
    no longer being generated.

    We also roll Perfetto to match the version used in Chrome and update
    test expectations accordingly.

    Bug: v8:10995
    Change-Id: I65cb3b79feb6e5a7e5c8d99fdb8bf999a6048539
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454079
    Commit-Queue: Michael Achenbach <machenbach@chromium.org>
    Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
    Reviewed-by: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: Michael Achenbach <machenbach@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70381}

Refs: 1b1eda0876

PR-URL: https://github.com/nodejs/node/pull/39245
Refs: https://github.com/nodejs/build/issues/2696
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-23 11:41:14 +01:00
Milad Fa
93a1a3c5ae
deps: V8: cherry-pick 530080c44af2
Original commit message:
```
PPC: Add Power10 to the supported list and enable related features

This CL adds Power10 recognition to Linux, AIX as well as IBMi.

Enabled features include:
MODULO
FPR_GPR_MOV
SIMD
LWSYNC
ISELECT
VSX

Change-Id: Ifc337e6497a3efe9697bcf03063a2b94471f96e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2855041
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74279}
```

Refs: 530080c44a

PR-URL: https://github.com/nodejs/node/pull/38509
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-07-23 11:41:14 +01:00
Michaël Zasso
499e56babe
build: fix label-pr workflow
PR-URL: https://github.com/nodejs/node/pull/38399
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-07-23 11:41:14 +01:00
Phillip Johnsen
98ac3c4108
build: label PRs with GitHub Action instead of nodejs-github-bot
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: https://github.com/nodejs/node/pull/38301
Fixes: https://github.com/nodejs/github-bot/issues/294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-07-23 11:41:14 +01:00
Richard Lau
47768f35f4
Working on v12.22.4
PR-URL: https://github.com/nodejs/node/pull/39268
2021-07-05 16:45:11 +01:00
Richard Lau
e0a35d7e88
2021-07-05, Version 12.22.3 'Erbium' (LTS)
Notable changes:

Node.js 12.22.2 introduced a regression in the Windows installer on
non-English locales that is being fixed in this release. There is no
need to download this release if you are not using the Windows
installer.

PR-URL: https://github.com/nodejs/node/pull/39268
2021-07-05 08:16:26 -04:00
Richard Lau
182f86a4d4
win,msi: use localized "Authenticated Users" name
Well known user account names are localized on Windows. Look up the
"Authenticated Users" user by its security identifier to get the
localized name.

PR-URL: https://github.com/nodejs/node/pull/39241
Fixes: https://github.com/nodejs/node/issues/39224
Refs: e817ba70f5
Refs: https://hackerone.com/reports/1211160
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-07-05 08:00:11 -04:00
Richard Lau
d692770fb3
Working on v12.22.3
PR-URL: https://github.com/nodejs-private/node-private/pull/270
2021-07-01 15:32:05 +01:00
Richard Lau
4eb2de9a77
2021-07-01, Version 12.22.2 'Erbium' (LTS)
This is a security release.

Notable changes:

Vulnerabilities fixed:

- **CVE-2021-22918**: libuv upgrade - Out of bounds read (Medium)
- **CVE-2021-22921**: Windows installer - Node Installer Local Privilege Escalation (Medium)
- **CVE-2021-27290**: npm upgrade - ssri Regular Expression Denial of Service (ReDoS) (High)
- **CVE-2021-23362**: npm upgrade - hosted-git-info Regular Expression Denial of Service (ReDoS) (Medium)

PR-URL: https://github.com/nodejs-private/node-private/pull/270
2021-06-28 16:02:29 +01:00
AkshayK
a52790cba0
win,msi: set install directory permission
Explicitly set permission for Windows install directory.

CVE-ID: CVE-2021-22921
Refs: https://hackerone.com/reports/1211160
PR-URL: https://github.com/nodejs-private/node-private/pull/269
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-06-28 11:07:57 +01:00
Ben Noordhuis
623fd1fcb5
deps: uv: cherry-pick 99c29c9c2c9b
Original commit message:

    idna: fix OOB read in punycode decoder

    Reported by Eric Sesterhenn in collaboration with
    Cure53 and ExpressVPN.

    Reported-By: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de>
    PR-URL: https://github.com/libuv/libuv-private/pull/1
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Richard Lau <rlau@redhat.com>

CVE-ID: CVE-2021-22918
Refs: https://hackerone.com/reports/1209681
PR-URL: https://github.com/nodejs-private/node-private/pull/267
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-06-28 11:07:38 +01:00
Ruy Adorno
923b3760f8
deps: upgrade npm to 6.14.13
PR-URL: https://github.com/nodejs/node/pull/38214
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-06-23 16:18:23 +01:00
Myles Borins
0b7605366d
Working on v12.22.2
PR-URL: https://github.com/nodejs/node/pull/38083
2021-04-06 10:41:56 -04:00
Myles Borins
fe1c4b45a1
2021-04-06, Version 12.22.1 'Erbium' (LTS)
This is a security release.

Notable changes:

Vulnerabilities fixed:

- **CVE-2021-3450**: OpenSSL - CA certificate check bypass with X509_V_FLAG_X509_STRICT (High)
- **CVE-2021-3449**: OpenSSL - NULL pointer deref in signature_algorithms processing (High)
- **CVE-2020-7774**: npm upgrade - Update y18n to fix Prototype-Pollution (High)

PR-URL: https://github.com/nodejs/node/pull/38083
2021-04-06 09:28:56 -04:00
Ruy Adorno
c947f1a0e1
deps: upgrade npm to 6.14.12
PR-URL: https://github.com/nodejs/node/pull/37918
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-04-04 15:58:04 -04:00
Tobias Nießen
51a753c06f
deps: update archs files for OpenSSL-1.1.1k
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
   $ make -C deps/openssl/config
   $ git add deps/openssl/config/archs
   $ git add deps/openssl/openssl/include/crypto/bn_conf.h
   $ git add deps/openssl/openssl/include/crypto/dso_conf.h
   $ git add deps/openssl/openssl/include/openssl/opensslconf.h
   $ git commit

PR-URL: https://github.com/nodejs/node/pull/37939
Refs: https://github.com/nodejs/node/issues/37913
Refs: https://github.com/nodejs/node/pull/37916
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2021-04-04 15:57:37 -04:00
Tobias Nießen
c85a519b48
deps: upgrade openssl sources to 1.1.1k
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1k.tar.gz
    $ mv openssl-1.1.1k openssl
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/37939
Refs: https://github.com/nodejs/node/issues/37913
Refs: https://github.com/nodejs/node/pull/37916
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2021-04-04 15:57:33 -04:00
Richard Lau
7d488fedca
Working on v12.22.1
PR-URL: https://github.com/nodejs/node/pull/37797
2021-03-30 14:50:20 +01:00
Richard Lau
6a5797ba22
2021-03-30, Version 12.22.0 'Erbium' (LTS)
Notable changes

The legacy HTTP parser is runtime deprecated:
- The legacy HTTP parser, selected by the `--http-parser=legacy` command line
option, is deprecated with the pending End-of-Life of Node.js 10.x (where it
is the only HTTP parser implementation provided) at the end of April 2021. It
will now warn on use but otherwise continue to function and may be removed in
a future Node.js 12.x release.
- The default HTTP parser based on llhttp is not affected. By default it is
stricter than the now deprecated legacy HTTP parser. If interoperability with
HTTP implementations that send invalid HTTP headers is required, the HTTP
parser can be started in a less secure mode with the `--insecure-http-parser`
command line option.

ES Modules:
- ES Modules are now considered stable.

node-api:
- Updated to node-api version 8 and added an experimental API to allow
retrieval of the add-on file name.

New API's to control code coverage data collection:
- `v8.stopCoverage()` and `v8.takeCoverage()` have been added.

New API to monitor event loop utilization by Worker threads
- `worker.performance.eventLoopUtilization()` has been added.

PR-URL: https://github.com/nodejs/node/pull/37797
2021-03-29 14:12:17 +01:00
Gerhard Stoebich
364bf03a68
test: fix races in test-performance-eventlooputil
Fix two races in test-performance-eventlooputil resulting in a flaky
test.

elu1 was capture after start time t from spin look. If OS descides to
reschedule the process after capturing t but before getting elu for
>=50ms the spin loop is actually a nop. elu1 doesn't show this and as
a result elut3 = eventLoopUtilization(elu1) results in
elu3.active === 0.
Moving capturing of t after capturing t, just before the spin look
avoids this.

Similar if OS decides to shedule a different process between getting
the total elu from start and the diff elu showing the spin loop the
check to verify that total active time is long then the spin loop
fails.
Exchanging these statements avoids this race.

PR-URL: https://github.com/nodejs/node/pull/36028
Fixes: https://github.com/nodejs/node/issues/35309
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-03-29 14:10:41 +01:00
Antoine du Hamel
7b0ed4ba92
module: improve support of data: URLs
Add support for loading modules using percent-encoded URLs.

PR-URL: https://github.com/nodejs/node/pull/37392
Backport-PR-URL: https://github.com/nodejs/node/pull/37859
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-03-29 12:33:56 +01:00
Antoine du Hamel
2da24ac302
lib: add URI handling functions to primordials
PR-URL: https://github.com/nodejs/node/pull/37394
Backport-PR-URL: https://github.com/nodejs/node/pull/37859
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-29 12:33:50 +01:00
Gabriel Schulhof
93dd799a86
node-api: define version 8
Mark as stable the APIs that define Node-API version 8.

PR-URL: https://github.com/nodejs/node/pull/37652
Backport-PR-URL: https://github.com/nodejs/node/pull/37796
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2021-03-19 12:08:09 +00:00
Guy Bedford
1872625990
deps: update to cjs-module-lexer@1.1.0
PR-URL: https://github.com/nodejs/node/pull/37712
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-03-17 22:24:18 +00:00
Guy Bedford
bf8733fe22
doc: mark modules implementation as stable
PR-URL: https://github.com/nodejs/node/pull/35781
Backport-PR-URL: https://github.com/nodejs/node/pull/37718
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-03-17 21:14:18 +00:00
Gabriel Schulhof
f5692093d3
node-api: allow retrieval of add-on file name
Unlike JS-only modules, native add-ons are always associated with a
dynamic shared object from which they are loaded. Being able to
retrieve its absolute path is important to native-only add-ons, i.e.
add-ons that are not themselves being loaded from a JS-only module
located in the same package as the native add-on itself.

Currently, the file name is obtained at environment construction time
from the JS `module.filename`. Nevertheless, the presence of `module`
is not required, because the file name could also be passed in via a
private property added onto `exports` from the `process.dlopen`
binding.

As an attempt at future-proofing, the file name is provided as a URL,
i.e. prefixed with the `file://` protocol.

Fixes: https://github.com/nodejs/node-addon-api/issues/449
PR-URL: https://github.com/nodejs/node/pull/37195
Backport-PR-URL: https://github.com/nodejs/node/pull/37328
Co-authored-by: Michael Dawson <mdawson@devrus.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-03-17 20:59:08 +00:00
Joyee Cheung
86f34ee18c
v8: implement v8.stopCoverage()
Add a v8.stopCoverage() API to stop the coverage collection
started by NODE_V8_COVERAGE - this would be useful in
conjunction with v8.takeCoverage() if the user don't want
to emit the coverage at the process exit but still want
to collect it on demand at some point.

PR-URL: https://github.com/nodejs/node/pull/33807
Backport-PR-URL: https://github.com/nodejs/node/pull/36352
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2021-03-17 20:36:04 +00:00
Joyee Cheung
8ddea3f16d
v8: implement v8.takeCoverage()
Add an v8.takeCoverage() API that allows the user to write the
coverage started by NODE_V8_COVERAGE to disk on demand.
The coverage can be written multiple times during the lifetime
of the process, each time the execution counter will be reset.
When the process is about to exit, one last coverage will
still be written to disk.

Also refactors the internal profiler connection code
so that we use the inspector response id to identify
the profile response instead of using an ad-hoc flag in C++.

PR-URL: https://github.com/nodejs/node/pull/33807
Backport-PR-URL: https://github.com/nodejs/node/pull/36352
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2021-03-17 20:35:54 +00:00
Gerhard Stoebich
d7a4ccdf09
test: correct test-worker-eventlooputil
The active worker check compared the time from sending message till
response arrived from worker with the complete time the worker was
running till it responses to the spin request.

If sending back the message is slow for some reason the test fails.

Adapt the test to compare the time seen inside the worker with the
time read from main thread.

PR-URL: https://github.com/nodejs/node/pull/35891
Fixes: https://github.com/nodejs/node/issues/35844
Refs: https://github.com/nodejs/node/pull/35886
Refs: https://github.com/nodejs/node/pull/35664
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

Backport-PR-URL: https://github.com/nodejs/node/pull/37165
2021-03-16 00:04:18 +00:00
Trevor Norris
eec7542781
worker: add eventLoopUtilization()
Allow calling eventLoopUtilization() directly on a worker thread:

    const worker = new Worker('./foo.js');
    const elu = worker.performance.eventLoopUtilization();
    setTimeout(() => {
      worker.performance.eventLoopUtilization(elu);
    }, 10);

Add a new performance object on the Worker instance that will hopefully
one day hold all the other performance metrics, such as nodeTiming.

Include benchmarks and tests.

PR-URL: https://github.com/nodejs/node/pull/35664
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: https://github.com/nodejs/node/pull/37165
2021-03-16 00:04:09 +00:00