aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/guix/guix-build11
-rw-r--r--contrib/guix/libexec/prelude.bash3
2 files changed, 13 insertions, 1 deletions
diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build
index a0eef59ac1..56c3398c97 100755
--- a/contrib/guix/guix-build
+++ b/contrib/guix/guix-build
@@ -207,7 +207,7 @@ time-machine() {
# Precious directories are those which should not be cleaned between successive
# guix builds
depends_precious_dir_names='SOURCES_PATH BASE_CACHE SDK_PATH'
-precious_dir_names="${depends_precious_dir_names} OUTDIR_BASE"
+precious_dir_names="${depends_precious_dir_names} OUTDIR_BASE PROFILES_BASE"
# Usage: contains IFS-SEPARATED-LIST ITEM
contains() {
@@ -275,6 +275,14 @@ outdir_for_host() {
echo "${OUTDIR_BASE}/${1}"
}
+# Usage: profiledir_for_host HOST COMMAND
+#
+# HOST: The current platform triple we're building for
+#
+profiledir_for_host() {
+ echo "${PROFILES_BASE}/${2}-${1}"
+}
+
#########
# BUILD #
@@ -404,6 +412,7 @@ EOF
--keep-failed \
--fallback \
--link-profile \
+ --root="$(profiledir_for_host "${HOST}" build)" \
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
-- env HOST="$host" \
diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash
index e6d3a5b722..971aebf2b0 100644
--- a/contrib/guix/libexec/prelude.bash
+++ b/contrib/guix/libexec/prelude.bash
@@ -61,3 +61,6 @@ OUTDIR_BASE="${OUTDIR_BASE:-${VERSION_BASE}/output}"
var_base_basename="var"
VAR_BASE="${VAR_BASE:-${VERSION_BASE}/${var_base_basename}}"
+
+profiles_base_basename="profiles"
+PROFILES_BASE="${PROFILES_BASE:-${VAR_BASE}/${profiles_base_basename}}"