I'm trying to specify a custom runner for cargo, but it just refuses to use it. I've tried using both my own custom target triple after target.
and I've tried using the cfg option you see below:
[target.'cfg(all(target_os = "none"))']
runner = "qemu-system-riscv64 -machine virt -kernel "
but in both cases, it says I have an unused manifest key when compiling:
warning: unused manifest key: target.cfg(all(target_os = "none")).runner
When using the cargo run
it always just runs the normal binary instead of my custom runner.
My case is special as I'm using the config.toml
file under the .cargo
folder to specify my custom target triple:
[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
[build]
target = "compilation_targets/riscv-unknown-kadrix.json"
Since this is a kernel there are some over special things about it:
_start
.start
section for the _start
function instead of .text
Not sure if any of those bullet points are relevant but better safe than sorry. The code is here if you want to inspect further.
The [target.'cfg'] runner =
needs to be in .cargo/config.toml
and not Cargo.toml
.