bazel build fails after installing Xcode

Created on 2 Dec 2016  路  7Comments  路  Source: bazelbuild/bazel

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

Bazel was working great for me on Mac OS X Serra, but then I made the mistake of installing Xcode 8.1 instead of just the command line tools. Now I get

shimura:hol% bazel build ...
INFO: Found 2 targets...
ERROR: /Users/geoffreyi/deepmath/hol/BUILD:26:1: undeclared inclusion(s) in rule '//hol:trace':
this rule is missing dependency declarations for the following files included by 'hol/trace_main.cc':
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include/stdarg.h'
...

The issue happens with https://github.com/tensorflow/deepmath but not with https://github.com/tensorflow/tensorflow.

If possible, provide a minimal example to reproduce the problem:

I'm not sure how to reproduce this with installing Xcode, and the fact that it differs between deepmath and tensorflow means something subtle is happening.

If it matters, I installed Xcode 8.1 through the Managed Software Center, not via the normal App Store process.

Environment info

  • Operating System:

Mac OS X Sierra

  • Bazel version (output of bazel info release):

    shimura:hol% bazel info release
    release 0.4.0-homebrew

Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the [email protected] archive)

No.

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

Most helpful comment

I encountered this after an upgrade to Xcode 8.3. I fixed it by cleaning:

rm -rf /private/var/tmp/_bazel_kersson/*

All 7 comments

Upgrading to release 0.4.1-homebrew fixed the problem!

I'm on release 0.4.3 and I still get this inclusion issue. I'm seeing it when trying to run bazel run //src/tools/generate_workspace (on HEAD). Any ideas what the cause is here?

I encountered this after an upgrade to Xcode 8.3. I fixed it by cleaning:

rm -rf /private/var/tmp/_bazel_kersson/*

bazel clean --expunge should be easier

+1 I ran into this issue when I upgraded to Xcode 9 beta

I ran into this again, not sure what triggered it, but bazel clean --expunge did not fix it. I had to rm -rf like @kersson did.

Was this page helpful?
0 / 5 - 0 ratings