Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefiles/rust: Err early, provide suggestions #18220

Merged
merged 4 commits into from Jun 22, 2022

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Jun 16, 2022

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

  • CI should still run through
  • Someone who hasn't done it before could try make -C examples/rust-hello-world without reading the docs first and only react to obvious error messages.

Issues/PRs references

Closes: #18200

…es in place

This is also a workaround for Rust's [97685], but primarily to enhance
the error message by pointing out that -Zbuild-std is an option, and
generally presenting the error as RIOT usually does.

[97685]: rust-lang/rust#97685
@chrysn chrysn added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: doc Area: Documentation Area: build system Area: Build system Area: Rust Area: Rust wrapper labels Jun 16, 2022
@github-actions github-actions bot removed the Area: doc Area: Documentation label Jun 16, 2022
@chrysn chrysn requested a review from MrKevinWeiss June 16, 2022 14:29
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Maybe someone without already going through these steps can verify but I would be happy to add this in regardless.

@chrysn
Copy link
Member Author

chrysn commented Jun 22, 2022

Thanks. Pulling this in without that extra check because there are later extensions to this already that work best if tested together with this.

@chrysn chrysn enabled auto-merge June 22, 2022 10:17
@chrysn chrysn added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 22, 2022
@chrysn chrysn merged commit b9af16e into RIOT-OS:master Jun 22, 2022
@chrysn chrysn deleted the rust-err-early branch June 22, 2022 18:15
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: Rust Area: Rust wrapper CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust error handling: "consider downloading ..." gets lost
2 participants