Skip to content

Add Rust support for RISC-V arch - #225

Merged
ojeda merged 2 commits into
Rust-for-Linux:rustfrom
nbdd0121:rust
Apr 28, 2021
Merged

Add Rust support for RISC-V arch#225
ojeda merged 2 commits into
Rust-for-Linux:rustfrom
nbdd0121:rust

Conversation

@nbdd0121

@nbdd0121 nbdd0121 commented Apr 25, 2021

Copy link
Copy Markdown
Member

No description provided.

@TheSven73

Copy link
Copy Markdown
Collaborator

Does this run on QEMU? If so, would it make sense to run this in the CI, like the other architectures?

Signed-off-by: Gary Guo <gary@garyguo.net>
@nbdd0121

Copy link
Copy Markdown
Member Author

Does this run on QEMU? If so, would it make sense to run this in the CI, like the other architectures?

It runs on QEMU, but you need to supply a firmware (e.g. OpenSBI). I don't think any distro has that supplied yet, so it means in the CI we have to pull and compile another project, which isn't trivial amount of work.

@ojeda

ojeda commented Apr 26, 2021

Copy link
Copy Markdown
Member

we have to pull and compile another project, which isn't trivial amount of work.

We are already cross-compiling Busybox on the fly -- does OpenSBI take long to compile? If not, I can take a look at adding it.

@memoryruins

memoryruins commented Apr 26, 2021

Copy link
Copy Markdown

Ubuntu 20.04 (which I think CI uses) packages OpenSBI 0.6, 20.10 packages 0.8, and 21.04 packages 0.9.
The most recent version of OpenSBI is 0.9 if that matters.

@nbdd0121

Copy link
Copy Markdown
Member Author

Ubuntu 20.04 (which I think CI uses) packages OpenSBI 0.6, 20.10 packages 0.8, and 21.04 packages 0.9.
The most recent version of OpenSBI is 0.9 if that matters.

Wow, Ubuntu has OpenSBI packaged, I didn't know that. Debian only has OpenSBI in sid, so I assumed Ubuntu wouldn't have it yet. I'll look to see if I can integrate it in the CI.

@ojeda

ojeda commented Apr 26, 2021

Copy link
Copy Markdown
Member

Thanks @nbdd0121! If you see any problems or you do not have time, let me know and I can do the CI missing bits.

@nbdd0121
nbdd0121 marked this pull request as draft April 27, 2021 00:11
@nbdd0121

nbdd0121 commented Apr 27, 2021

Copy link
Copy Markdown
Member Author

@ojeda I had a try, but I got a timeout and GitHub killed it without giving me much information. I don't have any machines with Ubuntu 20.04, and I tried to use nektos/act to test locally but it does not seem to support some constructs used in the CI script. I don't have much experience debugging GitHub actions; could you have a look if you have time? Thanks.

@ojeda

ojeda commented Apr 27, 2021

Copy link
Copy Markdown
Member

Sure! Let me take a look.

@ojeda

ojeda commented Apr 27, 2021

Copy link
Copy Markdown
Member

The bundled OpenSBI works fine for me in a VM, so no need to recompile.

The timing out issue is because 1) CONFIG_SOC_VIRT is not enabled and 2) -no-reboot does not seem to work for RISC-V in that version of QEMU. I compiled the latest QEMU and it works there.

The no output issue is due to something missing in the configuration, defconfig works.

I think the best approach is merging this without enabling riscv in the CI matrix just yet, and then I can look into adding a newer QEMU and enabling it.

Signed-off-by: Gary Guo <gary@garyguo.net>
@nbdd0121
nbdd0121 marked this pull request as ready for review April 27, 2021 22:14
@ojeda

ojeda commented Apr 28, 2021

Copy link
Copy Markdown
Member

I will likely tweak a few minor nits later on, but I think we can merge this as-is.

Thanks a lot!

Referencing #66.

@ojeda
ojeda merged commit a6efc40 into Rust-for-Linux:rust Apr 28, 2021
@alex

alex commented Apr 28, 2021

Copy link
Copy Markdown
Member

We should add this to arch-support.rst as well!

@ojeda

ojeda commented Apr 28, 2021

Copy link
Copy Markdown
Member

Yeah! I will do it when actually enabling it in the CI matrix.

@ojeda ojeda mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants