-
Notifications
You must be signed in to change notification settings - Fork 704
Partial OpenBSD support. #3394
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
base: main
Are you sure you want to change the base?
Partial OpenBSD support. #3394
Conversation
Thanks for contributing this and tackling the issue yourself. |
I haven't performed a full review yet but I think having some very brief documentation of the current status of BSD support would probably be useful. |
Additional partial platform support. * Create a new CNIOBSD module for OpenBSD, for general cleanliness, and make use of it throughout. Some of the changes are borrowed directly from CNIOLinux; some may technically be unnecessary; I am erring somewhat on expediency to functionality. * Since `malloc_size` is unavailable on OpenBSD, and some of the helpers make use of ManagedBufferPointer which makes use of it, mark some of this as unavailable as well. * Usual pthread optional typing changes, since pthread types are pointers on this platform. * Add conditionals to exclude other functionality not available here, like IP_RECVPKTINFO or IP_PKTINFO. * d_ino is a backwards-compatibility macro valued token for dirent, so instead, just expand with a conditional. * Use kqueue on OpenBSD. This necessitates adding some conditionals for type and feature compatibility. * The vsock API is unavailable on OpenBSD. Tested the NIOTCPEchoClient and NIOTCPEchoServer appears to work and that swift-nio-ssh (hopefully wlog) builds with a local repository with these changes. Because NIOFS/_NIOFileSystem depend on some non-portable components, such as extended attributes, sendfile, non-portable linkat flags, and renameat2, this is only just partial OpenBSD support, which means that `swift build` on the full swift-nio project won't build cleanly, but at least the portable parts can be used to build servers and clients. This commit will mark the linked bug as fixed; I will open a new bug for file system support. Fixes apple#3383.
…pple#3387) See apple#3386 CC @FranzBusch @ktoso @Lukasa Signed-off-by: Melissa Kilby <[email protected]>
…pple#3389) See apple#3386 CC @FranzBusch @ktoso @Lukasa Signed-off-by: Melissa Kilby <[email protected]> Co-authored-by: Rick Newton-Rogers <[email protected]>
apple#3390) See apple#3386 CC @FranzBusch @ktoso @Lukasa Signed-off-by: Melissa Kilby <[email protected]>
Co-authored-by: Rick Newton-Rogers <[email protected]>
I added a line in README.md in the section describing platform support. |
Motivation:
Additional partial platform support.
Modifications:
Create a new CNIOBSD module for OpenBSD, for general cleanliness, and make use of it throughout. Some of the changes are borrowed directly from CNIOLinux; some may technically be unnecessary; I am erring somewhat on expediency to functionality.
Since
malloc_size
is unavailable on OpenBSD, and some of the helpers make use of ManagedBufferPointer which makes use of it, mark some of this as unavailable as well.Usual pthread optional typing changes, since pthread types are pointers on this platform.
Add conditionals to exclude other functionality not available here, like IP_RECVPKTINFO or IP_PKTINFO.
d_ino is a backwards-compatibility macro valued token for dirent, so instead, just expand with a conditional.
Use kqueue on OpenBSD. This necessitates adding some conditionals for type and feature compatibility.
The vsock API is unavailable on OpenBSD.
Result:
Tested the NIOTCPEchoClient and NIOTCPEchoServer appears to work and that swift-nio-ssh (hopefully wlog) builds with a local repository with these changes.
Because NIOFS/_NIOFileSystem depend on some non-portable components, such as extended attributes, sendfile, non-portable linkat flags, and renameat2, this is only just partial OpenBSD support, which means that
swift build
on the full swift-nio project won't build cleanly, but at least the portable parts can be used to build servers and clients. This commit will mark the linked bug as fixed; I will open a new bug for file system support.Fixes #3383.