rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

bazel iOS tutorial does not work on MacOS Catalina or BigSur

Open diffent opened this issue 3 years ago • 4 comments

Description of the problem / feature request:

these instructions no longer work to yield a running app:

https://docs.bazel.build/versions/main/tutorial/ios-app.html

Feature requests: what underlying problem are you trying to solve with this feature?

build the bazel iOS example

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

follow the instructions, and you will get this error:

ERROR: /private/var/tmp/_bazel_bk/bddad700865f223ab3aef29c1bb6d4fa/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_x86_64' ERROR: Analysis of target '//ios-app:ios-app' failed; build aborted: Analysis failed

What operating system are you running Bazel on?

macOS Catalina and Big Sur

What's the output of bazel info release?

release 3.2.0 also get similar errors when running with 4.0.0 bazel

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

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

N/A, installed pre-built bazel

Have you found anything relevant by searching the web?

there are many notes online about "does not contain a toolchain" but none of the suggestions fixed the problem. it seems to be a common problem. maybe you should include something in FAQs for this?

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

in particular, this command in the example fails:

bazel build //ios-app:ios-app

diffent avatar Sep 14 '21 18:09 diffent

I'm moving this issue to https://github.com/bazelbuild/rules_apple, because I think they're handling this now.

philwo avatar Sep 21 '21 20:09 philwo

Do you have a full Xcode installation installed? What's the output of xcodebuild -version?

keith avatar Oct 26 '21 20:10 keith

thanks for the response,

we have tried setting up xcode 12.5.1 and xcode 12.2

we are doing other iOS development with xcode, so we have full installations of xcode and are able to build other apps

looking back at my orig posting, it seems that the string 'ios_x86_64' is related to a simulator build for the intel mac, not a device build. maybe you guys are using M1 macs and dont see the x86_64 error because of that? (e.g. m1 mac is not x86_64). we do typically make simulator builds for other apps though.

diffent avatar Oct 27 '21 16:10 diffent

Most folks are using intel. Do you still see this?

keith avatar Oct 27 '21 16:10 keith

Should be fixed with newer xcode / bazel

keith avatar Nov 28 '22 21:11 keith