Skip to content

Commit

Permalink
sandbox: add dune cache as rw
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Oct 29, 2019
1 parent 2ab2a6e commit 07d662f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/state/shellscripts/bwrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ add_ccache_mount() {
fi
}

add_dune_cache_mount() {
DUNE_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/dune
mkdir -p ${DUNE_CACHE}
add_mounts rw $DUNE_CACHE
}

# This case-switch should remain identical between the different sandbox implems
COMMAND="$1"; shift
case "$COMMAND" in
Expand All @@ -84,6 +90,7 @@ case "$COMMAND" in
add_mounts ro "$OPAM_SWITCH_PREFIX"
add_mounts rw "$PWD"
add_ccache_mount
add_dune_cache_mount
;;
install)
# mount unusual path in ro
Expand Down
7 changes: 7 additions & 0 deletions src/state/shellscripts/sandbox_exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ add_ccache_mount() {
fi
}

add_dune_cache_mount() {
DUNE_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/dune
mkdir -p ${DUNE_CACHE}
add_mounts rw $DUNE_CACHE
}

# This case-switch should remain identical between the different sandbox implems
COMMAND="$1"; shift
case "$COMMAND" in
build)
add_mounts ro "$OPAM_SWITCH_PREFIX"
add_mounts rw "$PWD"
add_ccache_mount
add_dune_cache_mount
;;
install)
add_mounts rw "$OPAM_SWITCH_PREFIX"
Expand Down

0 comments on commit 07d662f

Please sign in to comment.