mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc: remove mold use on mac for speeding up build
Co-authored-by: Vinicius Lourenço <12551007+H4ad@users.noreply.github.com> PR-URL: https://github.com/nodejs/node/pull/52252 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
18
BUILDING.md
18
BUILDING.md
@@ -546,11 +546,14 @@ If you encounter any difficulties, consider disabling `mold` as a
|
|||||||
troubleshooting step.
|
troubleshooting step.
|
||||||
|
|
||||||
If you plan to frequently rebuild Node.js, especially if using several
|
If you plan to frequently rebuild Node.js, especially if using several
|
||||||
branches, installing `ccache` and `mold` can help to greatly reduce build
|
branches, installing `ccache` can help to greatly reduce build
|
||||||
times. Set up with:
|
times. Set up with:
|
||||||
|
|
||||||
On GNU/Linux:
|
On GNU/Linux:
|
||||||
|
|
||||||
|
Tips: `mold` can speed up the link process, which can't be cached, you may
|
||||||
|
need to install the latest version but not the apt version.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
|
sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
|
||||||
export CC="ccache gcc" # add to your .profile
|
export CC="ccache gcc" # add to your .profile
|
||||||
@@ -558,13 +561,17 @@ export CXX="ccache g++" # add to your .profile
|
|||||||
export LDFLAGS="-fuse-ld=mold" # add to your .profile
|
export LDFLAGS="-fuse-ld=mold" # add to your .profile
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Refs:
|
||||||
|
|
||||||
|
1. <https://ccache.dev/performance.html>
|
||||||
|
2. <https://github.com/rui314/mold>
|
||||||
|
|
||||||
On macOS:
|
On macOS:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install ccache mold # see https://brew.sh
|
brew install ccache # see https://brew.sh
|
||||||
export CC="ccache cc" # add to ~/.zshrc or other shell config file
|
export CC="ccache cc" # add to ~/.zshrc or other shell config file
|
||||||
export CXX="ccache c++" # add to ~/.zshrc or other shell config file
|
export CXX="ccache c++" # add to ~/.zshrc or other shell config file
|
||||||
export LDFLAGS="-fuse-ld=mold" # add to ~/.zshrc or other shell config file
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This will allow for near-instantaneous rebuilds when switching branches back
|
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
|
|||||||
configuration since the November 2020 version and allows for setting
|
configuration since the November 2020 version and allows for setting
|
||||||
breakpoints.
|
breakpoints.
|
||||||
|
|
||||||
Refs:
|
|
||||||
|
|
||||||
1. <https://ccache.dev/performance.html>
|
|
||||||
2. <https://github.com/rui314/mold>
|
|
||||||
|
|
||||||
#### Troubleshooting Unix and macOS builds
|
#### Troubleshooting Unix and macOS builds
|
||||||
|
|
||||||
Stale builds can sometimes result in `file not found` errors while building.
|
Stale builds can sometimes result in `file not found` errors while building.
|
||||||
|
|||||||
Reference in New Issue
Block a user