Skip to content

go1.11.1 darwin build error #6

Closed
@graphaelli

Description

@graphaelli

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions