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

2024-05-02, Version 22.1.0 (Current) #52768

Merged
merged 98 commits into from
May 2, 2024
Merged

2024-05-02, Version 22.1.0 (Current) #52768

merged 98 commits into from
May 2, 2024

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 30, 2024

module: implement NODE_COMPILE_CACHE for automatic on-disk code caching

This patch implements automatic on-disk code caching that can be enabled
via an environment variable NODE_COMPILE_CACHE=/path/to/cache/dir.

When set, whenever Node.js compiles a CommonJS or a ECMAScript Module,
it will use on-disk V8 code cache
persisted in the specified directory
to speed up the compilation. This may slow down the first load of a
module graph, but subsequent loads of the same module graph may get
a significant speedup if the contents of the modules do not change.
Locally, this speeds up loading of test/fixtures/snapshot/typescript.js
from ~130ms to ~80ms.

To clean up the generated code cache, simply remove the directory.
It will be recreated the next time the same directory is used for
NODE_COMPILE_CACHE.

Compilation cache generated by one version of Node.js may not be used
by a different version of Node.js. Cache generated by different versions
of Node.js will be stored separately if the same directory is used
to persist the cache, so they can co-exist.

Caveat: currently when using this with V8 JavaScript code coverage, the
coverage being collected by V8 may be less precise in functions that are
deserialized from the code cache. It's recommended to turn this off when
running tests to generate precise coverage.

Contributed by Joyee Cheung in #52535.

Other Notable Changes

  • [44ee04cf9f] - buffer: improve base64 and base64url performance (Yagiz Nizipli) #52428
  • [3c37ce5710] - (SEMVER-MINOR) dns: add order option and support ipv6first (Paolo Insogna) #52492
  • [3026401be1] - events,doc: mark CustomEvent as stable (Daeyeon Jeong) #52618
  • [64428dc1c9] - (SEMVER-MINOR) lib, url: add a windows option to path parsing (Aviv Keller) #52509
  • [d79ae74f71] - (SEMVER-MINOR) net: add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) #52474
  • [43fa6a1a45] - (SEMVER-MINOR) src: add string_view overload to snapshot FromBlob (Anna Henningsen) #52595
  • [c6fe433d42] - src,permission: throw async errors on async APIs (Rafael Gonzaga) #52730
  • [e247a61d15] - (SEMVER-MINOR) test_runner: add --test-skip-pattern cli option (Aviv Keller) #52529
  • [9b18df9dcb] - (SEMVER-MINOR) url: implement parse method for safer URL parsing (Ali Hassan) #52280
