diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 088ed8072db..7d576c71d67 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -151,8 +151,8 @@ If you perform a lot of builds and have a bunch of worktrees, you may find it more efficient to keep the depends tree's download cache, build cache, and SDKs outside of the worktrees to avoid duplicate downloads and unnecessary builds. To help with this situation, the `guix-build` script honours the `SOURCES_PATH`, -`BASE_CACHE`, and `SDK_PATH` environment variables and will pass them on to the -depends tree so that you can do something like: +`BASE_CACHE`, and `SDK_PATH` environment variables so that you can do something +like: ```sh env SOURCES_PATH="$HOME/depends-SOURCES_PATH" BASE_CACHE="$HOME/depends-BASE_CACHE" SDK_PATH="$HOME/macOS-SDKs" ./contrib/guix/guix-build @@ -249,9 +249,10 @@ details. * _**BASE_CACHE**_ - Set the depends tree cache for built packages. This is passed through to the - depends tree. Setting this to the same directory across multiple builds of the - depends tree can eliminate unnecessary building of packages. + Set the root directory for cached built packages. Non-GUI and GUI builds use + the `GUIX/BUILD` and `GUIX/GUI` subdirectories, respectively, so their caches do + not evict each other's packages. Setting this to the same directory across + multiple Guix builds can eliminate unnecessary building of packages. The path that this environment variable points to **must be a directory**, and **NOT a symlink to a directory**. diff --git a/contrib/guix/libexec/build_linux.sh b/contrib/guix/libexec/build_linux.sh index bf3296a53ef..573e028b863 100755 --- a/contrib/guix/libexec/build_linux.sh +++ b/contrib/guix/libexec/build_linux.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # setup gcc toolchain gcc_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/BUILD" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ diff --git a/contrib/guix/libexec/build_linux_gui.sh b/contrib/guix/libexec/build_linux_gui.sh index b9665c25a49..c13722f6d58 100755 --- a/contrib/guix/libexec/build_linux_gui.sh +++ b/contrib/guix/libexec/build_linux_gui.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # setup gcc toolchain gcc_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/GUI" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ diff --git a/contrib/guix/libexec/build_macos.sh b/contrib/guix/libexec/build_macos.sh index a782d80ed62..84ca5033404 100755 --- a/contrib/guix/libexec/build_macos.sh +++ b/contrib/guix/libexec/build_macos.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # Setup toolchain llvm_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/BUILD" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ diff --git a/contrib/guix/libexec/build_macos_gui.sh b/contrib/guix/libexec/build_macos_gui.sh index 1f2dbc6468d..10e1312ef50 100755 --- a/contrib/guix/libexec/build_macos_gui.sh +++ b/contrib/guix/libexec/build_macos_gui.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # Setup toolchain llvm_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/GUI" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ diff --git a/contrib/guix/libexec/build_win.sh b/contrib/guix/libexec/build_win.sh index 7dd6e9fc36d..00be8d3ec0f 100755 --- a/contrib/guix/libexec/build_win.sh +++ b/contrib/guix/libexec/build_win.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # setup mingw-w64 toolchain mingw_w64_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/BUILD" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ diff --git a/contrib/guix/libexec/build_win_gui.sh b/contrib/guix/libexec/build_win_gui.sh index 65696a2fb43..2a8b0b95dc7 100755 --- a/contrib/guix/libexec/build_win_gui.sh +++ b/contrib/guix/libexec/build_win_gui.sh @@ -11,6 +11,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh" # setup mingw-w64 toolchain mingw_w64_toolchain +BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/GUI" + # Build the depends tree make -C depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \