0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 13:09:21 +01:00
Commit Graph

193 Commits

Author SHA1 Message Date
Michael Cho
81517facea
build: fix building with system icu 76
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>
2024-10-29 23:24:38 +00:00
Mohammed Keyvanzadeh
70fcb87af4
build: fix path concatenation
- 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>
2024-10-17 13:05:02 +00:00
Segev Finer
beb1892036 build: add the option to generate compile_commands.json in vcbuild.bat
Refs: https://github.com/nodejs/gyp-next/pull/238
PR-URL: https://github.com/nodejs/node/pull/52279
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:00:01 -07:00
Daeyeon Jeong
aff2214ca9 build: fix conflicting V8 object print flags
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54785
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-13 08:25:19 -07:00
Joyee Cheung
3d410f8635
build: do not build with code cache for core coverage collection
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>
2024-09-07 23:16:32 +00:00
Michael Dawson
ce19715cbb deps: allow amaro to be externalizable
- allow amaro to be externalized like other builtins
  containing WASM. More context is available in
  https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-dependencies.md#supporting-externalizable-dependencies-with-javascript-code

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54646
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-05 14:27:30 -04:00
Aviv Keller
22daeba24d
build: update required python version to 3.8
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>
2024-08-23 21:20:32 +00:00
Michaël Zasso
2573f74b0d
build: always disable strict aliasing
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>
2024-08-14 18:33:43 +00:00
Michaël Zasso
046343ea9d
build: warn for GCC versions earlier than 12.2
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>
2024-08-05 13:25:44 +00:00
Antoine du Hamel
1e3a3470a5
build: add --without-amaro build flag
PR-URL: https://github.com/nodejs/node/pull/54136
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-08-02 10:37:36 +00:00
Shelley Vohr
3b16d4c0ad
build: ensure v8_pointer_compression_sandbox is enabled on 64bit
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>
2024-07-24 10:00:07 +00:00
Chengzhong Wu
e192a32c27
build: fix conflict gyp configs
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>
2024-07-23 08:56:44 +00:00
Daniel Bayley
cff7da7749
src,test: further cleanup references to osx
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>
2024-07-15 20:32:26 +00:00
Chengzhong Wu
ab5e58bf29
Revert "build: only generate specified build type files"
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>
2024-06-26 07:29:47 +00:00
Chengzhong Wu
78ea6cee1b
build: configure with shared sqlite3
PR-URL: https://github.com/nodejs/node/pull/53519
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-06-22 23:15:42 +00:00
Chengzhong Wu
6cb940a546
build: only generate specified build type files
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>
2024-06-22 08:36:36 +00:00
Michaël Zasso
7ad0cc3e57
build: remove support for 32-bit Windows
Closes: https://github.com/nodejs/node/issues/42543
PR-URL: https://github.com/nodejs/node/pull/53184
Fixes: https://github.com/nodejs/node/issues/42543
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-05-30 14:28:47 +00:00
Zhenwei Jin
007b934379
build: fix ./configure --help format error
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>
2024-05-23 13:34:43 +00:00
Michaël Zasso
efa63f3d05
build: add option to enable clang-cl on Windows
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>
2024-05-13 19:05:05 +00:00
Pooja D P
49e2c690ae
build: enable building with shared uvwasi lib
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>
2024-05-12 12:24:13 +02:00
Daniel Lemire
d78537b3df
deps: enable unbundling of simdjson, simdutf, ada
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>
2024-05-11 19:16:25 +00:00
Mohammed Keyvanzadeh
c70fa2c6dc
build: remove deprecated calls for argument groups
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>
2024-05-11 02:03:03 +00:00
Michaël Zasso
25c788009f build: harmonize Clang checks
- 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>
2024-05-09 12:10:59 +00:00
Rafael Gonzaga
ba06c5c509
build,tools: add test-ubsan ci
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
Co-Authored-By: Santiago Gimeno <santiago.gimeno@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46297
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2024-03-15 17:49:51 +00:00
Michael Dawson
9936d4586d build: build opt to set local location of headers
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>
2024-02-15 16:41:37 -05:00
Keyhan Vakil
1a5acd0638
v8: enable maglev on supported architectures
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>
2024-01-08 00:29:10 +00:00
Michaël Zasso
c21b2bee72
build: fix arm64 cross-compilation
Commit 938212f added -msign-return-address=all to _all_ cflags but that
is wrong when cross-compiling, it should only be added to the target's
cflags.

The flag being deprecated, it is also changed to
`-mbranch-protection=standard`.