Commits
  • [35643c18c0] - benchmark: reduce the buffer size for blob (Debadree Chatterjee) #52548
  • [7cdfe8a3fc] - benchmark: inherit stdio/stderr instead of pipe (Ali Hassan) #52456
  • [7b82c17f22] - benchmark: add ipc support to spawn stdio config (Ali Hassan) #52456
  • [dfda6fed61] - buffer: add missing ARG_TYPE(ArrayBuffer) for isUtf8 (Jungku Lee) #52477
  • [44ee04cf9f] - buffer: improve base64 and base64url performance (Yagiz Nizipli) #52428
  • [c64a1a3b89] - build: fix typo in node.gyp (Michaël Zasso) #52719
  • [4f713fbc2e] - build: fix headers install for shared mode on Win (Segev Finer) #52442
  • [4baeb7b21d] - build: fix arm64 cross-compilation bug on non-arm machines (Mahdi Sharifi) #52559
  • [d5cd468ce8] - build,tools,node-api: fix building node-api tests for Windows Debug (Vladimir Morozov) #52632
  • [910533fcfd] - crypto: simplify assertions in Safe*Print (David Benjamin) #49709
  • [61e1ac0b8c] - crypto: enable NODE_EXTRA_CA_CERTS with BoringSSL (Shelley Vohr) #52217
  • [6e98eee256] - deps: upgrade npm to 10.7.0 (npm team) #52767
  • [27a5f9418c] - deps: V8: cherry-pick 500de8bd371b (Richard Lau) #52676
  • [3b422ddcea] - deps: update corepack to 0.28.0 (Node.js GitHub Bot) #52616
  • [d40e4d4c42] - deps: update ada to 2.7.8 (Node.js GitHub Bot) #52517
  • [5b52a4870a] - deps: update icu to 75.1 (Node.js GitHub Bot) #52573
  • [80cbe72c1f] - deps: update undici to 6.13.0 (Node.js GitHub Bot) #52493
  • [9a44059055] - deps: update zlib to 1.3.0.1-motley-7d77fb7 (Node.js GitHub Bot) #52516
  • [d67a9a5360] - deps: update minimatch to 9.0.4 (Node.js GitHub Bot) #52524
  • [8738b89971] - deps: upgrade npm to 10.5.2 (npm team) #52458
  • [8e4fd2842b] - deps,src: simplify base64 encoding (Daniel Lemire) #52714
  • [3c37ce5710] - (SEMVER-MINOR) dns: add order option and support ipv6first (Paolo Insogna) #52492
  • [3987a28a9e] - doc: update process.versions properties (ishabi) #52736
  • [c0b58e07f1] - doc: remove mold use on mac for speeding up build (Cong Zhang) #52252
  • [9a032cf6e2] - doc: remove relative limitation to pm (Rafael Gonzaga) #52648
  • [90c6e77238] - doc: fix info string causing duplicated code blocks (Mathieu Leenhardt) #52660
  • [4d577fa048] - doc: add .gitattributes for md files (Hüseyin Açacak) #52161
  • [04c8e110e5] - doc: run license-builder (github-actions[bot]) #52631
  • [3552829594] - doc: add info on contributor spotlight program (Michael Dawson) #52598
  • [eeb80ad836] - doc: correct unsafe URL example in http docs (Malte Legenhausen) #52555
  • [c83526a688] - doc: replace U+00A0 with U+0020 (Luigi Pinca) #52590
  • [31831e9db8] - doc: sort options alphabetically (Luigi Pinca) #52589
  • [a93f5d4aaa] - doc: correct stream.finished changes (KaKa) #52551
  • [27ffa35540] - doc: add RedYetiDev to triage team (Aviv Keller) #52556
  • [63cc2b870e] - doc: fix issue detected in markdown lint update (Rich Trott) #52566
  • [7e93c4892b] - doc: update test runner coverage limitations (Moshe Atlow) #52515
  • [3026401be1] - events,doc: mark CustomEvent as stable (Daeyeon Jeong) #52618
  • [c6e0fe2f22] - fs: allow setting Stat date properties (Nicolò Ribaudo) #52708
  • [f23fa1de72] - fs: fix read / readSync positional offset types (Ruy Adorno) #52603
  • [a7e03d301a] - fs: fixes recursive fs.watch crash on Linux when deleting files (Matteo Collina) #52349
  • [d5ecb6cd00] - http2: fix excessive CPU usage when using allowHTTP1=true (Eugene) #52713
  • [d1adc9b140] - lib: enforce ASCII order in error code imports (Antoine du Hamel) #52625
  • [9ffdcade37] - lib: use predefined variable instead of bit operation (Deokjin Kim) #52580
  • [fdcde845ee] - lib: refactor lazy loading of undici for fetch method (Victor Chen) #52275
  • [f6145aa2ca] - lib: convert WeakMaps in cjs loader with private symbol properties (Chengzhong Wu) #52095
  • [014bf01efc] - lib: replace string prototype usage with alternatives (Aviv Keller) #52440
  • [dc399ddd03] - lib, doc: rename readme.md to README.md (Aviv Keller) #52471
  • [64428dc1c9] - (SEMVER-MINOR) lib, url: add a windows option to path parsing (Aviv Keller) #52509
  • [9b2b6abb62] - lib,src: iterate module requests of a module wrap in JS (Chengzhong Wu) #52058
  • [896a80e366] - meta: standardize regex (Aviv Keller) #52693
  • [20c07e922e] - meta: move one or more collaborators to emeritus (Node.js GitHub Bot) #52633
  • [e70d8a4fa9] - meta: move one or more collaborators to emeritus (Node.js GitHub Bot) #52457
  • [20ab8f2a88] - module: support ESM detection in the CJS loader (Joyee Cheung) #52047
  • [544c602b75] - module: skip NODE_COMPILE_CACHE when policy is enabled (Joyee Cheung) #52577
  • [3df3afc284] - module: detect ESM syntax by trying to recompile as SourceTextModule (Joyee Cheung) #52413
  • [4d77fd2c46] - (SEMVER-MINOR) module: implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) #52535
  • [9794d21b07] - module: fix submodules loaded by require() and import() (Joyee Cheung) #52487
  • [b00766d9e7] - module: tidy code and comments (Jacob Smith) #52437
  • [d79ae74f71] - (SEMVER-MINOR) net: add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) #52474
  • [b17cfea289] - node-api: address coverity report (Michael Dawson) #52584
  • [1fca8baac1] - node-api: copy external type tags when they are set (Niels Martignène) #52426
  • [d086ab42a1] - quic: address recent coverity warnings (Michael Dawson) #52647
  • [fb4edf70cf] - quic: rework TLSContext, additional cleanups (James M Snell) #51340
  • [0c58d0319b] - src: remove misplaced windows code under posix guard in node.cc (Ali Hassan) #52545
  • [e20d2f1de3] - src: cast to v8::Value before using v8::EmbedderGraph::V8Node (Joyee Cheung) #52638
  • [43fa6a1a45] - (SEMVER-MINOR) src: add string_view overload to snapshot FromBlob (Anna Henningsen) #52595
  • [a56faff4d0] - src: parse inspector profiles with simdjson (Joyee Cheung) #51783
  • [ac04c6434a] - src: remove regex usage for env file parsing (IlyasShabi) #52406
  • [f283d27285] - src: fix loadEnvFile ENOENT error (mathis-west-1) #52438
  • [c6fe433d42] - src,permission: throw async errors on async APIs (Rafael Gonzaga) #52730
  • [9f9eca965a] - stream: update ongoing promise in async iterator return() method (Mattias Buelens) #52657
  • [d568a9a38e] - test: mark test-error-serdes as flaky (Antoine du Hamel) #52739
  • [45f7002b90] - test: mark test as flaky (Michael Dawson) #52671
  • [10596e20e8] - test: fix backtick usage in docs (Aviv Keller) #52643
  • [b2f754c9f1] - test: skip test-fs-watch-recursive-delete.js on IBM i (Abdirahim Musse) #52645
  • [ed080d868d] - test: ensure that all worker servers are ready (Luigi Pinca) #52563
  • [c8c61737e4] - test: fix test-tls-ticket-cluster.js (Hüseyin Açacak) #52431
  • [18aa5d6640] - test: split wasi poll test for windows (Hüseyin Açacak) #52538
  • [e34e0a9ba1] - test: write tests for assertIsArray http2 util (Sinan Sonmez (Chaush)) #52511
  • [e247a61d15] - (SEMVER-MINOR) test_runner: add --test-skip-pattern cli option (Aviv Keller) #52529
  • [e066ba2ae4] - test_runner: better error handing for test hook (Alex Yang) #52401
  • [328755341d] - test_runner: don't exceed call stack when filtering (Colin Ihrig) #52488
  • [b4ccb6c626] - test_runner: move end of work check to finalize() (Colin Ihrig) #52488
  • [2ef9380472] - tools: update lint-md-dependencies to rollup@4.17.0 (Node.js GitHub Bot) #52729
  • [db421bdefc] - tools: take co-authors into account in find-inactive-collaborators (Antoine du Hamel) #52669
  • [01103a85cb] - tools: fix invalid escape sequence in mkssldef (Michaël Zasso) #52624
  • [382d951b01] - tools: update lint-md-dependencies to rollup@4.15.0 (Node.js GitHub Bot) #52617
  • [f9ddd77ff3] - tools: add lint rule to keep primordials in ASCII order (Antoine du Hamel) #52592
  • [552642a498] - tools: update lint-md-dependencies (Rich Trott) #52581
  • [df61feb655] - tools: fix heading spaces for osx-entitlements.plist (Jackson Tian) #52561
  • [6b4bbfbb1f] - tools: update lint-md-dependencies to rollup@4.14.2 vfile-reporter@8.1.1 (Node.js GitHub Bot) #52518
  • [4e5ce3afb7] - tools: use stylistic ESLint plugin for formatting (Michaël Zasso) #50714
  • [15c5686381] - tools: update minimatch index path (Marco Ippolito) #52523
  • [8ae1507ae1] - tools: add a linter for README lists (Antoine du Hamel) #52476
  • [0b970316bc] - typings: fix invalid JSDoc declarations (Yagiz Nizipli) #52659
  • [9b18df9dcb] - (SEMVER-MINOR) url: implement parse method for safer URL parsing (Ali Hassan) #52280
  • [d33131af3a] - vm: fix ASCII-betical order (Aviv Keller) #52686

