@@ -546,25 +546,32 @@ If you encounter any difficulties, consider disabling `mold` as a
546
546
troubleshooting step.
547
547
548
548
If you plan to frequently rebuild Node.js, especially if using several
549
- branches, installing ` ccache ` and ` mold ` can help to greatly reduce build
549
+ branches, installing ` ccache ` can help to greatly reduce build
550
550
times. Set up with:
551
551
552
552
On GNU/Linux:
553
553
554
+ Tips: ` mold ` can speed up the link process, which can't be cached, you may
555
+ need to install the latest version but not the apt version.
556
+
554
557
``` bash
555
558
sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
556
559
export CC=" ccache gcc" # add to your .profile
557
560
export CXX=" ccache g++" # add to your .profile
558
561
export LDFLAGS=" -fuse-ld=mold" # add to your .profile
559
562
```
560
563
564
+ Refs:
565
+
566
+ 1 . < https://ccache.dev/performance.html >
567
+ 2 . < https://github.com/rui314/mold >
568
+
561
569
On macOS:
562
570
563
571
``` bash
564
- brew install ccache mold # see https://brew.sh
572
+ brew install ccache # see https://brew.sh
565
573
export CC=" ccache cc" # add to ~/.zshrc or other shell config file
566
574
export CXX=" ccache c++" # add to ~/.zshrc or other shell config file
567
- export LDFLAGS=" -fuse-ld=mold" # add to ~/.zshrc or other shell config file
568
575
```
569
576
570
577
This will allow for near-instantaneous rebuilds when switching branches back
@@ -582,11 +589,6 @@ the specified directory. The JS debugger of Visual Studio Code supports this
582
589
configuration since the November 2020 version and allows for setting
583
590
breakpoints.
584
591
585
- Refs:
586
-
587
- 1 . < https://ccache.dev/performance.html >
588
- 2 . < https://github.com/rui314/mold >
589
-
590
592
#### Troubleshooting Unix and macOS builds
591
593
592
594
Stale builds can sometimes result in ` file not found ` errors while building.
0 commit comments