Fixes: https://github.com/nodejs/node/issues/42888
Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/51256
Fixes: https://github.com/nodejs/build/issues/3319
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-12-27 06:19:24 +00:00
Cheng Zhao
0bb5d88871
v8,tools: expose necessary V8 defines
PR-URL: https://github.com/nodejs/node/pull/50820
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-11-25 04:30:50 +00:00
Keyhan Vakil
5b73da02e5 build: add configuration flag to enable Maglev
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>
2023-11-20 04:10:40 +00:00
Luigi Pinca
95534ad82f
build: fix build with Python 3.12
Replace `distutils.version.StrictVersion` with
`packaging.version.Version`.

Refs: https://github.com/nodejs/node/pull/50209#issuecomment-1795852539
PR-URL: https://github.com/nodejs/node/pull/50582
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-11-08 20:20:53 +00:00
Cheng Zhao
d1ccca9d2b
build: fix building when there is only python3
PR-URL: https://github.com/nodejs/node/pull/48462
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2023-10-25 02:43:37 +00:00
Michaël Zasso
86cb23d09f
tools: update V8 gypfiles for 11.8
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>
2023-10-10 08:26:53 +02:00
Joyee Cheung
0028fd12b7
build: add --write-snapshot-as-array-literals to configure.py
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>
2023-09-04 23:44:23 +02:00
Juan José
5ff1ead6b2
build: add symlink to compile_commands.json file if needed
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>
2023-08-24 14:02:04 +00:00
michalbiesek
b3eb05baa0
build: fix typo libray -> library (configure.py)
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>
2023-08-15 18:40:33 +00:00
Richard Lau
ae9f919880
build: fix configure --link-module
Add the list of linked modules to the arguments for `js2c.py`. These
were unintentionally omitted when the build was previously refactored
to avoid command line length limits on Windows.

PR-URL: https://github.com/nodejs/node/pull/48522
Fixes: https://github.com/nodejs/node/issues/42302
Refs: https://github.com/nodejs/node/pull/39069
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-24 15:36:14 +00:00
Cheng Shao
aca3a103a6
build: set v8_enable_webassembly=false when lite mode is enabled
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>
2023-06-01 18:11:26 +00:00
Mohammed Keyvanzadeh
d2156f1bf0
build: use pathlib for paths
Use Python's `pathlib` library for paths and related operations
instead of `os.path`.

Refs: https://github.com/nodejs/node/pull/47323#discussion_r1163799518 https://github.com/nodejs/node/pull/47323#issuecomment-1510350194
PR-URL: https://github.com/nodejs/node/pull/47581
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
2023-05-02 19:20:22 +00:00
Mohammed Keyvanzadeh
a4cf6b204f
build: refactor configure.py
- 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>
2023-05-01 09:13:16 +00:00
Mohammed Keyvanzadeh
ae4f041cdb
build: avoid usage of pipes library
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>
2023-03-29 19:34:58 +00:00
Richard Lau
c1bcdbcf79
build: warn for gcc versions earlier than 10.1
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>
2023-02-25 18:38:43 +00:00
Xu Meng
a3211e18b4
build,test: add proper support for IBM i
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>
2023-02-22 04:18:56 +00:00
Rich Trott
a065083bd5 build: do not disable inspector when intl is disabled
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>
2023-02-18 19:40:33 +00:00
Darshan Sen
9bbde3d7ba
src: add initial support for single executable applications
Compile a JavaScript file into a single executable application:

```console
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js

$ cp $(command -v node) hello

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
    --macho-segment-name NODE_JS

$ ./hello world
Hello, world!
```

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-18 02:49:18 +00:00
RafaelGSS
f369c0a739 build: build ICU with ICU_NO_USER_DATA_OVERRIDE
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1625036
CVE-ID: 2023-23920
PR-URL: https://github.com/nodejs-private/node-private/pull/374
Reviewed-by: Michael Dawson <midawson@redhat.com>
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Richard Lau <rlau@redhat.com>
2023-02-16 18:50:03 -03:00
Anna Henningsen
21fb98e2bf
src: use simdutf for converting externalized builtins to UTF-16
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>
2023-01-10 11:25:19 +00:00
Anna Henningsen
eb5895ae3e
build: add option to disable shared readonly heap
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>
2022-12-21 19:16:56 +00:00
Joyee Cheung
a996638e53
build: disable v8 snapshot compression by default
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>
2022-12-12 01:53:53 +01:00
Shi Lei
d783a1c128
build,deps,src: fix Intel VTune profiling support
PR-URL: https://github.com/nodejs/node/pull/45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-11-22 08:28:19 +00:00
MURAKAMI Masahiko
6638f09fe1
build: add --v8-disable-object-print flag
--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>
2022-11-17 00:28:48 +00:00