ICU 76 decided to reduce overlinking[^1] thus `icu-i18n` will no longer
add `icu-uc` when linking to shared libraries. This results in undefined
symbols/references when trying to build with system ICU 76.
[^1]: unicode-org/icu@199bc82
PR-URL: https://github.com/nodejs/node/pull/55563
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- The `Path` class does not support concatenation with the `+`
operator, so use the `/` operator instead.
- When concatenating paths, if the operand is an absolute path the
previous path is ignored, so change `/include` to `include`.
PR-URL: https://github.com/nodejs/node/pull/55387
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Disable code cache for built-ins when are building Node.js to
collect test coverage of built-ins, as code caching makes the
V8 coverage collection less precises (specifically, all the
functions deserialized from the code cache will not have
block-level coverage data).
Data from local testing:
Before:
---------|----------|---------|---------
% Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
95.58 | 94.43 | 95.19 | 95.58
---------|----------|---------|---------
After:
---------|----------|---------|---------
% Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
95.93 | 94.77 | 96.03 | 95.93
---------|----------|---------|---------
PR-URL: https://github.com/nodejs/node/pull/54633
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Co-Authored-By: Jim B <d3x0r@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/54358
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
V8 relies on it.
PR-URL: https://github.com/nodejs/node/pull/54339
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Update the warning threshold for GCC to 12.2 starting from Node.js 23.
Builds can still proceed with earlier versions of GCC, but are not
guaranteed to work.
PR-URL: https://github.com/nodejs/node/pull/54081
Refs: https://github.com/nodejs/build/issues/3806
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/53884
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Gyp generated build files can be built in either Release/Debug mode.
- make: single directory, two configurations by cli:
`make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
`msbuild node.sln /p:Configuration=Release` and
`msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
`ninja -C out/Release` or `ninja -C out/Debug`.
Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.
Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`
PR-URL: https://github.com/nodejs/node/pull/53605
Fixes: https://github.com/nodejs/node/issues/53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/53820
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This reverts commit 6cb940a546.
PR-URL: https://github.com/nodejs/node/pull/53580
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Release and Debug build configurations can not be shared, only
generate specified configuration in `configure`.
PR-URL: https://github.com/nodejs/node/pull/53511
Fixes: https://github.com/nodejs/node/issues/53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/53066
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Most changes are gated by the `clang==1` condition to avoid breaking
MSVC builds.
Select C/C++ language standard with ClCompile options.
This avoids passing the `-std:c++20` flag while compiling C code.
Do it only under clang option to avoid breaking addons until node-gyp
supports the new LanguageStandard options.
Disable precompiled header configuration for now as it doesn't seem to
work with clang-cl.
Disable C++20 warnings emitted by the Visual Studio C++ STL.
They're very noisy and not our responsibility to fix.
Co-authored-by: Daniel Lemire <daniel@lemire.me>
Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
PR-URL: https://github.com/nodejs/node/pull/52870
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fixes: https://github.com/nodejs/node/issues/35339
Co-authored-by: Pooja D P <Pooja.D.P@ibm.com>
Co-authored-by: Teutates <103068388+Teutates@users.noreply.github.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/43987
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/52924
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove calls of `add_argument_group()` where an existing argument group
is passed as an argument, this is deprecated since Python 3.11.
PR-URL: https://github.com/nodejs/node/pull/52913
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- Set the clang variable in `config.gypi` so it depends on compiler
checks made by the configure script.
- Replace gyp conditions with `llvm_version` and "0.0" with conditions
that use the `clang` variable.
- Always use `clang==1` or `clang==0` in gyp conditions
PR-URL: https://github.com/nodejs/node/pull/52873
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Some linux distroes install headers through their
package managers. When headers are locally installed
we'd like them to be used.
Add a build time configuration option
--use-prefix-to-find-headers that will will suggest to
node-gyp to look for headers based on the prefix
A PR to node-gyp will use this value when building
addons to automatially find and use the headers
if they have been installed locally
Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/51525
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Enable V8's new maglev compiler by default on supported architectures.
This brings modest performance improvements for short-lived workloads
like CLI programs (see the linked issue) and brings Node.js's
configuration slightly closer to Google Chrome's.
I marked this change as semver-major because Maglev can theoretically
cause performance regressions, although I haven't seen an example of
that in the (somewhat limited) benchmarking I've done.
**Notable Change Summary:** V8's Maglev Compiler is now enabled by
default on supported architectures (https://v8.dev/blog/maglev). Maglev
improves CPU performance for short-lived CLI programs by around 8%.
Fixes: https://github.com/nodejs/node/issues/50690
PR-URL: https://github.com/nodejs/node/pull/51360
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This adds a configuration flag to enable V8's Maglev compiler.
Unfortunately compilation fails unless you have clang-14+ or gcc-13+,
but I sent a patch for that upstream. Other than that, it builds and all
tests pass locally on my x86-64 Linux machine.
The gn scraper regexes were broken preventing the compilation from
linking. Fix them. As a drive-by, also add additional conditionals for
compilation on 32-bit arm.
Refs: https://github.com/nodejs/node/issues/50690
PR-URL: https://github.com/nodejs/node/pull/50692
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/49639
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This makes it easier to locate indeterminism in the snapshot, with
the following command:
$ ./configure --write-snapshot-as-array-literals
$ make V=
$ mv out/Release/obj/gen/node_snapshot.cc ./node_snapshot.cc
$ make V=
$ diff out/Release/obj/gen/node_snapshot.cc ./node_snapshot.cc
PR-URL: https://github.com/nodejs/node/pull/49312
Refs: https://github.com/nodejs/build/issues/3043
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Usually lsp servers needs the `compile_commands.json` file in the root
directory.
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/49260
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Signed-off-by: Michal Biesek <michalbiesek@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/49106
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
We should set v8_enable_webassembly=false when lite mode is enabled,
since v8_enable_lite_mode implies v8_jitless, and wasm currently
doesn't work with jitless. This is automatically handled in gn, but
seems to be not the case in gyp. Enabling lite mode without setting
v8_enable_webassembly=false leads to "Warning: disabling flag
--expose_wasm due to conflicting flags" at runtime.
PR-URL: https://github.com/nodejs/node/pull/48248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
- Explicitly specify the encoding when opening files.
- Use f-strings to format strings.
- Use `isinstance()` for type checks instead of `type()`.
- Use the `with` keyword for resource-allocating operations.
- Avoid using multiple statements in a single line.
- Remove unnecessary `else` clauses after `return`.
- Iterate with the `items()` method of dictionaries when both the key
and value are used.
- Remove unnecessary parentheses.
- Rename unused unpacked variables to `_`, `_1`, etc etc.
- Rename the `list` variable to avoid conflict with the global
`list()` function.
PR-URL: https://github.com/nodejs/node/pull/47667
Reviewed-By: Christian Clauss <cclauss@me.com>
Python's `pipes` library is deprecated and will be removed in Python
version 3.13, so remove it's import and replace `pipes.quote()` with
`shlex.quote()`.
PR-URL: https://github.com/nodejs/node/pull/47271
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Update the warning threshold for gcc to 10.1 starting from Node.js 20.
Builds can still proceed with earlier versions of gcc, but are not
guaranteed to work.
PR-URL: https://github.com/nodejs/node/pull/46806
Refs: https://github.com/nodejs/node/discussions/45892
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Python 3.9 on IBM i now properly returns "os400" for sys.platform
instead of claiming to be AIX as it did previously. While the IBM i PASE
environment is compatible with AIX, it is a subset and has numerous
differences which makes it beneficial to distinguish, however this means
that it now needs explicit support here.
PR-URL: https://github.com/nodejs/node/pull/46739
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/37954
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: Yagiz Nizipli <yagiz@nizipli.com>
Remove the dependency on ICU for this part, as well as the
hacky way of converting embedder main sources to UTF-8 via
V8 APIs. Allow `UnionBytes` to own the memory its pointing
to in order to simplify the code on the `BuiltinLoader` side.
PR-URL: https://github.com/nodejs/node/pull/46119
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45887
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
In the upstream, V8 also disables snapshot compression on the
desktop by default because the size reduction is not worth the
performance hit.
https://chromium-review.googlesource.com/c/v8/v8/+/3275554
Locally the binary size of Node.js is increased by ~2.7MB
(+3.2%) with a significant speedup in startup after snapshot
compression is disabled on macOS.
Also adds a --v8-enable-snapshot-compression to configure.py for
users who prefer a size reduction over speedup in startup.
Ideally we should implement our own compression for the source
code + the code cache + the snapshot instead of relying on V8's
builtin compression for just the snapshot.
PR-URL: https://github.com/nodejs/node/pull/45716
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
--v8-enable-object-print flag is set by default true.
so, no way of disable this flag.
add a --v8-disable-object-print flag instead that defaults to false.
Fixes: https://github.com/nodejs/node/issues/45433
PR-URL: https://github.com/nodejs/node/pull/45458
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>