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