Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide seL4test in Rust #68

Open
axel-h opened this issue Jan 26, 2022 · 3 comments
Open

provide seL4test in Rust #68

axel-h opened this issue Jan 26, 2022 · 3 comments

Comments

@axel-h
Copy link
Member

axel-h commented Jan 26, 2022

As a Follow-up from the discussion around seL4/seL4#733, having a Rust version of sel4test is needed to ensure the Rust bindings can be tested automatically and breaking changes are detected immediately.

@lsf37
Copy link
Member

lsf37 commented Jan 26, 2022

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.

@ratmice
Copy link

ratmice commented Jan 30, 2022

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.

@ratmice
Copy link

ratmice commented Jan 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants