Commit Graph

160 Commits

Author SHA1 Message Date
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
Luigi Pinca
b6c108f092 deps: update zlib to upstream 8bbd6c31
Updated as described in doc/contributing/maintaining-zlib.md.

PR-URL: https://github.com/nodejs/node/pull/45387
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2022-11-16 19:59:11 +00:00
Michael Dawson
ca5be26b31 src: add support for externally shared js builtins
Refs: https://github.com/nodejs/node/issues/44000

- add infra to support externally shared js builtins in
  support of distos that want to externalize deps that
  include JS/WASM instead of native code
- add support for externalizing
  - cjs_module_lexer/lexer
  - cjs_module_lexer/dist/lexer
  - undici/undici

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/44376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2022-10-11 09:44:48 -04: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
Stephen Gallagher
8a1aa55598
build: add --libdir flag to configure
This will allow distribution packages to select an alternative
location for the unofficial libnode.so. For example, on Fedora it
will install into /usr/lib64 on 64-bit systems.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/44361
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-08-28 08:12:42 +00:00
Jeremiah Gowdy
938212f3e7
build: enable pointer authentication for branch protection on arm64
PR-URL: https://github.com/nodejs/node/pull/43200
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-08-12 22:41:26 +00:00
Ben Noordhuis
aa3a572e6b
build: remove dtrace & etw support
There are no clear indicators anyone is using the dtrace USDT probes.

ETW support is very intertwined with the dtrace infrastructure. It's not
clear if anyone uses ETW so to keep things simple it too is removed.

Fixes: https://github.com/nodejs/node/issues/43649

PR-URL: https://github.com/nodejs/node/pull/43652
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-07-17 17:33:52 +01:00
Ben Noordhuis
38f1e2793c
build: remove systemtap support
There are no indicators that anyone is actually using this. Quite the
opposite: it was broken more than it was working during its lifetime.

PR-URL: https://github.com/nodejs/node/pull/43651
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-07-15 08:55:57 +01:00
Daniel Bevenius
f5a5df4802 src,deps,build,test: add OpenSSL config appname
This commit adds the setting of an appname (configuration section
name), 'nodejs_conf', to be used when reading OpenSSL configuration
files.

The motivation for this is that currently the default OpenSSL
configuration, 'openssl_conf', element will be used which may be
undesirable as it might configure OpenSSL in unwanted ways. With this
commit it is still possible to use a default openssl.cnf file but the
only section that Node.js will read from is a section named
'nodejs_conf'.

PR-URL: https://github.com/nodejs/node/pull/43124
Refs: https://github.com/nodejs/node/issues/40366
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2022-05-31 13:41:30 +02:00
Joyee Cheung
fbe1478077
bootstrap: include code cache in the embedded snapshot
Since V8 code cache encodes indices to the read-only space
it is safer to make sure that the code cache is generated in the
same heap used to generate the embdded snapshot. This patch
merges the code cache builder into the snapshot builder and
makes the code cache part of node::SnapshotData that is
deserialized into the native module loader during bootstrap.

PR-URL: https://github.com/nodejs/node/pull/43023
Fixes: https://github.com/nodejs/node/issues/31074
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-05-17 20:38:11 +08:00
Sergey Nazaryev
5e9274a3e7
build: fix indeterminacy of icu_locales value
`icu_locales` is generated by joining values from `set` data structure.
However, `set` doesn't guarantee an order, so the result of
`icu_locales` is not determined. For example, the result value could be
'en,root' or 'root,en'. This fix makes it deterministic.

The main reason of this fix is to restore the reproducibility of the
build because the value of `icu_locales` is embedded into `node` binary.

PR-URL: https://github.com/nodejs/node/pull/42865
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2022-05-06 12:20:44 +01:00
Vita Batrla
2454aa0f1f test: fix test-crypto-fips.js under shared OpenSSL
Fixes: https://github.com/nodejs/node/issues/42827

PR-URL: https://github.com/nodejs/node/pull/42947
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-04 14:20:59 -04:00
Michaël Zasso
daae938f32
build: enable V8's shared read-only heap
It is what V8's build config does by default.

PR-URL: https://github.com/nodejs/node/pull/42809
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2022-04-24 07:29:13 +01:00
Michaël Zasso
40bc08089d
tools: update V8 gypfiles for 10.1
PR-URL: https://github.com/nodejs/node/pull/42657
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-04-12 22:10:39 +02:00
daomingq
aa52873887
build: add configure option --v8-enable-short-builtin-calls
Add configure option --v8-enable-short-builtin-calls
and enable it by default on x86_64 platform.

PR-URL: https://github.com/nodejs/node/pull/42109
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-12 14:46:04 +01:00
Niyas Sait
9b3aad1cdd
build: windows/arm64 native compilation support
Added support for detecting ARM64 host architecture for windows and
avoid explicit cross-compilation flag for win/arm64 target as
configure.py can auto-detect configuration from host and
target architecture.

Refs: https://github.com/nodejs/build/issues/2540

PR-URL: https://github.com/nodejs/node/pull/42408
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-04-05 12:19:18 +01:00
mawaregetsuka
605a01bcfb
tools: fixed bug causing JSON format to be broken
PR-URL: https://github.com/nodejs/node/pull/41565
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-31 13:44:50 +01:00
Joyee Cheung
37aee80643
build: add --node-snapshot-main configure option
This adds a --build-snapshot runtime option which is currently only
supported by the node_mksnapshot binary, and a --node-snapshot-main
configure option that makes use it to run a custom script when
building the embedded snapshot. The idea is to have this experimental
feature in core as a configure-time feature for now, and investigate
the renaming V8 bugs before we make it available to more users via
making it a runtime option.

PR-URL: https://github.com/nodejs/node/pull/42466
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-03-31 19:29:12 +08:00
alexcfyung
e0fa7e0608
build: use zoslib_include_dir provided by node-gyp
The path is based on the zoslib gyp path passed to configure.py
via --static-zoslib-gyp arg.

PR-URL: https://github.com/nodejs/node/pull/41713
Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-02-15 12:51:52 +01:00
Ben Noordhuis
214d7da675
build: remove broken x32 arch support
I added support for x32 back in 2014 but it's been in a state of
disrepair ever since, not in the least because it was never a fully
supported architecture in upstream V8.

V8 dropped x32 support entirely in or around 2018 so the removal from
Node's build system is long overdue.

Refs: https://github.com/nodejs/node/issues/40576

PR-URL: https://github.com/nodejs/node/pull/41905
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-02-11 08:52:24 +00:00
Daoming Qiu
26398575dc build: add --v8-enable-hugepage flag
PR-URL: https://github.com/nodejs/node/pull/41487
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2022-01-19 09:46:13 +00:00
Shi Pujin
81e88f27b7
build: add loong64 configure
PR-URL: https://github.com/nodejs/node/pull/41323
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2022-01-18 19:39:50 +00:00
MrJithil
2ea2621ace build: fix node build failures in WSL Ubuntu
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: https://github.com/nodejs/node/issues/41459

PR-URL: https://github.com/nodejs/node/pull/41476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-01-14 18:08:58 -05:00
alexcfyung
f6e5050579
build: start build on z/OS
Update configure.py, Makefile, and common.gypi to get the
build started on z/OS.

Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
Co-authored-by: Wayne Zhang <zsw007@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/41273
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2022-01-06 15:54:32 +00:00
Cheng Zhao
a706342368
src: add kNoBrowserGlobals flag for Environment
PR-URL: https://github.com/nodejs/node/pull/40532
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-05 11:01:49 +00:00
Rich Trott
bd9272628f
build: use list for mutable retval rather than tuple
We define `retval` as a tuple and then replace the tuple by "appending"
items with `+=` but that actually creates a new tuple every time.
Because it is intended to be mutable, use a list instead, then return a
tuple from the function, as it should be immutable outside the function.

PR-URL: https://github.com/nodejs/node/pull/41372
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-01-05 03:50:14 +00:00
Rich Trott
5999731d26
build: remove Python 2 workaround
Remove workaround for Python 2.

I confirmed that V8 build still works by running `./configure.py &&
make v8`.

PR-URL: https://github.com/nodejs/node/pull/41357
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2022-01-01 16:27:27 +00:00
Jonah Snider
6ef6bdf1fd
build: add --without-corepack
PR-URL: https://github.com/nodejs/node/pull/41060
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-12-05 10:23:25 +00:00
Daniel Bevenius
f4bd91b0e2 deps,build,tools: fix openssl-is-fips for ninja builds
Currently using the --openssl-is-fips configuration option in
combination with --ninja is broken.

This commit fixes two issues, one being an issue with the linker/version
script path variable. The second is that the locations of built
artifacts that differ for ninja and make.

ninja:
$ ./configure --openssl-is-fips --ninja
$ ninja -C out/Release
$ ./node --enable-fips -p 'crypto.getFips()'
1

make:
$ ./configure --openssl-is-fips
$ make -j8
$ ./node --enable-fips -p 'crypto.getFips()'
1

PR-URL: https://github.com/nodejs/node/pull/40518
Refs: https://github.com/nodejs/node/issues/40509
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-10-21 04:16:19 +02: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
Christian Clauss
b25a73f26a
build: pass a tuple of alternatives to str.endswith()
https://docs.python.org/3/library/stdtypes.html#str.endswith

One function call should be faster than three function calls per file.

PR-URL: https://github.com/nodejs/node/pull/40017
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-09-26 10:59:21 +02:00
legendecas
9b5aa8d99e
build: override python executable path on configure
PR-URL: https://github.com/nodejs/node/pull/39465
Fixes: https://github.com/nodejs/node/issues/39408
Fixes: https://github.com/nodejs/node/issues/39456
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2021-07-30 01:20:00 +08:00
Richard Lau
05f21be800 build: fix host_arch_cc() for AIX/IBM i
The AIX/IBM i branch in `host_arch_cc()` that hardcodes the compiler
executable to `gcc` precludes picking up either `CC_host` or `CC`
environment variables (if set) as is done on other platforms. On an
AIX/IBM i platform where the compiler is, e.g. `gcc-10` instead of
just `gcc`, the current check will fail to detect the host architecture
and incorrectly default to `ia32`. Removing the AIX/IBM i specific
branch will follow the same logic as on the other platforms:
1. The value, if set, of the `CC_host` environment variable.
2. Otherwise, if set, the value of the `CC` environment variable.
3. `gcc` (`cc` if on macOS).

PR-URL: https://github.com/nodejs/node/pull/39481
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-07-25 22:41:52 +00:00
himself65
cfb7c4f658
build: add library_files to gyp variables
GYP uses the system path when parsing node.gyp;
However, if system python is different from our
gyp runtime python, like '2.7', gyp would crash.

Co-authored-by: Michaël Zasso <targos@protonmail.com>

PR-URL: https://github.com/nodejs/node/pull/39293
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2021-07-14 10:44:56 +08:00