Improve the DO_BENCH error message

Benchmarking requires a non-stable toolchain not a nightly toolchain
i.e., includes beta.

Improve the error output to indicate as such.
This commit is contained in:
Tobin C. Harding 2022-09-30 11:53:09 +10:00
parent a11cf07501
commit 61c560baba
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 10 additions and 7 deletions

View File

@ -12,11 +12,16 @@ fi
cargo --version cargo --version
rustc --version rustc --version
# Work out if we are using a nightly toolchain. # Some tests require certain toolchain types.
NIGHTLY=false NIGHTLY=false
STABLE=true
if cargo --version | grep nightly; then if cargo --version | grep nightly; then
STABLE=false
NIGHTLY=true NIGHTLY=true
fi fi
if cargo --version | grep beta; then
STABLE=false
fi
# Pin dependencies as required if we are using MSRV toolchain. # Pin dependencies as required if we are using MSRV toolchain.
if cargo --version | grep "1\.41"; then if cargo --version | grep "1\.41"; then
@ -109,13 +114,11 @@ fi
# Bench if told to, only works with non-stable toolchain (nightly, beta). # Bench if told to, only works with non-stable toolchain (nightly, beta).
if [ "$DO_BENCH" = true ] if [ "$DO_BENCH" = true ]
then then
if [ "$NIGHTLY" = false ] if [ "$STABLE" = true ]; then
then if [ -n "$RUSTUP_TOOLCHAIN" ]; then
if [ -n "$RUSTUP_TOOLCHAIN" ] echo "RUSTUP_TOOLCHAIN is set to a stable toolchain but DO_BENCH requires a non-stable (beta, nightly) toolchain"
then
echo "RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
else else
echo "DO_BENCH requires a nightly toolchain" echo "DO_BENCH requires a non-stable (beta, nightly) toolchain"
fi fi
exit 1 exit 1
fi fi