buchgr@buchgr0:~/Code$ git clone [email protected]:bazelbuild/bazel.git
Cloning into 'bazel'...
Enter passphrase for key '/usr/local/google/home/buchgr/.ssh/id_rsa':
remote: Counting objects: 186522, done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 186522 (delta 219), reused 483 (delta 207), pack-reused 185894
Receiving objects: 100% (186522/186522), 365.36 MiB | 19.85 MiB/s, done.
Resolving deltas: 100% (114132/114132), done.
buchgr@buchgr0:~/Code$ cd bazel
buchgr@buchgr0:~/Code/bazel$ bazel version
.
Build label: 0.5.1
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 6 10:34:11 2017 (1496745251)
Build timestamp: 1496745251
Build timestamp as int: 1496745251
buchgr@buchgr0:~/Code/bazel$ bazel build //src:bazel
ERROR: No toolchain found for cpu 'k8'. Valid cpus are: [
piii,
armeabi-v7a,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
].
INFO: Elapsed time: 1.466s
buchgr@buchgr0:~/Code/bazel$ bazel clean --expunge
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
buchgr@buchgr0:~/Code/bazel$ bazel build //src:bazel
...........
ERROR: No toolchain found for cpu 'k8'. Valid cpus are: [
piii,
armeabi-v7a,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
].
INFO: Elapsed time: 1.683s
buchgr@buchgr0:~/Code/bazel$ bazel clean
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
buchgr@buchgr0:~/Code/bazel$ bazel shutdown
buchgr@buchgr0:~/Code/bazel$ bazel clean --expunge
...........
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
buchgr@buchgr0:~/Code/bazel$ bazel build //src:bazel
...........
ERROR: No toolchain found for cpu 'k8'. Valid cpus are: [
piii,
armeabi-v7a,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
].
INFO: Elapsed time: 1.575s
buchgr@buchgr0:~/Code/bazel$
buchgr@buchgr0:~$ cat .blazerc
common --show_progress_rate_limit=0.2
build --experimental_ui --experimental_ui_actions_shown 7
build --experimental_skyframe_target_pattern_evaluator
build --nostamp
I have first encountered this problem with bazel 0.5.1.
cc: @mhlopko
Update:
I happens to me in any project with a WORKSPACE file, not just bazel. Also machine reboot didn't help. I can't use bazel atm.
`
buchgr@buchgr0:~/Code/bazel$ uname -a
Linux <CONFIDENTIAL_HOSTNAME> 4.4.0-78-generic #99~14.04.2-Ubuntu SMP Thu Apr 27 18:49:46 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Can you reproduce?
Yes. Always. 100%
After deleting ./cache/bazel/_bazel_$USER/folders the bug is gone.
Closing, let's reopen when we have a repro.
@mhlopko
I was able to reproduce this on OSX, when attempting to cross compile with rules_go.
The issue was me not having a full Xcode installation, only the Command Line Tools. Even after installing full Xcode I kept getting this error until I deleted my entire /private/var/tmp/_bazel_$USER folder, after which it worked fine.
This was with Bazel 0.5.4 & OSX 10.12.6
I'm surprised that Xcode is needed to cross-compile go. AFAIK command line tools are enough to compile C++, and I would assume the same applies to go. Do you have logs so I can check the errors produced?
Tried to reproduce for you but looks like the issue isn't directly related to Xcode?
I tried deleting the bazel cache, and rebuilding alone, still had No toolchain found, installed Xcode, No toolchain found, deleted bazel cache again and the build has been working since.
Even after uninstalling Xcode and re-deleting the Bazel cache it still appears to be fine, and k8 is valid.
Strange
I am still having this problem. macOS Sierra. removing /private/var/tmp/_bazel_$USER didn't help.
$ bazel version
Build label: 0.7.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: Thu Oct 19 09:12:48 2017 (1508404368)
Build timestamp: 1508404368
Build timestamp as int: 1508404368
Project: github.com/istio/pilot
ERROR: No toolchain found for cpu 'k8'. Valid cpus are: [
darwin,
armeabi-v7a,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
].
I'm having the same issue on darwin, but I get an error like
ERROR: No default_toolchain found for cpu 'darwin'. Valid cpus are: [
k8,
local,
armeabi-v7a,
x64_windows,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
]
Darwin isn't even in the list of supported "CPUs"...
@TravisWhitaker this issue is quite old, do you mind opening a new one with more information about what you were trying to do?
Sure thing. https://github.com/bazelbuild/bazel/issues/5764
Using newest tensorflow and newest bazel, it help , the bug is avoid .
Most helpful comment
After deleting
./cache/bazel/_bazel_$USER/folders the bug is gone.