-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Xcode and Command Line Developer Tools on macOS #5178
Comments
In addition, if the Xcode is not installed, Bazel could work well. A same issue occurred before, and I just uninstalled the Xcode, and then it could work. |
Are you using VSCode by any chance? |
@sergiocampama Yeap. Anything to do with it? |
Check out #4603, it has a long discussion on how VSCode messes up with the workspace. Try running expunge and build after closing VSCode |
@sergiocampama Really?! Unbelievable…Thanks for your notification. I'll try it tomorrow and feedback to you. |
Hi @sergiocampama I've closed the VSCode, cleaned up the project and tried to build with Bazel, but unfortunately, it failed too with the same error. |
@sergiocampama should this be moved to https://github.com/bazelbuild/rules_apple/issues? |
@dslomov The xcode locator functionality is provided to rules_apple by bazel. Furthermore, the xcode locator functionality is also depended upon from the C++ rules so they work on macOS. This issue belongs in bazel, not rules_apple. |
Update: This issue still exists in the the latest released version 0.13.1. |
Is this still an issue? |
@jin No idea. I've moved to new project. |
I've just hit this on a fresh Bazel clone (bc5a9b1): ~/Desktop
➜ Desktop git clone git@github.com:bazelbuild/bazel.git
Cloning into 'bazel'...
remote: Enumerating objects: 157, done.
remote: Counting objects: 100% (157/157), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 408534 (delta 61), reused 114 (delta 48), pack-reused 408377
Receiving objects: 100% (408534/408534), 651.51 MiB | 57.78 MiB/s, done.
Resolving deltas: 100% (248658/248658), done.
Checking out files: 100% (11232/11232), done.
➜ Desktop cd bazel
➜ bazel git:(master) bazel build //src:bazel
Starting local Bazel server and connecting to it...
DEBUG: /private/var/tmp/_bazel_azinnatullin/28ee7600c34548f30dad58754d5eebde/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1804_java11 not using checked in configs as detect_java_home was set to True
DEBUG: /private/var/tmp/_bazel_azinnatullin/28ee7600c34548f30dad58754d5eebde/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1604_java8 not using checked in configs as detect_java_home was set to True
ERROR: /private/var/tmp/_bazel_azinnatullin/28ee7600c34548f30dad58754d5eebde/external/local_config_cc/BUILD:62:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-armeabi-v7a: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, verify that "xcode-select -p" is correct and then try: "bazel shutdown" to re-run Xcode configuration
INFO: Call stack for the definition of repository 'remotejdk11_macos' which is a http_archive (rule definition at /private/var/tmp/_bazel_azinnatullin/28ee7600c34548f30dad58754d5eebde/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
- /DEFAULT.WORKSPACE.SUFFIX:219:1
INFO: Call stack for the definition of repository 'remote_java_tools_darwin' which is a http_archive (rule definition at /private/var/tmp/_bazel_azinnatullin/28ee7600c34548f30dad58754d5eebde/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
- /DEFAULT.WORKSPACE.SUFFIX:255:1
ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-armeabi-v7a' failed; build aborted
INFO: Elapsed time: 5.700s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (160 packages loaded, 2040 targets configured) Environment:
I can confirm that I haven't run I was able to fix it after some googling: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
bazel shutdown
bazel build //src:bazel It seems that Bazel should be more resistant to system environment like this or this Xcode quirk should be reflected on the Setting up your coding environment page :) |
This is very easy to reproduce for me:
|
I've submitted a fix for this #8975 |
Best case scenario, the docs are wrong to instruct users to install command line tools and not full Xcode. Can we get the above PR merged? |
Actually, I wonder if bazel 1.1.0 fixes this. |
Is there a specific change you would have expected to fix this? I haven't seen anything related go in |
I was thinking this change. Seems to work on my machine, but once I got 1.1.0 working, I could no longer repro with 0.28.1, so I'm not sure what's really going on. |
For those who get to this issue via googling: there is a SO answer that solved the issue for me: https://stackoverflow.com/a/46460129 |
Description of the problem / feature request:
As you know,
xcode-select
is used to select the developer directory on macOS. Both Xcode and Command Line Developer Tools are installed in my Mac. Due to the reason that the compiler Xcode provides seems not to support the OpenMP, I need to switch to the Command Line Developer Tools. I've executed the commandsudo xcode-select -s /Library/Developer/CommandLineTools
, but when I build with Bazel, it still told me thatXcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
. And of course, I've cleaned the workspace and rerun the command, but it was useless.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Terminal.app
, executesudo xcode-select -s /Library/Developer/CommandLineTools
to switch back to the Command Line Developer Tools.What operating system are you running Bazel on?
macOS High Sierra 10.13.4
What's the output of
bazel info release
?release 0.12.0-homebrew
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Private branch of TensorFlow.
Have you found anything relevant by searching the web?
Nope.
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: