Open nbaksalyar opened 3 years ago
https://github.com/rust-embedded/cross is easy to use. It runs tests using qemu.
Great suggestion, thank you!
@nbaksalyar parhaps all you need to do is copy and paste https://gist.github.com/pro465/a33a080d82d2ea28725a5956abb57871
it should be noted that i basically copied and pasted https://github.com/actions-rs/example/blob/master/.github/workflows/cross_compile.yml with some changes to make it cross-test instead of cross-compile without knowing if it will work, and the last time the example was updated was two years ago, so I'm not sure if that will work.
QEMU user mode doesn't support ptrace so using cross won't help unfortunately. A VM will likely be needed.
oh that's unfortunate :(
@bjorn3 but wait, does libc not contain ptrace too? then how do they run/test it in QEMU?
The libc crate doesn't contain any tests at all AFAIK. They only check that it matches the C header files I believe.
Yes, it's a matter of actually executing cross-arch code, whether it's cross-compilated or built natively.
It seems that the simplest option to execute tests would be to run CI on a dedicated server (e.g. there are arm-based nodes) - but we don't support any ISAs apart from x86_64 yet, so I would consider this more of a long-term goal.
We can run non-x86 builds with qemu (like e.g. rust-lang/libc does) in order to ensure that Headcrab can still be built without errors on non-x86 platforms (even if it's not entirely functional).
This will help us to prepare for introducing more target_archs in the future.