Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix environment variable settings for ccache #40550

Merged
merged 2 commits into from
Oct 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,20 @@ $ make test-only
If you plan to frequently rebuild Node.js, especially if using several branches,
installing `ccache` can help to greatly reduce build times. Set up with:

```console
$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
$ ccache -o cache_dir=<tmp_dir>
$ ccache -o max_size=5.0G
Comment on lines -524 to -525
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be dropping these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be dropping these?

ccache has a reasonable default for cache_dir so that removes the necessity to set a cache_dir explicitly. Ref: https://ccache.dev/manual/4.3.html#config_cache_dir

max_size default is 5Gb, so we don't need the step that explicitly sets it to 5Gb as well. Ref: https://ccache.dev/manual/4.3.html#config_max_size

$ export CC="ccache gcc" # add to your .profile
$ export CXX="ccache g++" # add to your .profile
On GNU/Linux:

```bash
sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
export CC="ccache gcc" # add to your .profile
export CXX="ccache g++" # add to your .profile
```

On macOS:

```bash
brew install ccache # see https://brew.sh
export CC="ccache cc" # add to ~/.zshrc or other shell config file
export CXX="ccache c++" # add to ~/.zshrc or other shell config file
targos marked this conversation as resolved.
Show resolved Hide resolved
```

This will allow for near-instantaneous rebuilds even when switching branches.
Expand Down