Skip to content

Commit

Permalink
Do not fail if $HOME/.ccache is missing (ocaml#3957)
Browse files Browse the repository at this point in the history
bwrap/osx: do not fail if $HOME/.ccache is missing: check for directory existence in `add_mounts`

See https://discuss.ocaml.org/t/dune-1-11-1-compilation-failed/4248

This was already present in bwrap, so only sandbox needs to be updated

Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
  • Loading branch information
mseri authored and rjbou committed Oct 16, 2019
1 parent de29618 commit 9f68bf0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/state/shellscripts/sandbox_exec.sh
Expand Up @@ -6,11 +6,13 @@ POL="$POL"'(allow network* (remote unix))'
POL="$POL"'(allow file-write* (literal "/dev/null") (literal "/dev/dtracehelper"))'

add_mounts() {
local DIR="$(cd "$2" && pwd -P)"
case "$1" in
ro) POL="$POL"'(deny file-write* (subpath "'"$DIR"'"))';;
rw) POL="$POL"'(allow file-write* (subpath "'"$DIR"'"))';;
esac
if [ -d "$2" ]; then
local DIR="$(cd "$2" && pwd -P)"
case "$1" in
ro) POL="$POL"'(deny file-write* (subpath "'"$DIR"'"))';;
rw) POL="$POL"'(allow file-write* (subpath "'"$DIR"'"))';;
esac
fi
}

if [ -z ${TMPDIR+x} ]; then
Expand Down

0 comments on commit 9f68bf0

Please sign in to comment.