bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Can't build iOS samples

Open adamhowardprice opened this issue 11 years ago • 5 comments

Similar to the "Can't build Android samples" issue below, I also can't build the iOS samples.

Because Bazel seems to default to iOS 8.4, I've set my xcode-select to point to Xcode 6.4. Seems like a problem with ibtoolwrapper.

~/C/b/tutorial (master) $ bazel build //ios-app:ios-app --verbose_failures
INFO: Found 1 target...
INFO: From XibCompile ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip:
bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper: line 28: tools/objc/realpath: No such file or directory
ERROR: /Users/adamprice/Code/bazel-examples/tutorial/ios-app/BUILD:21:1: null failed: ibtoolwrapper failed: error executing command
  (cd /private/var/tmp/_bazel_adamprice/21b179d205602a13b4b1f26a06265bc0/tutorial && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=8.4 \
  bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper bazel-out/local_darwin-fastbuild/bin/ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip UrlGetViewController.nib --minimum-deployment-target 7.0 --module ios-app --target-device iphone ios-app/UrlGet/UrlGetViewController.xib): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127: ibtoolwrapper failed: error executing command
  (cd /private/var/tmp/_bazel_adamprice/21b179d205602a13b4b1f26a06265bc0/tutorial && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=8.4 \
  bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper bazel-out/local_darwin-fastbuild/bin/ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip UrlGetViewController.nib --minimum-deployment-target 7.0 --module ios-app --target-device iphone ios-app/UrlGet/UrlGetViewController.xib): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
Target //ios-app:ios-app failed to build

Same issue when I sudo xcode-select -s /Applications/Xcode-7.0.app/Contents/Developer and run bazel build //ios-app:ios-app --verbose_failures --ios_sdk_version=9.0

INFO: Found 1 target...
INFO: From XibCompile ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip:
bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper: line 28: tools/objc/realpath: No such file or directory
ERROR: /Users/adamprice/Code/bazel-examples/tutorial/ios-app/BUILD:21:1: null failed: ibtoolwrapper failed: error executing command
  (cd /private/var/tmp/_bazel_adamprice/21b179d205602a13b4b1f26a06265bc0/tutorial && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=9.0 \
  bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper bazel-out/local_darwin-fastbuild/bin/ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip UrlGetViewController.nib --minimum-deployment-target 7.0 --module ios-app --target-device iphone ios-app/UrlGet/UrlGetViewController.xib): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127: ibtoolwrapper failed: error executing command
  (cd /private/var/tmp/_bazel_adamprice/21b179d205602a13b4b1f26a06265bc0/tutorial && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=9.0 \
  bazel-out/host/bin/external/bazel_tools/tools/objc/ibtoolwrapper bazel-out/local_darwin-fastbuild/bin/ios-app/ios-app/ios-app/UrlGet/UrlGetViewController.nib.zip UrlGetViewController.nib --minimum-deployment-target 7.0 --module ios-app --target-device iphone ios-app/UrlGet/UrlGetViewController.xib): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
Target //ios-app:ios-app failed to build
INFO: Elapsed time: 0.552s, Critical Path: 0.04s

adamhowardprice avatar Oct 26 '15 20:10 adamhowardprice

Looks like the tools/objc/realpath tool is missing. We recently reworked our directory structure for tools -- this isn't being mapped correctly here. I'm investigating a fix.

c-parsons avatar Oct 27 '15 00:10 c-parsons

Looking forward to trying out Bazel for iOS once I get this part working.

I tried rolling back Bazel to one commit before https://github.com/bazelbuild/bazel/commit/c74ee3784d3fd3a722f92c39805e57b4353a4509 since it seemed like that might be the commit which changed the tools structure, but I strangely got the same error. Any suggestion for workarounds or another commit to roll back to?

adamhowardprice avatar Oct 28 '15 19:10 adamhowardprice

I've rolled back to b918e1cec08b2e4f8378e51d8096fe19c6a15013 which seems to work.

trevorgray avatar Oct 28 '15 19:10 trevorgray

@trevorgray :+1:

adamhowardprice avatar Oct 28 '15 19:10 adamhowardprice

This issue was resolved by https://github.com/bazelbuild/bazel/commit/bb23793da2ff3a0ea5a1ffb8444a626af15162c7

Thanks @c-parsons !

adamhowardprice avatar Oct 29 '15 15:10 adamhowardprice