-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
crypto/x509: contradictory Mac OS X version requirements #17732
Comments
That build constraint may be wrong. I can remove it and see if things pass on the builders. But we have no intention of making 10.7 supported again. We don't run builders for it. There's even talk of dropping 10.8 support (https://groups.google.com/d/msg/golang-dev/5DMm7lBDAqY/hlTg3cQUBwAJ) and making 10.9 the minimum requirement. You're of course welcome to carry your own patches, but having a giant testing matrix has a real cost and/or slows down the project, so we have to unsupported platforms over time, especially as Apple drops support as well. |
CL https://golang.org/cl/32580 mentions this issue. |
@AxbB36, does changing |
@bradfitz, yes, |
Go 1.7 has a necessary fix for macOS Sierra that is not in Go 1.6.3 or earlier: golang/go@2da5633 meek was unstable on macOS Sierra when compiled with Go 1.4.3 or 1.6.3. Reported by tordevSZ0: https://bugs.torproject.org/20250. We need to use the Mac OS X 10.7 SDK (not 10.6) to build Go 1.7 and later: https://bugs.torproject.org/20023#comment:6 We add -std=gnu99 to CFLAGS when building Go. A piece of new C code uses c99 features. Other code uses "asm", which requires gnu99. https://bugs.torproject.org/20023#comment:6 https://trac.macports.org/ticket/52506 We hack one of the source files with sed to remove -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060, which otherwise causes the build to fail, thinking a couple of functions are unavailable. golang/go#17732
Go 1.7 has a necessary fix for macOS Sierra that is not in Go 1.6.3 or earlier: golang/go@2da5633 meek was unstable on macOS Sierra when compiled with Go 1.4.3 or 1.6.3. Reported by tordevSZ0: https://bugs.torproject.org/20250. We need to use the Mac OS X 10.7 SDK (not 10.6) to build Go 1.7 and later: https://bugs.torproject.org/20023#comment:6 We add -std=gnu99 to CFLAGS when building Go. A piece of new C code uses c99 features. Other code uses "asm", which requires gnu99. https://bugs.torproject.org/20023#comment:6 https://trac.macports.org/ticket/52506 We hack one of the source files with sed to remove -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060, which otherwise causes the build to fail, thinking a couple of functions are unavailable. golang/go#17732
Go 1.7 has a necessary fix for macOS Sierra that is not in Go 1.6.3 or earlier: golang/go@2da5633 meek was unstable on macOS Sierra when compiled with Go 1.4.3 or 1.6.3. Reported by tordevSZ0: https://bugs.torproject.org/20250. We need to use the Mac OS X 10.7 SDK (not 10.6) to build Go 1.7 and later: https://bugs.torproject.org/20023#comment:6 We add -std=gnu99 to CFLAGS when building Go. A piece of new C code uses c99 features. Other code uses "asm", which requires gnu99. https://bugs.torproject.org/20023#comment:6 https://trac.macports.org/ticket/52506 We hack one of the source files with sed to remove -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060, which otherwise causes the build to fail, thinking a couple of functions are unavailable. golang/go#17732
What version of Go are you using (
go version
)?Trying to compile go1.7.3 using go1.4.3 as bootstrap.
What operating system and processor architecture are you using (
go env
)?Running on linux/386 but compiling for darwin/386.
What did you do?
What did you expect to see?
What did you see instead?
A little background: this came up while trying to cross-compile Go 1.7.3 from Debian wheezy to Mac, as part of the deterministic build process of Tor Browser: https://bugs.torproject.org/20023#comment:8. We previously were using Go 1.6.3, built against the Mac OS X 10.6 SDK. Because Go 1.7.3 now uses some SDK 10.7+ functions, we started building against this copy of the 10.7 SDK. We need the Go upgrade because Go 1.7 has some fixes for macOS Sierra that aren't in Go 1.6.3.
I'm aware that Mac OS X 10.7 isn't a supported platform (per #16625 (comment), which has the same error message as this ticket). But a tiny change to the source code makes this build work for me. root_cgo_darwin.go has the CFLAGS build constraint:
If I just delete the
-D__MAC_OS_X_VERSION_MAX_ALLOWED=1060
part, then the build succeeds for me.As written, the build constraint doesn't seem to make sense.
-mmacosx-version-min=10.6
means "≥10.6", and-D__MAC_OS_X_VERSION_MAX_ALLOWED=1060
means "≤10.6", the intersection of which is just "10.6". That can't be what's intended. Maybe the author meant-D__MAC_OS_X_VERSION_MIN_REQUIRED=1060
instead? But even that can't be right, because the functions used in root_cgo_darwin.go, SecCertificateCopyNormalizedIssuerContent and SecCertificateCopyNormalizedSubjectContent, are documented to be "macOS 10.7+".The root_cgo_darwin.go code that uses these functions first appeared in Go 1.7: #14514, https://golang.org/cl/20351.
The error message
error: '<identifier>' is unavailable
comes from macro annotations that interact withMAC_OS_X_VERSION_MIN_REQUIRED
andMAC_OS_X_VERSION_MAX_ALLOWED
. For example, SecCertificateCopyNormalizedIssuerContent is annotated__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA)
. I don't know why the build doesn't fail when building natively with an 10.7+ SDK; maybe the the__MAC_OS_X_VERSION_MAX_ALLOWED
gets overridden somehow.A MacPorts ticket ran into the same issue:
My main questions on this issue are:
-D__MAC_OS_X_VERSION_MAX_ALLOWED=1060
safe?The text was updated successfully, but these errors were encountered: