I have a simple kernel: https://github.com/dark-canvas/synapse
Which I can boot via my UEFI bootloader: https://github.com/dark-canvas/satus
But when I try to add UTs, they fail to build:
Code: Select all
jweeks@pop-os:~/code/synapse$ cargo test --target x86_64-unknown-linux-gnu
Compiling volatile v0.4.6
Compiling bit_field v0.10.3
Compiling bitflags v2.11.0
Compiling satus-struct v0.1.0 (https://github.com/dark-canvas/satus-struct#09dad6de)
error[E0152]: duplicate lang item in crate `core`: `sized`
|
= note: the lang item is first defined in crate `core` (which `satus_struct` depends on)
= note: first definition in `core` loaded from /home/jweeks/code/synapse/target/x86_64-unknown-linux-gnu/debug/deps/libcore-b6f5b675cce2ded8.rmeta
= note: second definition in `core` loaded from /home/jweeks/code/synapse/target/x86_64-unknown-linux-gnu/debug/deps/libcore-9f84d55d1ea268b0.rmeta
etc...
https://github.com/dark-canvas/synapse/ ... ig.toml#L4
And, indeed, if I remove that, I can build, and run... but they crash:
Code: Select all
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.01s
Running unittests src/main.rs (target/x86_64-unknown-linux-gnu/debug/deps/kernel-584809ad931f72bd)
error: test failed, to rerun pass `--bin kernel`
Caused by:
process didn't exit successfully: `/home/jweeks/code/synapse/target/x86_64-unknown-linux-gnu/debug/deps/kernel-584809ad931f72bd` (signal: 11, SIGSEGV: invalid memory reference)
I'm curious if anyone has this working, or if there's a list of best practices for building a kernel (with a custom target) but running the tests on the local platform.
Thanks,
Jeff
