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/cargo: Remove CARGO_CHANNEL and other simplifications #20319

Merged
merged 8 commits into from
Feb 2, 2024

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Jan 31, 2024

Contribution description

The Rust makefiles contain some stuff that is needlessly complex and was necessary due to earlier Rust versions that have long been unsupported. This cleans them up; see individual commits for details.

Testing procedure

Apart from CI, I tested:

  • in examples/rust-hello-world: make BOARD=microbit-v2 CARGO_PROFILE=dev, with profile values also using test and bench because they are special cases to Cargo; rm -rf bin inbetween to see it's not tapping into old existing files. To test CARGO_PROFILE=foo, add this to Cargo.toml:

    [profile.foo]
    inherits = "release"
  • Any of the examples can still just be built, but you can also

    • run rustup override set beta in the directory of an example and run it there; you'll see everything recompiling because a different compiler is now used, and make info-rust shows the beta version (beware this persists, so rustup override remove later)
    • Similarly, you can write [toolchain] / channel = "nightly" into rust-toolchain.toml to have a locally visible override.

Back when specific control of the Rust version used with RIOT was
needed, CARGO_CHANNEL was added to explicitly set the Rust version with
consideration for CI special cases.

Rust's mechansims of selecting a toolchain can be used instead now.
@chrysn chrysn added Area: build system Area: Build system Area: Rust Area: Rust wrapper labels Jan 31, 2024
@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 Jan 31, 2024
@github-actions github-actions bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: examples Area: Example Applications labels Jan 31, 2024
@riot-ci
Copy link

riot-ci commented Jan 31, 2024

Murdock results

✔️ PASSED

50c9d93 rust/doc: Document make info-rust for IDE/editor setup

Success Failures Total Runtime
8627 0 8627 10m:03s

Artifacts

The checks would print their prominently colored warnings and confuse
users, and the comments are more geared to those editing the Makefiles
than to those watching which commands get executed.
@chrysn chrysn mentioned this pull request Jan 31, 2024
13 tasks
@chrysn
Copy link
Member Author

chrysn commented Jan 31, 2024

The last change (the additions to info-rust) will need some extension when RIOT-OS/rust-riot-wrappers#79 is merged; if that overtakes this PR, I'll update in-place.

[edit: Now updated].

This pulls in embedded-nal 0.7 implementations, and (on both crates)
alterations that decouple riot-wrappers from riot-sys and simplify build
system integration, and do away with the need for passing
RIOT_USEMODULE.
The latest versions of riot-wrappers and riot-sys do not require it any
more, and the exported data from info-rust is thus much more stable.
@github-actions github-actions bot added the Area: sys Area: System label Feb 1, 2024
@chrysn chrysn requested a review from kaspar030 February 1, 2024 22:42
@benpicco benpicco added this pull request to the merge queue Feb 2, 2024
Merged via the queue into RIOT-OS:master with commit 22dbbf4 Feb 2, 2024
26 checks passed
@derMihai
Copy link
Contributor

derMihai commented Feb 2, 2024

rust-riot-sys/build.rs still complains that RIOT_USEMODULE is not set. Any solution for that on the way?
My bad, forgot to pull latest changes in riot-wrappers and riot-sys.

Now it seems to work just fine!

@chrysn chrysn deleted the rust-simplifications branch February 2, 2024 13:42
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 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: doc Area: Documentation Area: examples Area: Example Applications Area: Rust Area: Rust wrapper Area: sys Area: System Area: tests Area: tests and testing framework 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.

5 participants