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

cpu/riscv_common: Enable Rust applications #17520

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Jan 14, 2022

Contribution description

This is largely just stating it works.

It contains a workaround for
rust-lang/rust-bindgen#1555 (withouot which
bindgen would fail, with little information helping remedy the cause)

[edit: added] Note that the actual RUST_TARGET referred to in "HAS_RUST_TARGET" has already been set since the introduction to Rust (so that experimentation could be done when forcing one's way around the features); only now it is used. When any other targets than riscv32imac are supported, makefiles/arch/riscv.inc.mk will need adjustments both on the CFLAGS and RUST_TARGET side.

Testing procedure

  • Take a RISC-V board, run one of the Rust examples or tests.

(I did it with a hifive1 and rust-hello).

Even though I thought I had all the right and matching compilers, things did not work for me when building from my Debian environment -- I blame it on the weird way C2Rust is installed here. In the docker images, all works fine, so despite my reluctance I'm doing tests BUILD_IN_DOCKER=1.

Status

This is marked as a Draft PR while I'm doing a bit more testing, and also I don't want to clog CI right now.

Ready for experimentation as long as CI says it's good.

This contains a workaround for
rust-lang/rust-bindgen#1555 (withouot which
bindgen would fail, with little information helping remedy the cause)
@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms labels Jan 14, 2022
@chrysn chrysn added Area: Rust Area: Rust wrapper Type: new feature The issue requests / The PR implemements a new feature for RIOT and removed Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Jan 14, 2022
Without passing this through, any crate downloads would go to the
container's image's scratch space, to be re-downloaded for each build,
and with new time stamps that cause compilation to start anew as well.
@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Jan 14, 2022
@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 15, 2022
@chrysn
Copy link
Member Author

chrysn commented Jan 16, 2022

Worked so far both on CI and in all local tests (running code from riot-examples on the board), so I'd deem that ready for review.

@chrysn chrysn marked this pull request as ready for review January 16, 2022 10:03
@chrysn chrysn added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 26, 2022
@chrysn
Copy link
Member Author

chrysn commented Jan 26, 2022

Thanks; starting a CI run as the build has become a bit stale.

@chrysn chrysn enabled auto-merge January 26, 2022 16:55
@chrysn chrysn merged commit 99d245f into RIOT-OS:master Jan 26, 2022
@chrysn chrysn deleted the rust-enable-riscv branch January 26, 2022 18:17
@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 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: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration 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 Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants