Xcode version must be specified to use an Apple CROSSTOOL

人盡茶涼 提交于 2019-12-02 15:10:20
user8686787
bazel clean --expunge 
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
bazel clean --expunge 
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

It looks like xcode_configure isn't properly identifying that you have xcode installed. This can sometimes happen if you install xcode but have not yet fully opened it (it may ask you to agree to Terms and Conditions before being fully functional). If this is the problem, you'll need to bazel clean --expunge again after that...

If this doesn't help, you can get some debug information to identify what's gone wrong, by invoking (after a failed build):

cat $(bazel info output_base)/external/local_config_xcode/BUILD

This should contain some comments pertaining to failures in finding your installed xcodes.

Had the same problem, and since I am using a beta version of XCode, I had to find the installation in /Downloads/Xcode-beta.app instead.

Incidentally, the solution for me was to open XCode, go to Preferences, and select the Locations tab. The Command Line Tools drop-down was blank, and I had to press it and select a version (Xcode 9.0 in my case). I then ran bazel clean --expunge and repeated the build process without getting the error. Hope this helps someone.

For me it was a licensing issue for xcodebuild. After running bazel clean --expunge I've tried to run again bazel and I've got the instruction to run sudo xcodebuild -license. I have executed, accepted the license terms, run again bazel clean --expunge and everything has started to work again. Hopefully it solves some of the cases.

In order to build objc, Bazel requires that you specify an xcode version - this is usually done automatically by xcode_configure. If that's not working, you can manually specify the xcode version on the command line using the --xcode_version flag.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!