[PATCH] scripts: rust_is_available.sh: Provide hints on how to fix missing pieces
From: Olof Johansson
Date: Tue Oct 04 2022 - 14:47:23 EST
This might be a bit bikesheddy, but it saves a few roundtrips to the
documentation when getting the `make LLVM=1 rustavailable` run to pass.
Stick to the rustup options to avoid too much verbosity.
Signed-off-by: Olof Johansson <olof@xxxxxxxxx>
---
scripts/rust_is_available.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
index aebbf1913970..94e6a1ce1df3 100755
--- a/scripts/rust_is_available.sh
+++ b/scripts/rust_is_available.sh
@@ -59,6 +59,9 @@ if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
echo >&2 "*** Your version: $rust_compiler_version"
echo >&2 "*** Minimum version: $rust_compiler_min_version"
echo >&2 "***"
+ echo >&2 "*** To update to the expected version:"
+ echo >&2 "*** \$ rustup override set \$(scripts/min-tool-version.sh rustc)"
+ echo >&2 "***"
fi
exit 1
fi
@@ -68,6 +71,9 @@ if [ "$1" = -v ] && [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion
echo >&2 "*** Your version: $rust_compiler_version"
echo >&2 "*** Expected version: $rust_compiler_min_version"
echo >&2 "***"
+ echo >&2 "*** To update to the expected version:"
+ echo >&2 "*** \$ rustup override set \$(scripts/min-tool-version.sh rustc)"
+ echo >&2 "***"
fi
# Check that the Rust bindings generator is suitable.
@@ -155,6 +161,9 @@ if [ ! -e "$rustc_src_core" ]; then
echo >&2 "*** Source code for the 'core' standard library could not be found"
echo >&2 "*** at '$rustc_src_core'."
echo >&2 "***"
+ echo >&2 "*** To install sources:"
+ echo >&2 "*** \$ rustup component add rust-src"
+ echo >&2 "***"
fi
exit 1
fi
--
2.30.2