Skip to content

Conversation

@peppergrayxyz
Copy link

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

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"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

devices: cannot find function statx in crate libc

3 participants