-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
os/user: listgroups_unix.go: missing build directive line #16252
Comments
I guess that it happens when |
It's triggered by a 3rd party package loader (work in progress), which does not support CGO, so the Do you need a exact reproduction case/steps? I can prepare that, it's just it involves unfinished/unstable stuff. OTOH, |
But cross-compiling, maybe?
I think it's better. |
/cc @zombiezen |
Cannot reproduce using $ CGO_ENABLED=0 go build -x -a os/user
...
mkdir -p $WORK/os/user/_obj/
mkdir -p $WORK/os/
cd /home/jnml/go/src/os/user
/home/jnml/go/pkg/tool/linux_amd64/compile -o $WORK/os/user.a -trimpath $WORK
-p os/user -complete -buildid 5ea22e2e3f690c420c76db9f6b3a981a0173d286
-D _/home/jnml/go/src/os/user -I $WORK -pack ./lookup.go ./lookup_stubs.go ./user.go
$ I don't know why the build does not include // +build dragonfly darwin freebsd !android,linux netbsd openbsd Particulary, My env $ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jnml"
GORACE=""
GOROOT="/home/jnml/go"
GOTOOLDIR="/home/jnml/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build543108208=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
$ |
Normally if cgo is enabled then files with import "C" are built, and if cgo is not enabled then files with import "C" are ignored. Search for I don't know what the problem is here, but it would help to know how to reproduce it. |
Thanks for clarifying. It means the bug is not in the Go project. Sorry for the noise. |
tip @ 519b469
AFAICT, there is a line missing:
// +build cgo
The missing directive causes load errors when the
cgo
build tag is not defined, for example:I believe
getgrouplist_darwin.go
andgetgrouplist_unix.go
have the same problem.The text was updated successfully, but these errors were encountered: