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

Replace linux_rustix opt-in backend with linux_raw #572

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Dec 23, 2024

This PR replaces the linux_rustix opt-in backend introduced in #520 with linux_raw opt-in backend based raw syscalls implemented using asm!. It noticeably reduces dependency footprint of the crate (see concerns raised in #433). Unfortunately, it means that we have to implement the raw syscalls ourselves.

This PR implements linux_raw support only for target arches with stable asm!. Nightly-only support for other targets can be added in later PRs.

@newpavlov newpavlov requested a review from josephlr December 23, 2024 17:39
Copy link
Member

@josephlr josephlr left a comment

Choose a reason for hiding this comment

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

Personally, I think this seems like a lot of added complexity for a backend that is not enabled by default. I think that we should try to find some other way to solve the issues raised in #433, or just not have a rustix/raw-syscall backend right now.

Getting raw syscalls correct can be very complex if we want to support a range of targets, and I don't think we are well situated to maintain such things.

@newpavlov
Copy link
Member Author

newpavlov commented Dec 23, 2024

just not have a rustix/raw-syscall backend right now

Yes, it's a reasonable option. We can delay this backend until a later release.

But I believe we should eventually have a "raw Linux syscall" backend as it was requested several times (#401, #424).

Getting raw syscalls correct can be very complex if we want to support a range of targets, and I don't think we are well situated to maintain such things.

I do not agree with the "very complex" assessment. As mentioned in the comments, I've mostly copied the battle-tested code from rustix, intentionally limited the set of supported targets and did not include any vDSO complexity.

Ideally, I would prefer to have the syscall stuff in a separate lean crate, but, unfortunately, rustix/linux-raw-sys developers weren't open to such changes. I could create my own fork of linux-raw-sys, but would it be really better than the current solution?

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.

2 participants