]> git.lizzy.rs Git - rust.git/blobdiff - cargo.sh
Merge pull request #1079 from CohenArthur/fmt-master
[rust.git] / cargo.sh
index 42c137030a5d82cf017068751ac43601faee67ff..d5be7773d342b5c0a396688dea6a00c1615d59c1 100755 (executable)
--- a/cargo.sh
+++ b/cargo.sh
@@ -1,14 +1,23 @@
 #!/bin/bash
 
 if [ -z $CHANNEL ]; then
-export CHANNEL='debug'
+export CHANNEL='release'
 fi
 
 pushd $(dirname "$0") >/dev/null
 source config.sh
+
+# read nightly compiler from rust-toolchain file
+TOOLCHAIN=$(cat rust-toolchain)
+
 popd >/dev/null
 
+if [[ $(rustc -V) != $(rustc +${TOOLCHAIN} -V) ]]; then
+    echo "rustc_codegen_cranelift is build for $(rustc +${TOOLCHAIN} -V) but the default rustc version is $(rustc -V)."
+    echo "Using $(rustc +${TOOLCHAIN} -V)."
+fi
+
 cmd=$1
 shift
 
-cargo $cmd --target $TARGET_TRIPLE $@
+cargo +${TOOLCHAIN} $cmd $@