106 Commits
Author SHA1 Message Date
Filip Skokan 34e3b90621 build: require OpenSSL 3 or later
configure now fails when --shared-openssl points at OpenSSL 1.x rather
than failing later at compile or link time. The check skips BoringSSL,
whose version macros claim 1.1.1.

Stop setting the OpenSSL 1.1 API compatibility level for bundled builds.
ncrypto selects the supported API level directly.

Update the assembler capability check, shared-library test matrix,
package fallbacks, and internal version-number typing for the new
baseline.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/64777
Fixes: https://github.com/nodejs/node/issues/56733
Refs: https://github.com/nodejs/node/pull/64211
Refs: https://github.com/nodejs/node/pull/63966
Refs: https://github.com/nodejs/node/pull/53329
Refs: https://github.com/nodejs/node/pull/48950
Refs: https://github.com/nodejs/node/issues/45465
Refs: https://github.com/nodejs/node/issues/42827
Refs: https://github.com/nodejs/node/issues/47076
Refs: https://github.com/nodejs/node/pull/62862
Refs: https://github.com/nodejs/node/pull/38512
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-10-25 22:36:29 +01:00
StefanStojanovicandChengzhong Wu 4c294b3b27 build,win: fix Perfetto
Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com>
Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/66876
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-10-23 10:09:22 +02:00
Antoine du Hamel 37a0b0dd93 src: remove HAVE_QUIC macro in favor of OPENSSL_NO_QUIC
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66373
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2026-09-30 07:39:34 +00:00
Antoine du Hamel f3ae4554fe build: do not use bundled simdutf when built with --shared-simdutf
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65891
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-09-18 15:39:26 +00:00
Chengzhong Wu 718cfe4016 build: enable V8 gdb/lldb plugin support
Build `v8_debug_helper.{so|dylib}` to enable V8 gdb/lldb postmortem
plugin support for the V8 version that Node.js built with.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/65786
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-09-07 11:42:20 +00:00
Richard Lau 626f42d437 build: target Power 9 and z14
Set compiler flags to match the minimum supported Power and z
architectures.

Signed-off-by: Richard Lau <richard.lau@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/65439
Refs: https://github.com/nodejs/node/pull/61005
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7239348
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-08-22 17:18:06 +00:00
cjihrigandPaolo Insogna d0fa608c07 lib,src,test,doc: add node:ffi module
PR-URL: https://github.com/nodejs/node/pull/62072
Co-authored-by: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2026-04-14 10:44:30 +01:00
Richard Lau 0998c37eb6 build: target Power 9 for AIX/IBM i
Minimum supported Power architecture for AIX and IBM i is now Power 9.

PR-URL: https://github.com/nodejs/node/pull/62296
Refs: https://github.com/nodejs/node/pull/61005
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-03-19 14:17:22 +00:00
Antoine du Hamel 48c208fe66 build: do not depend on V8 deps on --without-bundled-v8 builds
PR-URL: https://github.com/nodejs/node/pull/62033
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-03-03 17:33:54 +01:00
Antoine du Hamel d5279e5157 tools: cache V8 build on test-shared workflow
This commit makes the CI use the Nix/Cachix cache rather than the
sccache one for building V8 and its dependencies. This should speed up
the average test-shared build time and reduce the stress on the GHA
binary cache – at the expense of slower builds when touching a file used
to building V8.

PR-URL: https://github.com/nodejs/node/pull/61860
Refs: https://github.com/nodejs/node/issues/61436
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-02-19 07:35:21 +00:00
Anna Henningsen 8ba4d727a8 src: track allocations made by zstd streams
This is both valuable as a diagnostic tool and as a way to inform
the JS runtime about external allocations.

Currently, this is a feature only enabled in the statically linked
builds of zstd, so with `--shared-zstd`, we fall back to the
non-tracking variant.

PR-URL: https://github.com/nodejs/node/pull/61717
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-02-09 20:42:56 +00:00
Yagiz Nizipli 37e40040a7 build,deps: replace cjs-module-lexer with merve
PR-URL: https://github.com/nodejs/node/pull/61456
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-01-28 07:29:58 +00:00
Matteo Collina 853277a9e2 quic: move quic behind compile time flag
Move node:quic behind a compile-time flag, disabled by default.
Use --experimental-quic at configure time to enable.

- Add --experimental-quic flag to configure.py
- Add node_use_quic variable and HAVE_QUIC define
- Make QUIC sources conditional in node.gyp
- Move ngtcp2/nghttp3 deps under QUIC condition in node.gypi
- Update C++ guards to check HAVE_QUIC
- Update process.features.quic to check node_use_quic

