From 400b2f6b26f9001c9ae19d61c0267079fe604d8d Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Fri, 6 Dec 2024 07:06:40 +0900 Subject: [PATCH] sandbox: respect the `DUNE_CACHE_ROOT` environment variable if it exists Signed-off-by: Sora Morimoto --- master_changes.md | 1 + src/state/shellscripts/bwrap.sh | 2 +- src/state/shellscripts/sandbox_exec.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/master_changes.md b/master_changes.md index 5669f8e450d..d8ccb0eaea4 100644 --- a/master_changes.md +++ b/master_changes.md @@ -85,6 +85,7 @@ users) ## Format upgrade ## Sandbox + * Respect the `DUNE_CACHE_ROOT` environment variable if it exists [#6326 @smorimoto] ## VCS diff --git a/src/state/shellscripts/bwrap.sh b/src/state/shellscripts/bwrap.sh index 7b45fc87750..03d8749461e 100644 --- a/src/state/shellscripts/bwrap.sh +++ b/src/state/shellscripts/bwrap.sh @@ -95,7 +95,7 @@ add_ccache_mount() { } add_dune_cache_mount() { - local dune_cache=${XDG_CACHE_HOME:-$HOME/.cache}/dune + local dune_cache=${DUNE_CACHE_ROOT:-${XDG_CACHE_HOME:-$HOME/.cache}/dune} mount_linked_cache "$dune_cache" } diff --git a/src/state/shellscripts/sandbox_exec.sh b/src/state/shellscripts/sandbox_exec.sh index dc1487a3d5b..0703721f395 100644 --- a/src/state/shellscripts/sandbox_exec.sh +++ b/src/state/shellscripts/sandbox_exec.sh @@ -51,7 +51,7 @@ add_ccache_mount() { } add_dune_cache_mount() { - local dune_cache=${XDG_CACHE_HOME:-$HOME/.cache}/dune + local dune_cache=${DUNE_CACHE_ROOT:-${XDG_CACHE_HOME:-$HOME/.cache}/dune} mkdir -p "${dune_cache}" add_mounts rw "$dune_cache" }