makefiles/rust: Err early, provide suggestions #18220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
Experienced RIOT users, when building Rust based examples for the first time, can easily miss subtle parts of the required tooling when not installing through BUILD_IN_DOCKER.
To enhance the user experience, this adds a few checks to the builds to ensure that usable error messages are produced before kicking off the Rust tools, which do generally provide good error output, but currently not in the most concise way and generally not by pointing to the relevant RIOT related documentation).
[edit] To some extent the tests may be overly strict (eg. it tests for the presence of rustup, which technically is not required); the error message shown then explains why that is usually necessary and also guides about what to do if the ecosystem changes and that test (along with others) is not suitable any more.
Testing procedure
make -C examples/rust-hello-world
without reading the docs first and only react to obvious error messages.Issues/PRs references
Closes: #18200