-
Notifications
You must be signed in to change notification settings - Fork 18k
os/user: doesn't work with musl libc #11319
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
Comments
At this point, let's wait for 1.6. |
I figured as much. |
CL https://golang.org/cl/13772 mentions this issue. |
I'm still hitting this issue with musl-1.1.12, and go-1.5.2, bootstrapping from go-1.4.3.
|
It'll be in Go 1.6. 1.5.x is only for critical things, not nice to haves. |
What @somasis is reporting looks like a separate issue to me. |
I should have said, I actually patched go-1.5.2 with the commit related to this issue, and still hit that error. |
@somasis Have you tried tip (latest development version)? |
@Thomasdezeeuw Yes, I get the same error.
|
I managed to get the latest git master to build with |
...which then fails to build programs such as syncthing, because of the exact same error. |
@somasis the compile errors you pasted are unrelated to this issue and are possibly a bug in cgo. If there isn't a similar issue already filed, you should file a new one. In fact, they may rely on another fix that was already applied to 1.6; you may as well try with the betas or with master first. |
Including patch to fix 386 build. golang/go#14476 Removed default-sc-getpw-r-size-max.patch, fixed upstream. golang/go#11319 Changed the offset for no-pic.patch to match new code. TT: pkgrel set to 1 as the original pkgrel=0 failed to build with x86 and was reverted.
Is this still an issue in Go 1.6? I'm hearing concerns about musl in Gentoo [1]. |
@williamh This issue is closed as fixed in 1.6. Please take any questions about it to a forum; see https://golang.org/wiki/Questions . Thanks. |
When building Go on Linux with musl instead of glibc, os/user doesn't work:
$ go test os/user
--- FAIL: TestCurrent (0.00s)
user_test.go:23: Current: user: unreasonable _SC_GETPW_R_SIZE_MAX of -1
--- FAIL: TestLookup (0.00s)
user_test.go:64: Current: user: unreasonable _SC_GETPW_R_SIZE_MAX of -1
--- FAIL: TestLookupId (0.00s)
user_test.go:82: Current: user: unreasonable _SC_GETPW_R_SIZE_MAX of -1
That's because Go assumes that on Linux, _SC_GETPW_R_SIZE_MAX will always be >0, which isn't true.
I have a fix for this ready. Is this something for Go 1.5, or should I wait till 1.6?
The text was updated successfully, but these errors were encountered: