File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+ TARGET=$( rustc --print target-spec-json -Z unstable-options | jq ' .["llvm-target"]' -r)
4
+ SYSROOT=$( rustc --print sysroot)
5
+ export RUSTFLAGS=" -C link-args=-Wl,-rpath,$SYSROOT /lib/rustlib/$TARGET /lib -C debug-assertions"
6
+
7
+ COMMAND=" $1 "
8
+ shift
9
+
10
+ case " $COMMAND " in
11
+ install)
12
+ exec cargo install --path " $( dirname " $0 " ) " --force --locked --offline
13
+ ;;
14
+ build|test|run)
15
+ # Basic build
16
+ cargo build --release
17
+
18
+ # We we want to just build, we are done.
19
+ if [ " $COMMAND " = " build" ]; then exit 0; fi
20
+
21
+ # Get ourselves a sysroot
22
+ if [ -n " $MIRI_SYSROOT " ]; then
23
+ # sysroot already set
24
+ true
25
+ elif rustc --print sysroot | egrep -q ' build/[^/]+/stage' ; then
26
+ # a local build, we have a proper libstd in $SYSROOT
27
+ true
28
+ else
29
+ # we have to build a sysroot
30
+ cargo run --release --bin cargo-miri -- miri setup
31
+ export MIRI_SYSROOT=$HOME /.cache/miri/HOST
32
+ fi
33
+
34
+ exec cargo " $COMMAND " --release " $@ "
35
+ ;;
36
+ esac
You can’t perform that action at this time.
0 commit comments