This is an example rust program built for an example embedded riscv64 processor, built by Bazel.
Try it out:
bazel build //prg:my_programThis will download all needed tools, configure them, and run a cross-compiler that will produce a binary that can run on a riscv64 processor in machine mode.
bazel build //prg:disasmThis will compile, but also disassemble the basic program. View the result for example using:
cat bazel-bin/prg/disasm.S
bazel run @rules_rust//tools/rust_analyzer:gen_rust_project
The above requires the target //:gen_rust_project.
This is how to generate new lock files. At the project outset, you must
- create the empty files
//third_party/cargo:Cargo.lock, and//third_party/cargo:Cargo.Bazel.lock. - Run
env CARGO_BAZEL_REPIN=true bazel build //...to initialize the lockfiles.