passthrough.rs fails with cannot find type statx in crate libc#432
passthrough.rs fails with cannot find type statx in crate libc#432peppergrayxyz wants to merge 1 commit intocontainers:mainfrom
statx in crate libc#432Conversation
7f247dc to
ccbbc32
Compare
| polly = { path = "../polly" } | ||
| rutabaga_gfx = { path = "../rutabaga_gfx", features = ["virgl_renderer", "virgl_renderer_next"], optional = true } | ||
| imago = { version = "0.1.4", features = ["sync-wrappers", "vm-memory"] } | ||
| rustix = { version = "1.1.2", features = ["fs"] } |
There was a problem hiding this comment.
I think adding a new dependency just for this is a bit overkill. Let's simply wait for the rust toolchain to ship a newer version of musl, shouldn't take long.
There was a problem hiding this comment.
Yeah, adding the dependency for such a simple thing seems like an overkill to me too.
An alternative could be to use libc::syscall directly.
musl 1.2.5 was released on February 29, 2024, so it's taking a while 😄. Nevertheless seems like we will get it soon-ish:
rust-lang/rust#142682
Btw. I was actually considering whether we may want to start using rustix over nix - it seemed to be nicer in some areas than nix, but it's hard to say...
There was a problem hiding this comment.
statx-sys does that, but has been deprecated in favor of libc::statx and rustix. It doesn't support stx_mnt_id but can be patched easily. But we could use it, thereby avoiding pulling in rustix and also writing the wrapper from scratch.
I created a draft here:
- libkrun patch: 66a4c5f
- statx-sys patch: oxalica/statx-sys@c0cd9f6
I'd move the statx-sys fork to libkrun or just include the files in the project if we wanna go forward with this.
musl 1.2.5 added support for the statx system call rust ships unknown-linux-musl with musl 1.2.3 milage on other libs may varay Enable portability by repling libc::statx with rustix::statx Fixes: containers#431 Signed-off-by: Pepper Gray <hello@peppergray.xyz>
|
@peppergrayxyz Please consider using |
|
FWIW, the upgrade to musl 1.2.5 will land in the upcoming Rust 1.93 release. |
|
We're already in 1.94, so let's close this one. |
musl 1.2.5 added support for the statx system call rust ships unknown-linux-musl with musl 1.2.3, milage on other libs may varay
Enable portability by repling libc::statx with rustix::statx
fixes #431