bazel: Bazel 0.5.0 build fails on Mac OS X El Capitan
Description of the problem / feature request / question:
Bazel build fails on Mac OS X El Capitan (Version 10.11.6). The same build completes without any issue on Ubuntu 14.04. It looks like this is a mac specific issue.
Mac (build error):
$ bazel version
Build label: 0.5.0-homebrew
Build target: bazel-out/darwin_x86_64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri May 26 14:50:47 2017 (1495810247)
Build timestamp: 1495810247
Build timestamp as int: 1495810247
$
$
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.6
BuildVersion: 15G1510
$
$
$ bazel build --verbose_failures :all
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
File "/private/var/tmp/_bazel_user/6f6133ece88806ce1513398e26791cf1/external/bazel_tools/tools/cpp/cc_configure.bzl", line 829
_get_escaped_darwin_cxx_inc_directories(repository_ctx, cc)
File "/private/var/tmp/_bazel_user/6f6133ece88806ce1513398e26791cf1/external/bazel_tools/tools/cpp/cc_configure.bzl", line 726, in _get_escaped_darwin_cxx_inc_directories
for toolchain in toolchains: ...
type 'NoneType' is not iterable.
INFO: Elapsed time: 3.445s
Ubuntu (no error):
$ bazel version
Build label: 0.5.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri May 26 12:11:50 2017 (1495800710)
Build timestamp: 1495800710
Build timestamp as int: 1495800710
$
$
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
$
$
$ # I already ran the build, it succeeded without any issues
$ bazel build --verbose_failures :all
INFO: Found 1 target...
Target //:env up-to-date (nothing to build)
INFO: Elapsed time: 0.128s, Critical Path: 0.00s
If possible, provide a minimal example to reproduce the problem:
On a mac, the following produces the error
$ bazel build --verbose_failures :all
Environment info
-
Operating System: ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G1510
-
Bazel version (output of
bazel info release
): release 0.5.0-homebrew
Anything else, information or logs or outputs that would be helpful?
I’m trying to build the same project on both mac and ubuntu which is version controlled with git. So i’m confident that the two build sources are identical.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 53 (42 by maintainers)
Commits related to this issue
- bazel 0.5.0 Closes #13967. Signed-off-by: ilovezfs <ilovezfs@icloud.com> — committed to Homebrew/homebrew-core by ilovezfs 7 years ago
- Update documentation to address #3063 RELNOTES: None PiperOrigin-RevId: 157393208 — committed to bazelbuild/bazel by hlopko 7 years ago
- Polish the documentation addressing #3063 RELNOTES: None. PiperOrigin-RevId: 157401168 — committed to bazelbuild/bazel by hlopko 7 years ago
just for future people.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
could do the the trick if you install Xcode and bazel still failing.Just to be sure, also after
bazel clean --expunge
?Can you try to rebuild after
bazel clean --expunge
?I fixed this by running
sudo xcodebuild -license
and agreeing to the TOS.(Sadly, I then encountered
clang: error: unknown argument: '-fno-canonical-system-headers'
)I just had this problem on OSX 10.12.6 with bazel 0.5.4, and it was fixed by running
bazel clean --expunge
Hello folks. Indeed rolling back the apple crosstool changes would be a difficult task given the number of dependent changes that are in the release. I will quickly try to draft a patch change which will turn off apple crosstool if xcode is not present.
Sorry for the inconvenience.