avivkeller and others added 30 commits April 29, 2024 22:46
PR-URL: #52440
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #52217
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #52458
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Co-authored-by: Daniel Lemire <daniel@lemire.me>
PR-URL: #52428
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Symbol properties are typically more GC-efficient than using WeakMaps,
since WeakMap requires ephemeron GC. `module[kModuleExportNames]`
would be easier to read than `importedCJSCache.get(module).exportNames`
as well.

PR-URL: #52095
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Object.defineProperty is updated to lazily load the undici dependency
for the fetch method. This change allows for simpler and more reliable
mocking of the fetch method for testing purposes, resolving issues
encountered with premature method invocation during testing.

Fixes: #52015
PR-URL: #52275
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Implement the static parse method as per the WHATWG URL specification.
Unlike the URL constructor, URL.parse does not throw on invalid input,
instead returning null. This behavior allows safer parsing of URLs
without the need for try-catch blocks around constructor calls. The
implementation follows the steps outlined in the WHATWG URL standard,
ensuring compatibility and consistency with web platform URL parsing
APIs.

Fixes: #52208
Refs: whatwg/url#825
PR-URL: #52280
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #52476
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
PR-URL: #52477
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.

Fixes: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
PR-URL: #52456
Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
PR-URL: #52437
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
This commit moves the end of work check from postRun() to
finalize(). The reasoning is that finalize() is guaranteed to
run in the order that the tests are defined, while postRun() is
not. This makes the check a little simpler.

PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit updates filteredRun() to call postRun() after a
microtask instead of synchronously. Currently, if approximately
1,545 subtests are filtered, enough synchronous calls can be
made to cause a call stack exceeded exception.

PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #52457
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ash Cripps <email@ashleycripps.co.uk>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
PR-URL: #52471
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #52523
Fixes: #52520
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #52511
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #52401
Fixes: #52399
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: https://eslint.org/blog/2023/10/deprecating-formatting-rules/
PR-URL: #50714
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
In order to adapt to V8 changes regarding storing private
properties on Externals, ExternalWrapper objects were introduced
in #51149.

However, this new code stores the type tag pointer and not the
128-bit value inside. This breaks some pre-existing code that
were making temporary tags. It also means that unloading the module
will cause existing External objects to have a tag pointer that
points nowhere (use-after-free bug).

Change ExternalWrapper to store tags by value to fix this regression.

PR-URL: #52426
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #52515
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #52518
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #52524
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Previously there is an edge case where submodules loaded by require()
may not be loaded by import() again from different intermediate
edges in the graph. This patch fixes that, added tests, and added
debug logs.

Drive-by: make loader a private field so it doesn't show up in logs.
PR-URL: #52487
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Before this change the error message for `process.loadEnvFile()` without
an `.env` file present in the current working directory was looking like
this: `ENOENT: .env, Failed to load '%s'.` This obviously isn't what the
author intended.

To fix that, just return a "plain" ENOENT open error. It should be
descriptive enough. That means for the above example, the error message
is now `ENOENT: no such file or directory, open '.env'`.

PR-URL: #52438
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
PR-URL: #52406
Fixes: #52248
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
PR-URL: #52474
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #52561
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #52538
Fixes: #51822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@aduh95 aduh95 removed doc Issues and PRs related to the documentations. build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory. dependencies Pull requests that update a dependency file. labels May 1, 2024
@mcollina
Copy link
Member

mcollina commented May 1, 2024

#52763 should be included if possible (CI is too flaky right now).

Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodejs-github-bot

This comment was marked as duplicate.

@nodejs-github-bot

This comment was marked as duplicate.

@nodejs-github-bot

This comment was marked as duplicate.

@joyeecheung
Copy link
Member

joyeecheung commented May 1, 2024

Nit: maybe remove the implementation details of NODE_COMPILE_CACHE from the changelog (everything below Implementation details:), because that's subject to change.

@ilkkao
Copy link

ilkkao commented May 1, 2024

Somewhat related to previous comment. Would be nice to clarify if it's used as NODE_COMPILE_CACHE=true or NODE_COMPILE_CACHE=<dir> That wasn't 100% clear for me after reading the description even I guess it's the second form.

Notable changes:

buffer:
  * improve `base64` and `base64url` performance (Yagiz Nizipli) #52428
dns:
  * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) #52492
events,doc:
  * mark CustomEvent as stable (Daeyeon Jeong) #52618
lib, url:
  * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) #52509
module:
  * (SEMVER-MINOR) implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) #52535
net:
  * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) #52474
src:
  * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) #52595
