From edd716beb1c8d620f8b1edf547ea0eea119adf38 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 21 Oct 2021 10:06:49 -0700 Subject: [PATCH 1/2] doc: fix macOS environment variables for ccache macOS requires `cc` and `c++` rather than `gcc` and `g++`. Closes: https://github.com/nodejs/node/issues/40542 PR-URL: https://github.com/nodejs/node/pull/40550 Fixes: https://github.com/nodejs/node/issues/40542 Reviewed-By: Geoffrey Booth Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- BUILDING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 94bdfaf60fc446..88addb5a8bf92b 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -519,6 +519,8 @@ $ 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: +On GNU/Linux: + ```console $ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros $ ccache -o cache_dir= @@ -527,6 +529,16 @@ $ export CC="ccache gcc" # add to your .profile $ export CXX="ccache g++" # add to your .profile ``` +On macOS: + +```console +$ brew install ccache # see https://brew.sh +$ ccache -o cache_dir= +$ ccache -o max_size=5.0G +$ export CC="ccache cc" # add to ~/.zshrc or other shell config file +$ export CXX="ccache c++" # add to ~/.zshrc or other shell config file +``` + This will allow for near-instantaneous rebuilds even when switching branches. When modifying only the JS layer in `lib`, it is possible to externally load it From 31d7d6c994c5b38de1b18a30d31ac580f868eafc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 21 Oct 2021 18:06:05 +0000 Subject: [PATCH 2/2] doc: simplify ccache instructions `ccache` has reasonable defaults for `max_size` and `cache_dir` so remove instructions to set those things explicitly. Change fenced code from `console` to `bash` for easier copy/paste. PR-URL: https://github.com/nodejs/node/pull/40550 Fixes: https://github.com/nodejs/node/issues/40542 Reviewed-By: Geoffrey Booth Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- BUILDING.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 88addb5a8bf92b..ddbc8682940aad 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -521,22 +521,18 @@ installing `ccache` can help to greatly reduce build times. Set up with: On GNU/Linux: -```console -$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros -$ ccache -o cache_dir= -$ ccache -o max_size=5.0G -$ export CC="ccache gcc" # add to your .profile -$ export CXX="ccache g++" # add to your .profile +```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: -```console -$ brew install ccache # see https://brew.sh -$ ccache -o cache_dir= -$ ccache -o max_size=5.0G -$ export CC="ccache cc" # add to ~/.zshrc or other shell config file -$ export CXX="ccache c++" # add to ~/.zshrc or other shell config file +```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 ``` This will allow for near-instantaneous rebuilds even when switching branches.