@@ -531,23 +531,30 @@ make test-only
531
531
532
532
#### Speeding up frequent rebuilds when developing
533
533
534
- If you plan to frequently rebuild Node.js, especially if using several branches,
535
- installing ` ccache ` can help to greatly reduce build times. Set up with:
534
+ Tips: The ` ccache ` utility is widely used and should generally work fine.
535
+ If you encounter any difficulties, consider disabling ` mold ` as a
536
+ troubleshooting step.
537
+
538
+ If you plan to frequently rebuild Node.js, especially if using several
539
+ branches, installing ` ccache ` and ` mold ` can help to greatly reduce build
540
+ times. Set up with:
536
541
537
542
On GNU/Linux:
538
543
539
544
``` bash
540
- sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
541
- export CC=" ccache gcc" # add to your .profile
542
- export CXX=" ccache g++" # add to your .profile
545
+ sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
546
+ export CC=" ccache gcc" # add to your .profile
547
+ export CXX=" ccache g++" # add to your .profile
548
+ export LDFLAGS=" -fuse-ld=mold" # add to your .profile
543
549
```
544
550
545
551
On macOS:
546
552
547
553
``` bash
548
- brew install ccache # see https://brew.sh
549
- export CC=" ccache cc" # add to ~/.zshrc or other shell config file
550
- export CXX=" ccache c++" # add to ~/.zshrc or other shell config file
554
+ brew install ccache mold # see https://brew.sh
555
+ export CC=" ccache cc" # add to ~/.zshrc or other shell config file
556
+ export CXX=" ccache c++" # add to ~/.zshrc or other shell config file
557
+ export LDFLAGS=" -fuse-ld=mold" # add to ~/.zshrc or other shell config file
551
558
```
552
559
553
560
This will allow for near-instantaneous rebuilds when switching branches back
@@ -565,6 +572,11 @@ the specified directory. The JS debugger of Visual Studio Code supports this
565
572
configuration since the November 2020 version and allows for setting
566
573
breakpoints.
567
574
575
+ Refs:
576
+
577
+ 1 . < https://ccache.dev/performance.html >
578
+ 2 . < https://github.com/rui314/mold >
579
+
568
580
#### Troubleshooting Unix and macOS builds
569
581
570
582
Stale builds can sometimes result in ` file not found ` errors while building.
0 commit comments