@@ -120,31 +120,31 @@ platforms. This is true regardless of entries in the table below.
120
120
| FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 <sup >[ 7] ( #fn7 ) </sup > |
121
121
122
122
<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.
126
126
127
127
<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.
131
131
132
132
<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.
134
134
135
135
<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.
140
140
141
141
<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.
148
148
149
149
<em id =" fn6 " >6</em >: Running Node.js on x86 Windows should work and binaries
150
150
are provided. However, tests in our infrastructure only run on WoW64.
@@ -195,7 +195,7 @@ Ubuntu 14.04 and Debian 8.
195
195
#### OpenSSL asm support
196
196
197
197
OpenSSL-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.
199
199
200
200
For use of AVX-512,
201
201
@@ -212,9 +212,9 @@ For use of AVX2,
212
212
* nasm version 2.10 or higher in Windows
213
213
214
214
Please 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.
216
216
217
- If compiling without one of the above, use ` configure ` with the
217
+ If compiling without one of the above, use ` configure ` with the
218
218
` --openssl-no-asm ` flag. Otherwise, ` configure ` will fail.
219
219
220
220
### Previous versions of this document
@@ -232,6 +232,7 @@ Consult previous versions of this document for older versions of Node.js:
232
232
### Note about Python
233
233
234
234
The Node.js project supports Python >= 3 for building and testing.
235
+
235
236
### Unix and macOS
236
237
237
238
#### Unix prerequisites
@@ -480,7 +481,7 @@ release version is actually installed when you run `make install`.
480
481
To use the debug build with all the normal dependencies overwrite the release
481
482
version in the install directory:
482
483
483
- ``` console
484
+ ``` console
484
485
$ make install PREFIX=/opt/node-debug/
485
486
$ cp -a -f out/Debug/node /opt/node-debug/node
486
487
```
@@ -496,7 +497,7 @@ was captured on (i.e. 64-bit `gdb` for `node` built on a 64-bit system, Linux
496
497
497
498
Example of generating a backtrace from the core dump:
498
499
499
- ``` console
500
+ ``` console
500
501
$ gdb /opt/node-debug/node core.node.8.1535359906
501
502
$ backtrace
502
503
```
@@ -507,12 +508,12 @@ $ backtrace
507
508
related bugs. ASAN builds are currently only supported on linux.
508
509
If you want to check it on Windows or macOS or you want a consistent toolchain
509
510
on 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 ` ).
511
512
512
513
The ` --debug ` is not necessary and will slow down build and testing, but it can
513
514
show clear stacktrace if ASAN hits an issue.
514
515
515
- ``` console
516
+ ``` console
516
517
$ ./configure --debug --enable-asan && make -j4
517
518
$ make test-only
518
519
```
@@ -521,20 +522,24 @@ $ make test-only
521
522
522
523
If you plan to frequently rebuild Node.js, especially if using several branches,
523
524
installing ` ccache ` can help to greatly reduce build times. Set up with:
525
+
524
526
``` console
525
527
$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
526
528
$ ccache -o cache_dir=< tmp_dir>
527
529
$ ccache -o max_size=5.0G
528
530
$ export CC=" ccache gcc" # add to your .profile
529
531
$ export CXX=" ccache g++" # add to your .profile
530
532
```
533
+
531
534
This will allow for near-instantaneous rebuilds even when switching branches.
532
535
533
536
When modifying only the JS layer in ` lib ` , it is possible to externally load it
534
537
without modifying the executable:
538
+
535
539
``` console
536
540
$ ./configure --node-builtin-modules-path $( pwd)
537
541
```
542
+
538
543
The resulting binary won't include any JS files and will try to load them from
539
544
the specified directory. The JS debugger of Visual Studio Code supports this
540
545
configuration since the November 2020 version and allows for setting
@@ -678,7 +683,7 @@ $ ./configure --with-intl=full-icu
678
683
679
684
### Trimmed: ` small-icu ` (English only) support
680
685
681
- In this configuration, only English data is included, but
686
+ In this configuration, only English data is included, but
682
687
the full ` Intl ` (ECMA-402) APIs. It does not need to download
683
688
any dependencies to function. You can add full data at runtime.
684
689
@@ -774,6 +779,7 @@ If you want to build Node.js using openssl-3.0.0+quic, you can follow these
774
779
steps:
775
780
776
781
** clone OpenSSL source and prepare build**
782
+
777
783
``` bash
778
784
git clone
[email protected] :quictls/openssl.git
779
785
@@ -791,6 +797,7 @@ will publish the OpenSSL libraries and such. We will also use this path
791
797
(and sub-paths) later when compiling Node.js.
792
798
793
799
** compile and install OpenSSL**
800
+
794
801
``` console
795
802
make -j8
796
803
make install
@@ -806,6 +813,7 @@ find the `fipsmodule.cnf` file - let's add the following to the end of the
806
813
` openssl.cnf ` file.
807
814
808
815
** alter openssl.cnf**
816
+
809
817
``` text
810
818
.include fipsmodule.cnf
811
819
@@ -826,6 +834,7 @@ sure that you specify an absolute path for the `.include fipsmodule.cnf` line -
826
834
using relative paths did not work on my system!
827
835
828
836
** alter openssl.cnf using a script**
837
+
829
838
``` console
830
839
cat <<EOT >> /path/to/install/dir/ssl/openssl.cnf
831
840
.include /path/to/install/dir/ssl/fipsmodule.cnf
@@ -845,12 +854,14 @@ EOT
845
854
As you might have picked a non-custom path for your OpenSSL install dir, we
846
855
have to export the following two environment variables in order for Node.js to
847
856
find our OpenSSL modules we built beforehand:
857
+
848
858
``` console
849
859
export OPENSSL_CONF=/path/to/install/dir/ssl/openssl.cnf
850
860
export OPENSSL_MODULES=/path/to/install/dir/lib/ossl-modules
851
861
```
852
862
853
863
** build Node.js**
864
+
854
865
``` console
855
866
./configure \
856
867
--shared-openssl \
@@ -865,6 +876,7 @@ make -j8
865
876
```
866
877
867
878
** verify the produced executable**
879
+
868
880
``` console
869
881
ldd ./node
870
882
linux-vdso.so.1 (0x00007ffd7917b000)
@@ -884,12 +896,14 @@ If the `ldd` command says that `libcrypto` cannot be found one needs to set
884
896
` --shared-openssl-libpath ` (see previous step).
885
897
886
898
** verify the OpenSSL version**
899
+
887
900
``` console
888
901
./node -p process.versions.openssl
889
902
3.0.0-alpha16+quic
890
903
```
891
904
892
905
** verify that FIPS is available**
906
+
893
907
``` console
894
908
./node -p 'process.config.variables.openssl_is_fips'
895
909
true
@@ -905,13 +919,16 @@ executable. See sections
905
919
[ Enabling FIPS using OpenSSL config] ( #enabling-fips-using-openssl-config ) below.
906
920
907
921
### Enabling FIPS using Node.js options
922
+
908
923
This is done using one of the Node.js options ` --enable-fips ` or
909
924
` --force-fips ` , for example:
925
+
910
926
``` console
911
927
$ node --enable-fips -p ' crypto.getFips()'
912
928
```
913
929
914
930
### Enabling FIPS using OpenSSL config
931
+
915
932
This example show that using OpenSSL's configuration file, FIPS can be enabled
916
933
without specifying the ` --enable-fips ` or ` --force-fips ` options by setting
917
934
` default_properties = fips=yes ` in the FIPS configuration file. See
@@ -920,6 +937,7 @@ for details.
920
937
921
938
For this to work the OpenSSL configuration file (default openssl.cnf) needs to
922
939
be updated. The following shows an example:
940
+
923
941
``` console
924
942
openssl_conf = openssl_init
925
943
@@ -939,6 +957,7 @@ activate = 1
939
957
[algorithm_sect]
940
958
default_properties = fips=yes
941
959
```
960
+
942
961
After this change Node.js can be run without the ` --enable-fips ` or ` --force-fips `
943
962
options.
944
963
0 commit comments