sunfishcode / c-ward

An implementation of libc written in Rust
Other
187 stars 11 forks source link

c-scape: Incompatible type in listxattr #132

Closed pothos closed 3 months ago

pothos commented 3 months ago

I run into mismatches types because c-scape:src/fs/xattr.rs has READ_BUFFER as [u8] and passes it to rustix::fs::listxattr which expects [i8] (actually c::c_char). That happens with rustix 0.38.34 and Eyra from main. Using the nightly-2024-04-21 from the Eyra toolchain didn't help. Other functions such as fgetxattr in rustix expect u8 and if rustix is right if might make sense to add a second READ_BUFFER definition in c-scape that uses i8, or?

sunfishcode commented 3 months ago

Thanks for the report! I've now filed #133 to fix it.

pothos commented 3 months ago

Thanks! With that I got a rebased version of your coreutils patch to compile :)

Edit: Using main for Eyra and c-scape until there are new releases. Edit2: Actually, the patch is not needed if you do cargo add eyra --rename=std and set up RUSTFLAGS="-C link-arg=-nostartfiles -C target-feature=+crt-static -C relocation-model=static" (Last two args to get a static binary).

sunfishcode commented 3 months ago

This is now released in c-scape 0.16.0 and eyra 0.16.11.

pothos commented 3 months ago

Thanks a lot, I've finally switched https://github.com/pothos/rust-userland to use Eyra

sunfishcode commented 3 months ago

Cool!