I would very much like to write kernels in rust and I am trying to replicate the experiment that SB describes in this post, https://forum.m-labs.hk/d/12-rust-kernels, I have a couple of questions.

I have set up my development environment on the Linux host using artiq clone from tip and cd into artiq and "nix develop". There is a rustc in my environment but the rustc compile command given is not accepted. For one thing, the target string or1k is not recognized. I thought maybe changing that to risc32i would be correct. That passes (not known if that's correct) but then I get an error

rustc --target riscv32i-unknown-none-elf -g  rustkernel.rs -Z force-overflow-checks=off
error[E0463]: can't find crate for `core`
  = note: the `riscv32i-unknown-none-elf` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.

I believe that target is installed because I asked rustc to show me the supported target strings, so it must be the crate problem. I'm afraid I don't know much about crates at the moment.

After that I can see next command linux-ar won't work either because I don't know where the rust rlib is.

Then i thought i could do a full artiq build which didn't use cache but I don't see how to do that. I'm familiar with working in the clang-llvm system where the build takes a horrible amount of time, but I have access to all the steps and intermediate files. Can you help me inch forward? Thanks for all your support. --Melanie

The post I made is just a quick proof-of-concept and Rust kernel support is by no means finished. It would require a lot of development work and you need to be familiar with Rust (including some lesser-known aspects of rustc) in order to carry it out. You will encounter far worse problems than "can't find crate for core" later on; for example, currently there are no Rust drivers for any Sinara card and currently no way to interface Rust with ARTIQ-Python drivers.