src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) #52730
test_runner:
  * (SEMVER-MINOR) add --test-skip-pattern cli option (Aviv Keller) #52529
url:
  * (SEMVER-MINOR) implement parse method for safer URL parsing (Ali Hassan) #52280

PR-URL: #52768
@aduh95 aduh95 force-pushed the v22.1.0-proposal branch from 7e00ff2 to 87b87a8 Compare May 2, 2024 07:55
@nodejs-github-bot

This comment was marked as duplicate.

@nodejs-github-bot

This comment was marked as duplicate.

@targos targos merged commit 87b87a8 into v22.x May 2, 2024
48 checks passed
@targos targos deleted the v22.1.0-proposal branch May 2, 2024 13:53
targos added a commit that referenced this pull request May 2, 2024
targos added a commit that referenced this pull request May 2, 2024
targos pushed a commit that referenced this pull request May 2, 2024
Notable changes:

buffer:
  * improve `base64` and `base64url` performance (Yagiz Nizipli) #52428
dns:
  * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) #52492
events,doc:
  * mark CustomEvent as stable (Daeyeon Jeong) #52618
lib, url:
  * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) #52509
module:
  * (SEMVER-MINOR) implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) #52535
net:
  * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) #52474
src:
  * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) #52595
src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) #52730
test_runner:
  * (SEMVER-MINOR) add --test-skip-pattern cli option (Aviv Keller) #52529
url:
  * (SEMVER-MINOR) implement parse method for safer URL parsing (Ali Hassan) #52280

PR-URL: #52768
targos added a commit to targos/nodejs.org that referenced this pull request May 2, 2024
github-merge-queue bot pushed a commit to nodejs/nodejs.org that referenced this pull request May 2, 2024
Ch3nYuY pushed a commit to Ch3nYuY/node that referenced this pull request May 8, 2024
Notable changes:

buffer:
  * improve `base64` and `base64url` performance (Yagiz Nizipli) nodejs#52428
dns:
  * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) nodejs#52492
events,doc:
  * mark CustomEvent as stable (Daeyeon Jeong) nodejs#52618
lib, url:
  * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) nodejs#52509
module:
  * (SEMVER-MINOR) implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) nodejs#52535
net:
  * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) nodejs#52474
src:
  * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) nodejs#52595
src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) nodejs#52730
test_runner:
  * (SEMVER-MINOR) add --test-skip-pattern cli option (Aviv Keller) nodejs#52529
url:
  * (SEMVER-MINOR) implement parse method for safer URL parsing (Ali Hassan) nodejs#52280

PR-URL: nodejs#52768
sophoniie pushed a commit to sophoniie/node that referenced this pull request Jun 20, 2024
Notable changes:

buffer:
  * improve `base64` and `base64url` performance (Yagiz Nizipli) nodejs#52428
dns:
  * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) nodejs#52492
events,doc:
  * mark CustomEvent as stable (Daeyeon Jeong) nodejs#52618
lib, url:
  * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) nodejs#52509
module:
  * (SEMVER-MINOR) implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) nodejs#52535
net:
  * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) nodejs#52474
src:
  * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) nodejs#52595
src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) nodejs#52730
test_runner:
  * (SEMVER-MINOR) add --test-skip-pattern cli option (Aviv Keller) nodejs#52529
url:
  * (SEMVER-MINOR) implement parse method for safer URL parsing (Ali Hassan) nodejs#52280

PR-URL: nodejs#52768
bmeck pushed a commit to bmeck/node that referenced this pull request Jun 22, 2024
Notable changes:

buffer:
  * improve `base64` and `base64url` performance (Yagiz Nizipli) nodejs#52428
dns:
  * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) nodejs#52492
events,doc:
  * mark CustomEvent as stable (Daeyeon Jeong) nodejs#52618
lib, url:
  * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) nodejs#52509
module:
  * (SEMVER-MINOR) implement NODE_COMPILE_CACHE for automatic on-disk code caching (Joyee Cheung) nodejs#52535
net:
  * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) nodejs#52474
src:
  * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) nodejs#52595
src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) nodejs#52730
test_runner:
  * (SEMVER-MINOR) add --test-skip-pattern cli option (Aviv Keller) nodejs#52529
url:
  * (SEMVER-MINOR) implement parse method for safer URL parsing (Ali Hassan) nodejs#52280

PR-URL: nodejs#52768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. release Issues and PRs related to Node.js releases. v22.x v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.