From a288a5ea06bc601802e2f1537f883cb9019a2078 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Wed, 15 Jan 2020 12:05:18 -0500 Subject: [PATCH] Store nightly snapshot in rust-toolchain file, and use it in cargo.sh The rust-toolchain file can also store an exact nightly snapshot (instead of just "nightly"), so we can store whatever snapshot that rustc_codegen_cranelift is known to work with. This also lets us add a new feature to `cargo.sh` to let it use the exact same nightly snapshot as cg_clif. If there's a nightly compiler mismatch, you get a confusing error message like: error: couldn't load codegen backend "librustc_codegen_cranelift.so": "librustc_driver-681e2b4f66c73d3e.so: cannot open shared object file: No such file or directory" So doing this automatically in cargo.sh is useful. --- cargo.sh | 6 +++++- rust-toolchain | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cargo.sh b/cargo.sh index 42c137030a5d..5af238121519 100755 --- a/cargo.sh +++ b/cargo.sh @@ -6,9 +6,13 @@ fi pushd $(dirname "$0") >/dev/null source config.sh + +# read nightly compiler from rust-toolchain file +TOOLCHAIN=$(cat rust-toolchain) + popd >/dev/null cmd=$1 shift -cargo $cmd --target $TARGET_TRIPLE $@ +cargo +${TOOLCHAIN} $cmd --target $TARGET_TRIPLE $@ diff --git a/rust-toolchain b/rust-toolchain index bf867e0ae5b6..ae478dbcb74e 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly +nightly-2020-01-13