@@ -120,31 +120,31 @@ platforms. This is true regardless of entries in the table below.
120120| FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 <sup >[ 7] ( #fn7 ) </sup > |
121121
122122<em id =" fn1 " >1</em >: GCC 8 is not provided on the base platform. Users will
123- need the
124- [ Toolchain test builds PPA] ( https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial )
125- or similar to source a newer compiler.
123+ need the
124+ [ Toolchain test builds PPA] ( https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial )
125+ or similar to source a newer compiler.
126126
127127<em id =" fn2 " >2</em >: GCC 8 is not provided on the base platform. Users will
128- need the
129- [ devtoolset-8] ( https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/ )
130- or later to source a newer compiler.
128+ need the
129+ [ devtoolset-8] ( https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/ )
130+ or later to source a newer compiler.
131131
132132<em id =" fn3 " >3</em >: Older kernel versions may work for ARM64. However the
133- Node.js test infrastructure only tests >= 4.5.
133+ Node.js test infrastructure only tests >= 4.5.
134134
135135<em id =" fn4 " >4</em >: On Windows, running Node.js in Windows terminal emulators
136- like ` mintty ` requires the usage of [ winpty] ( https://github.com/rprichard/winpty )
137- for the tty channels to work (e.g. ` winpty node.exe script.js ` ).
138- In "Git bash" if you call the node shell alias (` node ` without the ` .exe `
139- extension), ` winpty ` is used automatically.
136+ like ` mintty ` requires the usage of [ winpty] ( https://github.com/rprichard/winpty )
137+ for the tty channels to work (e.g. ` winpty node.exe script.js ` ).
138+ In "Git bash" if you call the node shell alias (` node ` without the ` .exe `
139+ extension), ` winpty ` is used automatically.
140140
141141<em id =" fn5 " >5</em >: The Windows Subsystem for Linux (WSL) is not
142- supported, but the GNU/Linux build process and binaries should work. The
143- community will only address issues that reproduce on native GNU/Linux
144- systems. Issues that only reproduce on WSL should be reported in the
145- [ WSL issue tracker] ( https://github.com/Microsoft/WSL/issues ) . Running the
146- Windows binary (` node.exe ` ) in WSL is not recommended. It will not work
147- without workarounds such as stdio redirection.
142+ supported, but the GNU/Linux build process and binaries should work. The
143+ community will only address issues that reproduce on native GNU/Linux
144+ systems. Issues that only reproduce on WSL should be reported in the
145+ [ WSL issue tracker] ( https://github.com/Microsoft/WSL/issues ) . Running the
146+ Windows binary (` node.exe ` ) in WSL is not recommended. It will not work
147+ without workarounds such as stdio redirection.
148148
149149<em id =" fn6 " >6</em >: Running Node.js on x86 Windows should work and binaries
150150are provided. However, tests in our infrastructure only run on WoW64.
@@ -195,7 +195,7 @@ Ubuntu 14.04 and Debian 8.
195195#### OpenSSL asm support
196196
197197OpenSSL-1.1.1 requires the following assembler version for use of asm
198- support on x86_64 and ia32.
198+ support on x86 \_ 64 and ia32.
199199
200200For use of AVX-512,
201201
@@ -212,9 +212,9 @@ For use of AVX2,
212212* nasm version 2.10 or higher in Windows
213213
214214Please refer to
215- < https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html > for details.
215+ < https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html > for details.
216216
217- If compiling without one of the above, use ` configure ` with the
217+ If compiling without one of the above, use ` configure ` with the
218218` --openssl-no-asm ` flag. Otherwise, ` configure ` will fail.
219219
220220### Previous versions of this document
@@ -232,6 +232,7 @@ Consult previous versions of this document for older versions of Node.js:
232232### Note about Python
233233
234234The Node.js project supports Python >= 3 for building and testing.
235+
235236### Unix and macOS
236237
237238#### Unix prerequisites
@@ -480,7 +481,7 @@ release version is actually installed when you run `make install`.
480481To use the debug build with all the normal dependencies overwrite the release
481482version in the install directory:
482483
483- ``` console
484+ ``` console
484485$ make install PREFIX=/opt/node-debug/
485486$ cp -a -f out/Debug/node /opt/node-debug/node
486487```
@@ -496,7 +497,7 @@ was captured on (i.e. 64-bit `gdb` for `node` built on a 64-bit system, Linux
496497
497498Example of generating a backtrace from the core dump:
498499
499- ``` console
500+ ``` console
500501$ gdb /opt/node-debug/node core.node.8.1535359906
501502$ backtrace
502503```
@@ -507,12 +508,12 @@ $ backtrace
507508related bugs. ASAN builds are currently only supported on linux.
508509If you want to check it on Windows or macOS or you want a consistent toolchain
509510on Linux, you can try [ Docker] ( https://www.docker.com/products/docker-desktop )
510- (using an image like ` gengjiawen/node-build:2020-02-14 ` ).
511+ (using an image like ` gengjiawen/node-build:2020-02-14 ` ).
511512
512513The ` --debug ` is not necessary and will slow down build and testing, but it can
513514show clear stacktrace if ASAN hits an issue.
514515
515- ``` console
516+ ``` console
516517$ ./configure --debug --enable-asan && make -j4
517518$ make test-only
518519```
@@ -521,20 +522,24 @@ $ make test-only
521522
522523If you plan to frequently rebuild Node.js, especially if using several branches,
523524installing ` ccache ` can help to greatly reduce build times. Set up with:
525+
524526``` console
525527$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
526528$ ccache -o cache_dir=< tmp_dir>
527529$ ccache -o max_size=5.0G
528530$ export CC=" ccache gcc" # add to your .profile
529531$ export CXX=" ccache g++" # add to your .profile
530532```
533+
531534This will allow for near-instantaneous rebuilds even when switching branches.
532535
533536When modifying only the JS layer in ` lib ` , it is possible to externally load it
534537without modifying the executable:
538+
535539``` console
536540$ ./configure --node-builtin-modules-path $( pwd)
537541```
542+
538543The resulting binary won't include any JS files and will try to load them from
539544the specified directory. The JS debugger of Visual Studio Code supports this
540545configuration since the November 2020 version and allows for setting
@@ -678,7 +683,7 @@ $ ./configure --with-intl=full-icu
678683
679684### Trimmed: ` small-icu ` (English only) support
680685
681- In this configuration, only English data is included, but
686+ In this configuration, only English data is included, but
682687the full ` Intl ` (ECMA-402) APIs. It does not need to download
683688any dependencies to function. You can add full data at runtime.
684689
@@ -774,6 +779,7 @@ If you want to build Node.js using openssl-3.0.0+quic, you can follow these
774779steps:
775780
776781** clone OpenSSL source and prepare build**
782+
777783``` bash
778784git clone git@github.com:quictls/openssl.git
779785
@@ -791,6 +797,7 @@ will publish the OpenSSL libraries and such. We will also use this path
791797(and sub-paths) later when compiling Node.js.
792798
793799** compile and install OpenSSL**
800+
794801``` console
795802make -j8
796803make install
@@ -806,6 +813,7 @@ find the `fipsmodule.cnf` file - let's add the following to the end of the
806813` openssl.cnf ` file.
807814
808815** alter openssl.cnf**
816+
809817``` text
810818.include fipsmodule.cnf
811819
@@ -826,6 +834,7 @@ sure that you specify an absolute path for the `.include fipsmodule.cnf` line -
826834using relative paths did not work on my system!
827835
828836** alter openssl.cnf using a script**
837+
829838``` console
830839cat <<EOT >> /path/to/install/dir/ssl/openssl.cnf
831840.include /path/to/install/dir/ssl/fipsmodule.cnf
@@ -845,12 +854,14 @@ EOT
845854As you might have picked a non-custom path for your OpenSSL install dir, we
846855have to export the following two environment variables in order for Node.js to
847856find our OpenSSL modules we built beforehand:
857+
848858``` console
849859export OPENSSL_CONF=/path/to/install/dir/ssl/openssl.cnf
850860export OPENSSL_MODULES=/path/to/install/dir/lib/ossl-modules
851861```
852862
853863** build Node.js**
864+
854865``` console
855866./configure \
856867 --shared-openssl \
@@ -865,6 +876,7 @@ make -j8
865876```
866877
867878** verify the produced executable**
879+
868880``` console
869881ldd ./node
870882 linux-vdso.so.1 (0x00007ffd7917b000)
@@ -884,12 +896,14 @@ If the `ldd` command says that `libcrypto` cannot be found one needs to set
884896` --shared-openssl-libpath ` (see previous step).
885897
886898** verify the OpenSSL version**
899+
887900``` console
888901./node -p process.versions.openssl
8899023.0.0-alpha16+quic
890903```
891904
892905** verify that FIPS is available**
906+
893907``` console
894908./node -p 'process.config.variables.openssl_is_fips'
895909true
@@ -905,13 +919,16 @@ executable. See sections
905919[ Enabling FIPS using OpenSSL config] ( #enabling-fips-using-openssl-config ) below.
906920
907921### Enabling FIPS using Node.js options
922+
908923This is done using one of the Node.js options ` --enable-fips ` or
909924` --force-fips ` , for example:
925+
910926``` console
911927$ node --enable-fips -p ' crypto.getFips()'
912928```
913929
914930### Enabling FIPS using OpenSSL config
931+
915932This example show that using OpenSSL's configuration file, FIPS can be enabled
916933without specifying the ` --enable-fips ` or ` --force-fips ` options by setting
917934` default_properties = fips=yes ` in the FIPS configuration file. See
@@ -920,6 +937,7 @@ for details.
920937
921938For this to work the OpenSSL configuration file (default openssl.cnf) needs to
922939be updated. The following shows an example:
940+
923941``` console
924942openssl_conf = openssl_init
925943
@@ -939,6 +957,7 @@ activate = 1
939957[algorithm_sect]
940958default_properties = fips=yes
941959```
960+
942961After this change Node.js can be run without the ` --enable-fips ` or ` --force-fips `
943962options.
944963
0 commit comments