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

x/sys/unix: some SYS constants disappeared on Darwin #41868

Closed
bradfitz opened this issue Oct 8, 2020 · 9 comments
Closed

x/sys/unix: some SYS constants disappeared on Darwin #41868

bradfitz opened this issue Oct 8, 2020 · 9 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Oct 8, 2020

We updated our golang.org/x/sys dependency from v0.0.0-20200812155832 to v0.0.0-20201008064518-c1f3e3309c71 and got a build breakage on GOOS=darwin:

../../wireguard-go/tun/tun_darwin.go:141:3: undefined: unix.SYS_IOCTL
../../wireguard-go/tun/tun_darwin.go:162:3: undefined: unix.SYS_CONNECT
../../wireguard-go/tun/tun_darwin.go:241:4: undefined: unix.SYS_GETSOCKOPT
../../wireguard-go/tun/tun_darwin.go:346:3: undefined: unix.SYS_IOCTL
../../wireguard-go/tun/tun_darwin.go:380:3: undefined: unix.SYS_IOCTL

/cc @ianlancetaylor @tklauser

@gopherbot gopherbot added this to the Unreleased milestone Oct 8, 2020
bradfitz added a commit to tailscale/tailscale that referenced this issue Oct 8, 2020
@bcmills
Copy link
Contributor

bcmills commented Oct 8, 2020

git bisect reports CL 250437 (approved by @bradfitz)

@ianlancetaylor
Copy link
Contributor

These were dropped because (as you know) macOS doesn't want us to make direct system calls anyhow. They want us to go through libSystem in all cases.

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 9, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/262959 mentions this issue: unix: add IoctlGetCtlInfo on darwin

gopherbot pushed a commit to golang/sys that referenced this issue Oct 18, 2020
For golang/go#41868

Change-Id: I0f4dbeacfe10b9614caf05633a1de3a98a1fc85f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/262959
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/264637 mentions this issue: unix: add IoctlIfreqMTU on darwin

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/264638 mentions this issue: unix: implement AF_SYSTEM/AF_SYS_CONTROL sockets on darwin

gopherbot pushed a commit to golang/sys that referenced this issue Oct 26, 2020
For golang/go#41868

Change-Id: I9fb8f5eee933488e4c63aaa757059b8cea4d9629
Reviewed-on: https://go-review.googlesource.com/c/sys/+/264637
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
gopherbot pushed a commit to golang/sys that referenced this issue Oct 27, 2020
See https://developer.apple.com/documentation/kernel/sockaddr_ctl for
details.

AF_SYSTEM is darwin-specific, so the BSD-specific anyToSockaddr func
needs to call GOOS-specific funcs which return nil, EAFNOSUPPORT on all
BSD platforms but darwin.

For golang/go#41868

Change-Id: Id7794aba5988dd9511053b76be5efeb66c104a26
Reviewed-on: https://go-review.googlesource.com/c/sys/+/264638
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
tklauser added a commit to tklauser/wireguard-go that referenced this issue Oct 27, 2020
This adds the fixes for golang/go#41868 which are needed to build
wireguard without direct syscalls on macOS.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@tklauser
Copy link
Member

The build breakage in wireguard-go should be addressed by WireGuard/wireguard-go#42

@bradfitz
Copy link
Contributor Author

@tklauser, thanks for that!

What do you think about reverting the zsysnum file deletions from CL 250437? I don't think Go's migration away from raw system calls should force other people's schedules on when they migrate away from direct system calls.

zx2c4-bot pushed a commit to WireGuard/wireguard-go that referenced this issue Oct 27, 2020
This adds the fixes for golang/go#41868 which are needed to build
wireguard without direct syscalls on macOS.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
@tklauser
Copy link
Member

@tklauser, thanks for that!

What do you think about reverting the zsysnum file deletions from CL 250437? I don't think Go's migration away from raw system calls should force other people's schedules on when they migrate away from direct system calls.

@bradfitz yeah, good point. Let's not force other people to migrate away just yet. I'll send a CL to re-add the zsysnum files.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/265857 mentions this issue: unix: revert zsysnum_darwin_*.go deletion from CL 250437

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants