-
Notifications
You must be signed in to change notification settings - Fork 63
Add listen to BSDs #259
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
Add listen to BSDs #259
Conversation
Copy over Darwin's code and reuse it for the most common BSDs. It is untested in all BSDs added but in DragonFly BSD but at least it'll allow the build to succeed. TODO: Might want to merge darwin and BSD file together but for now they are separate because we might need to add something BSD-specific.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tuxillo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -0,0 +1,58 @@ | |||
//go:build freebsd || netbsd || openbsd || dragonfly | |||
// +build freebsd netbsd openbsd dragonfly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darwin.go can be merged here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left it in different files just in case there was something BSD-y required that's not present in Darwin. I can't try all BSDs tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it would be easy enough to duplicate this file when BSD-specific support would be needed? I'd prefer to only have //go:build darwin || dragonfly || freebsd || netbsd || openbsd
for now, instead of adding more duplicate listen
code.
If you duplicate the code, I'd remove the case "vsock"
block which is hyperkit specific, and ListenUnixgram
is also not expected to be used as it's vfkit-specific, so this could error out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good reason to have two, one for darwin and one for bsd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the BSD files are different from the darwin files, yes, this is a good reason for having 2 files. As the PR is right now, the files are the same.
The commit log is missing a |
My take on this is https://github.com/cfergeau/gvisor-tap-vsock/tree/bsd - It's more involved than this PR as this refactors the existing code so that the platform files only contain platform specific code. Then this adds a generic |
Have some questions.
|
The vsock implementation in
I'm not sure which "unix stuff" you are referring to? |
I was referring to all unix-like systems (linux, bsds, probably solaris) but not Darwin. But now that vsock is still needed in Linux for the vsock implementation you mentioned this makes less sense. |
@cfergeau what are the next steps then? |
With #262 merged, *bsd builds should be fixed, closing this PR. |
Copy over Darwin's code and reuse it for the most common BSDs. It is untested in all BSDs added but in DragonFly BSD but at least it'll allow the build to succeed.
Might want to merge darwin and BSD file together but for now they are separate because we might need to add something BSD-specific.
Build might fail in DragonFly BSD because it depends on insomniacslk/dhcp#510 , which is still not upstream. So a bump will also be needed for this specific OS.
This is for the ongoing issue lima-vm/lima#892