-
Notifications
You must be signed in to change notification settings - Fork 1
/
cargo-verify
executable file
·35 lines (28 loc) · 1.02 KB
/
cargo-verify
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
readonly RVT_SRC=$(dirname $(realpath -s "$0"))/..
readonly RVT_DST=/home/rust-verification-tools
readonly IMAGE=priyasiddharth/rvt_urchin:latest
#readonly MOUNT_PWD="type=bind,source=${PWD},target=${PWD}"
#readonly MOUNT_RVT="type=bind,source=${RVT_SRC},target=${RVT_DST}"
readonly MOUNT_PWD="${PWD}:${PWD}:rw"
readonly MOUNT_RVT="${RVT_SRC}:${RVT_DST}:rw"
# based on https://dzone.com/articles/docker-x11-client-via-ssh
readonly X11="--net=host --env=DISPLAY --volume=$HOME/.Xauthority:/home/$USER/.Xauthority:rw"
readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
docker pull ${IMAGE}
docker run \
-e LOCAL_USER_ID=`id -u $USER` \
-e LOCAL_GROUP_ID=`id -g $USER` \
--user 0:0 \
--rm \
-v ${MOUNT_RVT} \
-v ${MOUNT_PWD} \
--workdir ${PWD} \
-it \
${X11} \
${IMAGE} env \
HOME=/home/creator \
XARGO_HOME=${SCRIPT_DIR}/.xargo \
XARGO_RUST_SRC=${SCRIPT_DIR}/seahorn/lib/toolchain/rust/src/ \
CARGO_HOME=${SCRIPT_DIR} \
$*