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

os/user: fails to compile with 'osusergo' tag on linux/amd64 #24841

Closed
sbinet opened this issue Apr 13, 2018 · 6 comments
Closed

os/user: fails to compile with 'osusergo' tag on linux/amd64 #24841

sbinet opened this issue Apr 13, 2018 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@sbinet
Copy link
Member

sbinet commented Apr 13, 2018

What version of Go are you using (go version)?

$> go version
go version devel +eb4f33243e Fri Apr 13 03:15:02 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

no. osusergo is for next release.

What operating system and processor architecture are you using (go env)?

$> go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/binet/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/binet/dev/go/gocode"
GORACE=""
GOROOT="/home/binet/sdk/go"
GOTMPDIR=""
GOTOOLDIR="/home/binet/sdk/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build320271274=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$> cd ./src/os/user
$> go build -tags osusergo
# os/user
./getgrouplist_unix.go:32: undefined: maxGroups
./getgrouplist_unix.go:33: undefined: maxGroups

What did you expect to see?

A completely static, no-libc, os/user package being successfully built.

What did you see instead?

couldn't see anything through my tears. but I have a CL coming up.

@gopherbot
Copy link

Change https://golang.org/cl/106837 mentions this issue: os/user: add missing osusergo build tag guard

@tklauser tklauser added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 13, 2018
@tklauser
Copy link
Member

@kolyshkin
Copy link
Contributor

@sbinet thanks for the catch (and the fix) 🤝

@gopherbot
Copy link

Change https://golang.org/cl/107299 mentions this issue: os/user: fix build on darwin with "osusergo" build tag

@gopherbot
Copy link

Change https://golang.org/cl/107300 mentions this issue: cmd/dist, os/user: test os/user in osusergo mode as well, fix plan9 & windows

gopherbot pushed a commit that referenced this issue Apr 16, 2018
Fixes #24841
Updates #24845

Change-Id: Ia7e2deefe64c12ee8a76ce6ed9f9e003e912b161
Reviewed-on: https://go-review.googlesource.com/107299
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
gopherbot pushed a commit that referenced this issue Apr 16, 2018
… windows

Would've caught two regressions so far, and found two more.

Updates #24841
Updates #24845 (package net remains)

Change-Id: I57ad06eb54e04b8c99b5d2e7f24c77ad865224e8
Reviewed-on: https://go-review.googlesource.com/107300
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/107304 mentions this issue: os/user: fix osusergo build on Solaris

gopherbot pushed a commit that referenced this issue Apr 16, 2018
Verified that on on Linux, with:

CGO_ENABLED=1 GOOS=solaris go install --tags=osusergo

... it builds now.

Updates #24841
Updates #24845

Change-Id: I49f40532bc2a13a9d282771592fc8d7f116b1902
Reviewed-on: https://go-review.googlesource.com/107304
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
@golang golang locked and limited conversation to collaborators Apr 16, 2019
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

4 participants