guix: cache GUI depends separately

The GUI manifest has a distinct Guix profile and consequently produces
different depends build IDs. Previously this mean that the gui build
would invalidate the build cache for the non-guix build.

Move guix builds under a GUIX/ root, and further BUILD/ and GUI/ trees,
so that local developer builds, GUI and non GUI guix builds can all
co-exist together.

There will end up being more copies of build depends packages, (local
builds, and two guix variants), but these all use different toolchains
and toolsets so this is desirable.
This commit is contained in:
will
2026-08-17 20:27:06 +01:00
parent 7e75b3b922
commit 1fe87c2505
7 changed files with 18 additions and 5 deletions

View File

@@ -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**.

View File

@@ -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} \

View File

@@ -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} \

View File

@@ -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} \

View File

@@ -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} \

View File

@@ -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} \

View File

@@ -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} \