-
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
cmd/go: errors when compiling for iOS simulator when using "crypto/x509" package #27343
Comments
Just noticed that #25944 was apparently fixed in golang/mobile@6621de0. It looks to be almost exactly the same as this issue, except that it involves |
Following on from Anthony's comments above, we just re-ran a CI pipeline that was previously successful and now fails with the error referenced above:
|
It looks to me like the -mmacosx-version-min=10.10 is coming from crypto/x509/root_cgo_darwin.go, which says:
Should the iOS builds be using -tags ios or something like that? It sure looks like that file is not meant for use with iOS. |
The min=10.6 is what you'd get with an old version of Go. This was changed in 11f6cb4. Same issue. The fix here seems to be just use -tags ios when building outside gomobile. |
Thanks @rsc ! This is what we ended up doing. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11 darwin/amd64
(also applies togo version go1.10.3 darwin/amd64
)Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?macOS High Sierra - 10.13.6
What did you do?
We've been building a shared library for macOS and iOS for several months now without issues, but recently our simulator build step began to fail. After several days of debugging and googling similar issues, I'm still at a loss.
Our workflow consists of building three separate binaries: one each for macOS, iOS (device), and iOS (simulator). We
lipo
the two iOS binaries to create a fat binary that can run on both platforms.We use
go build
with supplementary flags rather thangomobile
. Here's the command that now fails:❌ iOS (simulator)
For reference, here are the other two commands that work fine:
✅ iOS (device)
✅ macOS
What did you expect to see?
A successful compile.
What did you see instead?
Things I've tried, to no avail
crypto/x509: macOS -framework Security produces link warning #26073 (comment))
root_cgo_darwin.go
(referenced from here:crypto/x509: contradictory Mac OS X version requirements #17732 (comment))
clang
andclang++
as well as the ones found in/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I've seen similar issues (#25944, #24437, #17732, #26073) but some are either old and already addressed in the latest release of golang, or the proposed solutions did not work.
Completely stuck and banging my head - any ideas?
The text was updated successfully, but these errors were encountered: