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

Rust: Add make cargo-command and refactoring around it #20828

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Aug 21, 2024

Contribution description

Users who want to do more than just use cargo to build their RIOT application (say, run the linter cargo check with the right settings, run cargo fix, the advanced linter clippy, or build documentation) previously had to extract the relevant environment variables and command line extras from make info-rust.

In particular, that was hard to integrate in CI – for example, to run the linter in strict mode on your application.

The newly introduced make cargo-command CARGO_COMMAND="cargo clippy" family (where the content for CARGO_COMMAND is run with all the right setup) closes this gap.

Testing procedure

  • CI still passes
  • make -C examples/rust-gcoap cargo-command CARGO_COMMAND="cargo check --release" may show warnings, but completes successfully.

Issues/PRs references

This may also contribute to #20088 (thus CC'ing @derMihai).

It also helps with the follow-up of RIOT-OS/rust-riot-wrappers#105, making the warnings easier to show, and even to fix by picking cargo fix or cargo clippy --fix.

@chrysn chrysn added Area: build system Area: Build system Area: Rust Area: Rust wrapper labels Aug 21, 2024
@chrysn chrysn requested review from maribu and kaspar030 August 21, 2024 20:47
@chrysn chrysn force-pushed the cargo-customization branch from e1fed88 to 0f8535e Compare August 21, 2024 20:52
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 21, 2024
@riot-ci
Copy link

riot-ci commented Aug 21, 2024

Murdock results

✔️ PASSED

4beff4e makefiles: Align cargo-info output with what happens in the build system

Success Failures Total Runtime
10179 0 10180 16m:19s

Artifacts

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

That looks pretty helpful :)

@benpicco
Copy link
Contributor

Please squash!

chrysn added 3 commits August 22, 2024 15:16
Examples of executed commands are `cargo check`, `cargo fix` or `cargo
doc`.
The options passed to cargo are not universal, and thus can not apply to
all commands as was previously documented.
This simplifies the explanation of what might need adjustments depending
on which cargo command is invoked.
@chrysn chrysn force-pushed the cargo-customization branch from 2cb8f5e to 4beff4e Compare August 22, 2024 13:18
@chrysn chrysn enabled auto-merge August 22, 2024 13:18
@chrysn chrysn added this pull request to the merge queue Aug 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 22, 2024
@chrysn chrysn added this pull request to the merge queue Aug 22, 2024
Merged via the queue into RIOT-OS:master with commit 9041fcb Aug 23, 2024
25 checks passed
@chrysn chrysn deleted the cargo-customization branch August 23, 2024 06:23
chrysn added a commit to RIOT-OS/rust-documentation-builder that referenced this pull request Aug 23, 2024
@benpicco benpicco added this to the Release 2024.10 milestone Nov 27, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants