Open axel-h opened 2 years ago
To summarise some of the discussion from the seL4 dev hangout on this: the proposed testing method for this is to run the normal C sel4test, but to use Rust libsel4 bindings via ffi.
It might actually be nice to have some real sel4test code in Rust as well, so that there is some experience in using it directly here, but it would make it harder to get all of sel4test running for newcomers, because you then need two language and cross compiler setups.
I've got some questions, they probably belong here rather than the the stub gen PR, Such as which version of rust this intends to track (e.g. nightly or stable).
The stub gen PR currently generates code for types which aren't part of the PR, (seL4_Error
, seL4_MessageInfo
), my first guess was that these are being generated from the C sources, via bindgen.
But seeing the note by @ls37 maybe it is intended to use pure rust versions of these, I at least have some ideas on how to make a pure rust seL4_Error
which I think should be binary compatible with the existing C seL4_Error
, but depending on nightly or stable could behave or eventually behave like a normal rust Result
/Error
.
So feel free to ping me when the time comes to discuss this stuff.
FWIW, I put up an error test repository here: https://github.com/ratmice/error_compat_rust_experiments This repository asks and seeks to answer the question, If we just go with an error ABI compatible with the existing seL4_Error is it possible that this error behave in the way that rust users will expect, if or when the stuff which this experiment relies on get stablized.
There are 3 separate implementations of the seL4_Error enum, and I think at least 2 of them ended up decently rusty and the 3rd is just horrible.
Hope it helps.
(well ABI compatible to a certain extent, it also shows that is able to drop the NumErrors item),
Edit: I had a bit of misunderstanding regarding how this was being undertaken, by all means ignore
As a Follow-up from the discussion around https://github.com/seL4/seL4/pull/733, having a Rust version of sel4test is needed to ensure the Rust bindings can be tested automatically and breaking changes are detected immediately.