go: x/sys/unix: Capsicum support breaks freebsd build
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ncw/go"
GORACE=""
GOROOT="/opt/go/go1.8"
GOTOOLDIR="/opt/go/go1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build712833005=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
cd ${GOPATH}/src/golang.org/x/sys
GOOS=freebsd GOARCH=386 go install ./...
What did you expect to see?
No error
What did you see instead?
# golang.org/x/sys/unix
unix/cap_freebsd.go:18: undefined: CAP_RIGHTS_VERSION_00
unix/cap_freebsd.go:19: undefined: CAP_RIGHTS_VERSION_00
unix/cap_freebsd.go:19: const initializer CAP_RIGHTS_VERSION_00 + 2 is not a constant
unix/cap_freebsd.go:46: undefined: CapRights
unix/cap_freebsd.go:50: undefined: CapRights
unix/cap_freebsd.go:55: undefined: CapRights
unix/cap_freebsd.go:90: undefined: CapRights
unix/cap_freebsd.go:125: undefined: CapRights
unix/cap_freebsd.go:164: undefined: CapRights
unix/cap_freebsd.go:179: undefined: CapRights
unix/cap_freebsd.go:179: too many errors
I bisected the problem to this commit
https://github.com/golang/sys/commit/7a4fde3fda8ef580a89dbae8138c26041be14299
@benlaurie committed with @ianlancetaylor
According to https://go-review.googlesource.com/c/47290/ the trybots ran OK so I’m a bit puzzled about this.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 25 (9 by maintainers)
Commits related to this issue
- vendor: roll back golang.org/x/sys to fix compile Until https://github.com/golang/go/issues/21136 is fixed — committed to rclone/rclone by ncw 7 years ago
- vendor: update golang.org/x/sys Now that https://github.com/golang/go/issues/21136 is fixed — committed to rclone/rclone by ncw 7 years ago
- unix: re-enable Capsicum on FreeBSD 386 Capsicum support was added by https://golang.org/cl/47290, but oinly for amd64. This broke the freebsd/386 build which was subsequently fixed by http://golang.... — committed to tklauser/sys by tklauser 7 years ago
- unix: re-enable Capsicum on FreeBSD 386 Capsicum support was added by https://golang.org/cl/47290, but only for amd64. This broke the freebsd/386 build which was subsequently fixed by http://golang.o... — committed to tklauser/sys by tklauser 7 years ago
- unix: re-enable Capsicum on FreeBSD 386 Capsicum support was added by https://golang.org/cl/47290, but only for amd64. This broke the freebsd/386 build which was subsequently fixed by http://golang.o... — committed to golang/sys by tklauser 7 years ago
- unix: fix FreeBSD 386 build It was broken by https://golang.org/cl/47290 Fixes golang/go#21136 Change-Id: I2a08869fd44a9776f0dc7d461814e1df4e606b5d Reviewed-on: https://go-review.googlesource.com/5... — committed to micanzhang/sys by bradfitz 7 years ago
- unix: re-enable Capsicum on FreeBSD 386 Capsicum support was added by https://golang.org/cl/47290, but only for amd64. This broke the freebsd/386 build which was subsequently fixed by http://golang.o... — committed to micanzhang/sys by tklauser 7 years ago
- unix: fix freebsd/arm build, fix freebsd/{386,arm} tests Re-run mkall.sh on FreeBSD-11.1-RELEASE armv6 for Capsicum consts and POSIX.1-2008 path relative *at() syscalls. Add errors_freebsd_arm.go ge... — committed to micanzhang/sys by paulzhol 7 years ago
@hacdias,
That’s an obviously different issue. Please file a new issue and makes this issue focus on FreeBSD stuff.
Yeah, I get the exact same error on Travis, which always downloads the latest commit of each dependency through
go get.@hacdias You need to update
golang.org/x/syssogo get -u golang.org/x/sysI guess whatever you’re using for cross-compiling is not up-to-date…
I’m getting this error on Travis though with Go 1.8.3. I’ll try to figure out why.
@hacdias just update - it should be fixed now. It is for me any way.