PR-URL: https://github.com/nodejs/node/pull/61444
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-01-21 17:39:28 +00:00
hqzing 608ff5c25c build: fix misplaced comma in ldflags
PR-URL: https://github.com/nodejs/node/pull/61294
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-01-11 18:15:00 +00:00
Joyee Cheung 77c2b53834 build: expose libplatform symbols in shared libnode
This requires setting BUILDING_V8_PLATFORM_SHARED to expose the
public symbols since we build with hidden visibility by default.

PR-URL: https://github.com/nodejs/node/pull/61144
Fixes: https://github.com/nodejs/node/issues/61102
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-01-05 13:08:06 +00:00
Antoine du Hamel 14f02fc2f7 lib,src,test: fix tests without SQLite
PR-URL: https://github.com/nodejs/node/pull/60906
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-12-11 23:04:24 +01:00
James M Snell 65a32bac18 deps: add ngtcp2 test binaries
The goal here is to add the ngtcp2 client and server
samples so that we can use them in CI to test our QUIC
implementation.

PR-URL: https://github.com/nodejs/node/pull/59946
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-09-27 12:17:49 -07:00
James M Snell cd9fd09a27 quic: multiple fixups and updates
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59342
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-09-07 19:29:01 -07:00
Chengzhong Wu 80245da920 tools: add v8windbg target
PR-URL: https://github.com/nodejs/node/pull/59767
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-09-07 21:39:13 +00:00
James M Snell 0e754fa5d1 quic: start re-enabling quic with openssl 3.5
Start working on re-enabling QUIC support with the availability
of OpenSSL 3.5. This will be a multi-step process.

Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59249
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-08-03 13:48:27 -07:00
hqzing 7964eb3a3b build: add support for OpenHarmony operating system
PR-URL: https://github.com/nodejs/node/pull/58350
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-05-21 13:18:38 +00:00
Michael Dawson 535c2f7562 sqlite: add build option to build without sqlite
Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/58122
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-05-07 17:20:57 -04:00
Michaël ZassoandAbdirahim Musse e9a75322eb tools: update V8 gypfiles for 13.4
Build Node.js with simdutf version from V8.

Refs: https://github.com/v8/v8/commit/d62905147cf63e52a8c1417d7be7e5b783d3f211
Refs: https://github.com/v8/v8/commit/616c87580c06e76d991c06213530e5ac0043c314
Refs: https://github.com/v8/v8/commit/e3204d589e7911bd2ee75784bec2f9c9e482bbcb
Refs: https://github.com/v8/v8/commit/e8293d2b878ecf639f2c55219068a8b780e01030
Refs: https://github.com/v8/v8/commit/aeb22200587fd36f1bb65f3657221db4b93c6693
Refs: https://github.com/v8/v8/commit/5621164e3c9218fa4e4b8a4a7cd0b6784c46fa18
Co-authored-by: Abdirahim Musse <abdirahim.musse@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/58070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-05-02 15:10:35 +02:00
Michaël Zasso cff3fa5f03 build,src,tools: adapt build config for V8 13.3
Refs: https://github.com/v8/v8/commit/1c9f59c80f37124f0b967c9f62e93ff35380a692
Refs: https://github.com/v8/v8/commit/b1c5eba50ac61e405a4e02bd3682c915a948c8ea
Refs: https://github.com/v8/v8/commit/b3054f77d65ea96ddf6e0a526abadebd91d7114e
Refs: https://github.com/v8/v8/commit/f81e87ee5c6815db81c6ca84ae932c944b1d6191
Refs: https://github.com/v8/v8/commit/dc0e30522358f421585aa9bb8e5e52cd11a7e09f
Refs: https://github.com/v8/v8/commit/41d42cec13ea567f461d98dfb04d641e30d6bb5b
PR-URL: https://github.com/nodejs/node/pull/58070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-05-02 15:10:35 +02:00
Stefan Stojanovic 4edc6dbe71 build,win: disable node pch with ccache
PR-URL: https://github.com/nodejs/node/pull/57224
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2025-02-27 19:45:15 +00:00
Jan Krems f5353100be deps,tools: add zstd 1.5.6
PR-URL: https://github.com/nodejs/node/pull/52100
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 12:43:52 +00:00
Tim Jacomb efe698ee93 crypto: added support for reading certificates from macOS system store
PR-URL: https://github.com/nodejs/node/pull/56599
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-01-28 15:54:50 +00:00
Chengzhong Wu 4211ab56cc src,build: add no user defined deduction guides of CTAD check
PR-URL: https://github.com/nodejs/node/pull/56071
Refs: https://google.github.io/styleguide/cppguide.html#CTAD
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-12-06 09:44:11 +00:00
Jakub Jirutka 64c647e342 build: compile bundled simdutf conditionally
The --shared-simdutf flag was introduced in #52924, but the
implementation was incomplete.

