Skip to content

go1.11.1 darwin build error #6

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

Closed
graphaelli opened this issue Oct 30, 2018 · 4 comments · Fixed by #7
Closed

go1.11.1 darwin build error #6

graphaelli opened this issue Oct 30, 2018 · 4 comments · Fixed by #7

Comments

@graphaelli
Copy link
Member

graphaelli commented Oct 30, 2018

Darwin builds on the new go1.11 images fail with:

go build -o build/golang-crossbuild/apm-server-darwin-amd64 -ldflags -X github.com/elastic/apm-server/vendor/github.com/elastic/beats/libbeat/version.buildTime=2018-10-30T15:40:45Z -X github.com/elastic/apm-server/vendor/github.com/elastic/beats/libbeat/version.commit=9ba6608fa4bf37ab47d6eeee991d2c442989282b
# crypto/x509
osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target

Docker has already been through this here: docker/golang-cross#11 - go1.11+ requires macOS 10.10+ now. An update to just OSX_VERSION_MIN=10.10 reveals that the SDK used here doesn't include the headers needed to build crypto/x509. This patch resolves that issue:

diff --git a/go1.11/darwin/Dockerfile b/go1.11/darwin/Dockerfile
index 80793a1..95d3a1a 100644
--- a/go1.11/darwin/Dockerfile
+++ b/go1.11/darwin/Dockerfile
@@ -8,12 +8,12 @@ RUN \
         llvm \
     && rm -rf /var/lib/apt/lists/*
 
-ARG OSXCROSS_SDK_URL=https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.11.sdk.tar.xz
+ARG OSXCROSS_SDK_URL=https://s3.dockerproject.org/darwin/v2/MacOSX10.10.sdk.tar.xz
 ARG OSXCROSS_PATH=/usr/osxcross
 ARG OSXCROSS_REV=3034f7149716d815bc473d0a7b35d17e4cf175aa
-ARG SDK_VERSION=10.11
+ARG SDK_VERSION=10.10
 ARG DARWIN_VERSION=15
-ARG OSX_VERSION_MIN=10.6
+ARG OSX_VERSION_MIN=10.10
 
 RUN \
     mkdir -p /tmp/osxcross && cd /tmp/osxcross \

Though it uses the dockerproject packaged SDK.

Note that part 3 of their issues does not affect golang-crossbuild users currently (apm-server and beats).

@graphaelli
Copy link
Member Author

@andrewkroh Thoughts on how to proceed? Should we package the SDK ourselves?

@vjsamuel
Copy link

vjsamuel commented Nov 2, 2018

is there an update on this?

@graphaelli
Copy link
Member Author

I should have a pull request up shortly.

@andrewkroh
Copy link
Member

The new images are live. I did a quick test of building Filebeat under 1.11.1 for darwin and it worked.

v1v added a commit that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants