Skip to content
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

Cannot build cpp-tutorial on Apple M1 #13813

Closed
markub3327 opened this issue Aug 7, 2021 · 5 comments
Closed

Cannot build cpp-tutorial on Apple M1 #13813

markub3327 opened this issue Aug 7, 2021 · 5 comments

Comments

@markub3327
Copy link

markub3327 commented Aug 7, 2021

Description of the problem / feature request:

Cannot build a cpp examples on Apple M1. I used bazel installed by Homebrew.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

brew install --verbose bazel
git clone https://github.com/bazelbuild/examples
bazel build //main:hello-world

What operating system are you running Bazel on?

macOS Big Sur, Apple M1

What's the output of bazel info release?

release 4.1.0-homebrew

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

brew install --verbose bazel

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

https://github.com/bazelbuild/examples

master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

3e093df7456063405940ccc1b46c20fec7d0f50d

Have you found anything relevant by searching the web?

No. I tried to find about it on Google.

Any other information, logs, or outputs that you want to share?

(base) martin@MacBook-Pro-uzivatela-Martin cpp-tutorial % cd stage1
(base) martin@MacBook-Pro-uzivatela-Martin stage1 % bazel build //main:hello-world
Starting local Bazel server and connecting to it...
ERROR: /Users/martin/Documents/Projects/examples/cpp-tutorial/stage1/main/BUILD:3:10: Target '//main:hello-world' depends on toolchain '@local_config_cc//:cc-compiler-darwin_arm64', which cannot be found: no such target '@local_config_cc//:cc-compiler-darwin_arm64': target 'cc-compiler-darwin_arm64' not declared in package '' defined by /private/var/tmp/_bazel_martin/87f9b5f820611b786152809f671f6e02/external/local_config_cc/BUILD'
ERROR: Analysis of target '//main:hello-world' failed; build aborted: Analysis failed
INFO: Elapsed time: 14,148s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 19 targets configured)
@markub3327
Copy link
Author

markub3327 commented Aug 7, 2021

Before running bazel build //main:hello-world I tried export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 and it's working. But I don't know is it a suitable solution. On the other projects it's not working!!!!

@keith
Copy link
Member

keith commented Aug 8, 2021

Do you have Xcode installed fully? Or just the command line tools? If it's the latter this is fixed in 4.2.0 which should be released soon. You can try it with one of the latest release candidate builds to verify https://releases.bazel.build/4.2.0/rc3/index.html

I cannot repro this on my M1 machine with a full Xcode installation so I assume this is a duplicate of #13514

@markub3327
Copy link
Author

markub3327 commented Aug 9, 2021

Yes I have only Xcode CLI installed. Fully installed Xcode is not needed with bazel 4.2.0rc3 !!!

@keith
Copy link
Member

keith commented Aug 10, 2021

Great, sounds like we can close this then?

@markub3327
Copy link
Author

Yes, all is working. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants