Skip to content

Commit

Permalink
Work around an OSX xcode ld error temporarily
Browse files Browse the repository at this point in the history
Can remove once upstream fixes
  • Loading branch information
smarterclayton committed Apr 21, 2017
1 parent 1719327 commit 031cbe4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,17 @@ os::build::internal::build_binaries() {
local platform_gotags_envvar=OS_GOFLAGS_TAGS_$(echo ${platform} | tr '[:lower:]/' '[:upper:]_')
local platform_gotags_test_envvar=OS_GOFLAGS_TAGS_TEST_$(echo ${platform} | tr '[:lower:]/' '[:upper:]_')

# work around https://github.com/golang/go/issues/11887
local local_ldflags="${version_ldflags}"
if [[ "${platform}" == "darwin/amd64" ]]; then
local_ldflags+=" -s"
fi

if [[ ${#nonstatics[@]} -gt 0 ]]; then
GOOS=${platform%/*} GOARCH=${platform##*/} go install \
-pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" \
-tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \
-ldflags "${version_ldflags}" \
-ldflags="${local_ldflags}" \
"${goflags[@]:+${goflags[@]}}" \
"${nonstatics[@]}"

Expand All @@ -240,7 +246,7 @@ os::build::internal::build_binaries() {
CGO_ENABLED="${OS_TEST_CGO_ENABLED:-}" GOOS=${platform%/*} GOARCH=${platform##*/} go test \
-pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" \
-tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_test_envvar:-}" \
-ldflags "${version_ldflags}" \
-ldflags "${local_ldflags}" \
-i -c -o "${outfile}" \
"${goflags[@]:+${goflags[@]}}" \
"$(dirname ${test})"
Expand Down

0 comments on commit 031cbe4

Please sign in to comment.