@@ -30,6 +30,7 @@ file a new issue.
30
30
* [ Building the documentation] ( #building-the-documentation )
31
31
* [ Building a debug build] ( #building-a-debug-build )
32
32
* [ Building an ASAN build] ( #building-an-asan-build )
33
+ * [ Speeding up frequent rebuilds when developing] ( #speeding-up-frequent-rebuilds-when-developing )
33
34
* [ Troubleshooting Unix and macOS builds] ( #troubleshooting-unix-and-macos-builds )
34
35
* [ Windows] ( #windows )
35
36
* [ Prerequisites] ( #prerequisites )
@@ -527,6 +528,29 @@ $ ./configure --debug --enable-asan && make -j4
527
528
$ make test-only
528
529
```
529
530
531
+ #### Speeding up frequent rebuilds when developing
532
+
533
+ If you plan to frequently rebuild Node.js, especially if using several branches,
534
+ installing ` ccache ` can help to greatly reduce build times. Set up with:
535
+ ``` console
536
+ $ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
537
+ $ ccache -o cache_dir=< tmp_dir>
538
+ $ ccache -o max_size=5.0G
539
+ $ export CC=" ccache gcc" # add to your .profile
540
+ $ export CXX=" ccache g++" # add to your .profile
541
+ ```
542
+ This will allow for near-instantaneous rebuilds even when switching branches.
543
+
544
+ When modifying only the JS layer in ` lib ` , it is possible to externally load it
545
+ without modifying the executable:
546
+ ``` console
547
+ $ ./configure --node-builtin-modules-path $( pwd)
548
+ ```
549
+ The resulting binary won't include any JS files and will try to load them from
550
+ the specified directory. The JS debugger of Visual Studio Code supports this
551
+ configuration since the November 2020 version and allows for setting
552
+ breakpoints.
553
+
530
554
#### Troubleshooting Unix and macOS builds
531
555
532
556
Stale builds can sometimes result in ` file not found ` errors while building.
0 commit comments