Closed damienmg closed 8 years ago
@damienmg I've started to investigate this issue.
There is another failure in OSX. http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/39/console
It looks to be this bug in ld(1). Unfortunately I cannot reproduce the issue in El Capitan with XCode 7.3.
BTW, what is the version of OSX and XCode in the CI environment?
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
Thank you, @damienmg
For the failure on OSX, three possible workarounds come to my mind. Which one do you prefer?
/usr/bin
to $PATH
osx_cc_wrapper.sh
Let me explain more background behind the three workarounds.
In my El Capitan environment, gcc is newer than the CI environment. So we can expect the bug is fixed in the newer XCode.
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-264.3.101
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 7.3.0
As discussed in the bug report for ld(1)
, we need to stop passing -s
flag to gcc as a workaround if we keep using the XCode vesion in the CI environment.
Usually we could do it by removing -s
flag from go tool link
(cmd/link/internal/ld/lib.go#L1071).
On the other hand, go tool link
without -s
expects that dsymutil
is available on $PATH
(cmd/link/internal/ld/lib.go#L1243). So /usr/bin
must be listed in $PATH
.
-s
flag in osx_cc_wrapper.sh
depending on the version of ld
. This solution can avoid the potential similar issue in cc_binary
.osx_cc_wrapper.sh should not change the argument. Add /usr/bin
to $PATH
for this precise action seems ok to me (updating xcode would not fix the underlying bug)
@damienmg Could you take a look at #13?
I reproduced the issue on Ubuntu 15.04 (GNU ld
2.25) and on Mac OS X (XCode 7.1 and 7.2). Then I confirmed that #13 fixed the issue.
fyi the build is blue again \o/ Thanks!
Thank you for your help!
See http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=ubuntu_15.10-x86_64/39/console
This is after merging #10
/cc @yugui