Resolves #52914

PR-URL: https://github.com/nodejs/node/pull/55886
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-11-18 18:25:35 +00:00
Jakub Jirutka dd15563a47 build: compile bundled simdjson conditionally
The --shared-simdjson flag was introduced in #52924, but the
implementation was incomplete.

Resolves #52914

PR-URL: https://github.com/nodejs/node/pull/55886
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-11-18 18:25:34 +00:00
Jakub Jirutka 88719f6800 build: compile bundled ada conditionally
The --shared-ada flag was introduced in #52924, but the implementation
was incomplete.

Resolves #52914

PR-URL: https://github.com/nodejs/node/pull/55886
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-11-18 18:25:34 +00:00
Stefan Stojanovic 27f8d9e9d2 build,win: enable pch for clang-cl
Fixes: https://github.com/nodejs/node/issues/55208
PR-URL: https://github.com/nodejs/node/pull/55249
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-10-11 10:28:55 +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
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 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
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
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
Chengzhong Wu 8b2011a818 build: define NOMINMAX in common.gypi
V8 and Node.js had defined `NOMINMAX` on Windows for a long time.  In
recent changes, V8 added `std::numeric_limits::min` usages in its
header files which caused addons without `NOMINMAX` defines failed
to compile.

Define `NOMINMAX` in common.gypi so that addons can be compiled with
the latest V8 header files.

PR-URL: https://github.com/nodejs/node/pull/52794
Fixes: https://github.com/nodejs/nan/issues/968
Refs: https://github.com/nodejs/gyp-next/pull/244
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2024-05-04 13:55:06 +00:00
Richard Lau 7b3eb311a7 src: fix dynamically linked zlib version
Report the version of the dynamically linked zlib if built with
`configure --shared-zlib` instead of the hardcoded version that
corresponds to the bundled version of zlib in `deps`.

PR-URL: https://github.com/nodejs/node/pull/51007
Refs: https://github.com/nodejs/node/pull/50910
Refs: https://github.com/nodejs/node/pull/50158
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2023-12-04 17:30:58 +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
Jiawen Geng 3e7043a19e build: add extra semi check
PR-URL: https://github.com/nodejs/node/pull/46194
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-01-17 01:26:44 +00:00
Anna Henningsen 43e09af8e6 src: fix creating Isolates from addons
daae938f32 broke addons which create their own `Isolate`
instances, because enabling the shared-readonly-heap feature
of V8 requires all snapshots used for different `Isolate`s to
be identical. Usage of addons that do this has probably
decreased quite a bit since Worker threads were introduced
in Node.js, but it’s still a valid use case, and in any case
the breakage was probably not intentional (although the referenced
commit did require test changes because of this issue).

This commit addresses this issue partially by caching the
V8 snapshot parameters and ignoring ones passed in from users
in `NewIsolate()` when this feature is enabled, and makes
the `NodeMainInstance` snapshot-based isolate creation
also re-use this code.

PR-URL: https://github.com/nodejs/node/pull/45885
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-12-23 17:06:05 +00: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
chexiongsheng 6c8c3d89b0 gyp: libnode for ios app embedding
PR-URL: https://github.com/nodejs/node/pull/44210
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2022-09-21 18:02:40 +08:00
Moshe Atlow beb0520af7 cli: add --watch
PR-URL: https://github.com/nodejs/node/pull/44366
Fixes: https://github.com/nodejs/node/issues/40429
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-09-05 12:25:09 +03:00
William Marlow 1af70548bd build: fix various shared library build issues
Node.js unofficially supports a shared library variant where the
main node executable is a thin wrapper around node.dll/libnode.so.
The key benefit of this is to support embedding Node.js in other
applications.

Since Node.js 12 there have been a number of issues preventing the
shared library build from working correctly, primarily on Windows:

* A number of functions used executables such as `mksnapshot` are
    not exported from `libnode.dll` using a `NODE_EXTERN` attribute
* A dependency on the `Winmm` system library is missing
* Incorrect defines on executable targets leads to `node.exe`
    claiming to export a number of functions that are actually in
    `libnode.dll`
* Because `node.exe` attempts to export symbols, `node.lib` gets
    generated causing native extensions to try to link against
    `node.exe` not `libnode.dll`.
* Similarly, because `node.dll` was renamed to `libnode.dll`,
    native extensions don't know to look for `libnode.lib` rather
    than `node.lib`.
* On macOS an RPATH is added to find `libnode.dylib` relative to
    `node` in the same folder. This works fine from the
    `out/Release` folder but not from an installed prefix, where
    `node` will be in `bin/` and `libnode.dylib` will be in `lib/`.
* Similarly on Linux, no RPATH is added so LD_LIBRARY_PATH needs
    setting correctly for `bin/node` to find `lib/libnode.so`.

For the `libnode.lib` vs `node.lib` issue there are two possible
options:

1. Ensure `node.lib` from `node.exe` does not get generated, and
    instead copy `libnode.lib` to `node.lib`. This means addons
    compiled when referencing the correct `node.lib` file will
    correctly depend on `libnode.dll`. The down side is that
    native addons compiled with stock Node.js will still try to
    resolve symbols against node.exe rather than libnode.dll.
2. After building `libnode.dll`, dump the exports using `dumpbin`,
    and process this to generate a `node.def` file to be linked into
    `node.exe` with the `/DEF:node.def` flag. The export entries
    in `node.def` will all read
    ```
    my_symbol=libnode.my_symbol
    ```
    so that `node.exe` will redirect all exported symbols back to
    `libnode.dll`. This has the benefit that addons compiled with
    stock Node.js will load correctly into `node.exe` from a shared
    library build, but means that every embedding executable also
    needs to perform this same trick.

I went with the first option as it is the cleaner of the two
solutions in my opinion. Projects wishing to generate a shared
library variant of Node.js can now, for example,
```
.\vcbuild dll package vs
```
to generate a full node installation including `libnode.dll`,
`Release\node.lib`, and all the necessary headers. Native addons
can then be built against the shared library build easily by
specifying the correct `nodedir` option.

For example
```
>npx node-gyp configure --nodedir
   C:\Users\User\node\Release\node-v18.0.0-win-x64
...
>npx node-gyp build
...
>dumpbin /dependents build\Release\binding.node
Microsoft (R) COFF/PE Dumper Version 14.29.30136.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file build\Release\binding.node

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    libnode.dll
    VCRUNTIME140.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
...
```

PR-URL: https://github.com/nodejs/node/pull/41850
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-05-06 17:24:46 -04:00
Daniel Bevenius 66da32c045 deps,test,src,doc,tools: update to OpenSSL 3.0
This pull request updates the OpenSSL version that is statically
linked with Node.js from OpenSSl 1.1.1 to quictls OpenSSL 3.0.0+quic.

This pull request will replace the OpenSSL version that is currently
in the deps directory and when performing a normal build
OpenSSL 3.0+quic will be statically linked to the Node.js executable.
We will still be able to dynamically link to OpenSSL 1.1.1 and we have
a CI job which dynamically links to OpenSSL 1.1.1 which is run for
every pull request to make sure that we maintain backward compatibility.

PR-URL: https://github.com/nodejs/node/pull/38512
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-11 06:28:08 +02:00
Houssem Chebab 0af0d1c30d tools: fix typo
compability -> compatibility

PR-URL: https://github.com/nodejs/node/pull/39044
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-06-16 10:25:35 +02:00
Daniel Bevenius 7df0fc5c5c build: move OPENSSL_API_COMPAT to else clause
Currently there are a number of deprecation warnings generated when
linking with OpenSSL 3.0, for example:

In file included from ../src/crypto/crypto_scrypt.h:6,
                 from ../src/crypto/crypto_scrypt.cc:1:
../src/crypto/crypto_util.h:64:37: warning:
‘void RSA_free(RSA*)’ is deprecated: Since OpenSSL 3.0
[-Wdeprecated-declarations]
   64 | using RSAPointer = DeleteFnPtr<RSA, RSA_free>;

The reason for this is that I had placed the macro OPENSSL_API_COMPAT
inside of the node_shared_openssl="false" clause, but that was a
mistake and this macro should have gone into the else clause instead.

PR-URL: https://github.com/nodejs/node/pull/38126
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-09 05:42:27 +02:00
James M Snell 43f599b534 deps: add ngtcp2 and nghttp3
Reintroduces the ngtcp2 and nghttp3 dependencies, building those by
default if the vendored-in openssl (with QUIC support) is used or the
shared openssl defines `OPENSSL_INFO_QUIC`.

Upates the version metadata to reflect whether ngtcp2 and nghttp3 are
present.

ngtcp2 as of
https://github.com/ngtcp2/ngtcp2/commit/2381f7f7b633602d83ad3de997153df730b1f649
nghttp3 as of
https://github.com/ngtcp2/nghttp3/commit/66ad30f0a8f5164f87fbc83b37628f8f6d9ba608

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37682
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-03-19 08:18:37 -07:00