scripts: rust_is_available.sh: Provide hints on how to fix missing pieces
PATCH 1/1 scripts: rust_is_available.sh: Provide hints on how to fix missing pieces
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.
--- scripts/rust_is_available.sh | 9 +++++++++ 1 file changed, 9 insertions(+)
scripts/rust_is_available.sh +9 -0
@@ -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
Signature · 1 line
2.30.2
Quoted 2 lines · Olof Johansson
This might be a bit bikesheddy, but it saves a few roundtrips to the documentation when getting the
make LLVM=1 rustavailablerun to pass.
Yeah, I have bin there :-)
Quoted 7 lines
Stick to the rustup options to avoid too much verbosity.
Signed-off-by Olof Johansson <[email protected]>--- scripts/rust_is_available.sh | 9 +++++++++ 1 file changed, 9 insertions(+)
Quoted 9 lines · Geert Stappers
Quoted 2 lines · Olof Johansson
This might be a bit bikesheddy, but it saves a few roundtrips to the documentation when getting the
make LLVM=1 rustavailablerun to pass.Yeah, I have bin there :-)
Quoted 2 lines
Stick to the rustup options to avoid too much verbosity.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Olof Johansson <[email protected]>--- scripts/rust_is_available.sh | 9 +++++++++ 1 file changed, 9 insertions(+)Reviewed-by Geert Stappers <[email protected]>
How to prevent that the patch gets lost in the mail?
And how to avoid that reminders like this get contra-productive? (When to send the next "Please approve or reject the patch"?)
Groeten
Geert Stappers
Signature · 1 line
Silence is hard to parse
Hi Geert,
Quoted 2 lines · Geert Stappers
How to prevent that the patch gets lost in the mail?
Do not worry, it is not lost :)
Quoted 2 lines
And how to avoid that reminders like this get contra-productive? (When to send the next "Please approve or reject the patch"?)
The author of the patch would normally send a ping. If you are curious, please see Documentation/process/submitting-patches.rst for some guidelines.
In short, the authors would wait at least a week, and they would apply their best judgment (e.g. whether the merge window is going on, whether it is a new feature or a critical fix, whether feedback/comments/tags are still coming, etc.).
Cheers,
Miguel
Quoted 3 lines · Olof Johansson
This might be a bit bikesheddy, but it saves a few roundtrips to the documentation when getting the
make LLVM=1 rustavailablerun to pass.
It is faster for someone that already knows how things work, but it may make newcomers skip the docs and it duplicates the information there. In addition, for the non-error case, it makes it more verbose which may not be appreciated. So maybe we should point to the docs instead? What do you think?
Also, the patch doesn't add instructions for all the cases, so somebody that may have hit one of the documented ones + not have read the docs may wonder where to find them the solution or why they are missing.
Thanks!
Cheers,
Miguel
Quoted 11 lines · Miguel Ojeda
Quoted 3 lines · Olof Johansson
This might be a bit bikesheddy, but it saves a few roundtrips to the documentation when getting the
make LLVM=1 rustavailablerun to pass.It is faster for someone that already knows how things work, but it may make newcomers skip the docs and it duplicates the information there. In addition, for the non-error case, it makes it more verbose which may not be appreciated. So maybe we should point to the docs instead? What do you think?
I don't really have a preference. This patch would have helped me, so I figured I would post it. My interest isn't really high enough to spend more effort on it at this time -- I got my setup working by now.
Refactoring the script to have a shared message on non-successful exit with a reference to the doc would achieve what you're suggesting though.
Quoted 4 lines
Also, the patch doesn't add instructions for all the cases, so somebody that may have hit one of the documented ones + not have read the docs may wonder where to find them the solution or why they are missing.
Sure.
-Olof