Bazel for Apple Weekly

Subscribe
Archives
September 7, 2020

Bazel for Apple Weekly Issue #2

Welcome to the second issue of Bazel for Apple Weekly, a weekly newsletter covering news and developments in Bazel for Apple platforms, and related projects. Bazel for Apple Weekly is brought to you by Thi Doãn. Subscribe to future issues at bazelappleweekly.email and pass it on to anyone else you think may be interested. Please send any tips or feedback to bazelappleweekly@thi.im, or @bazelapplewkly or @thi_dt on Twitter.

News

Bazel 3.5 has been released. This release includes the following important changes to Apple platforms:

  • Tony Allevato merged a commit that extends --apple_bitcode to take an optional platform and allow multiple occurrences.

    This change changes --apple_bitcode in a backward-compatible way to accept --apple_bitcode=[platform=]mode, where platform is ios, macos, tvos, or watchos. If a platform is specified, the given Bitcode mode will be applied specifically to that platform; if omitted, the option behaves as before, applying the Bitcode mode to all platforms. The option can be listed multiple times, with later ones winning, so a default can be set for all platforms and then overridden for specific ones.

    This new format can be useful, for example, when building watchOS apps that must be distributed with Bitcode but where you do not want to build the companion iOS app with it enabled. To achieve this, pass --apple_bitcode=watchos=embedded to your build invocation.

  • Keith Smiley merged a commit that added oso_prefix_is_pwd macOS feature

    With Xcode 11 Apple's linker introduced a new oso_prefix option which removes the given prefix from the path in debug info. This improves the goal of producing reproducible builds. More info: https://milen.me/writings/apple-linker-ld64-deterministic-builds-oso-prefix

  • NS_BLOCK_ASSERTIONS is now passed for all Apple architectures. You can now go clean this up from your .bazelrc and BUILD files.

Commits

  • Dan Fleming merged a commit that adds support for substitution of PRODUCT_BUNDLE_PACKAGE_TYPE in Info.plist. This makes Info.plists coming from Xcode comes closer to work out-of-the-box in Bazel.

  • Thi Doãn merged a commit that adds support for packaging symbols files in the .ipa file for submitting to the App Store.

    Xcode's export action for App Store has an option "Upload your app’s symbols to receive symbolicated reports from Apple" that: Allows Apple to symbolicate crash logs and provide other diagnostic information. The symbol information is extracted from the debugging symbols (dSYM files) including in the archive, and is limited to function and methods (including inline functions), names and paths of source code files (for navigation), and line number information (for navigation).

    This adds a new define named apple.package_symbols that supports the same functionality. When you build your app with --apple_generate_dsym and --define=apple.package_symbols=(yes|true|1), .symbols files will be generated and packaged within the final .ipa file.

  • David MacLachlan merged a commit that adds support to crosstool for darwin_arm64(e).

    This adds support for darwin_arm64(e) to the crosstool.

    $ bazel build examples/cpp:hello-world --cpu=darwin_arm64 --xcode_version=12

    should function on both an Intel and arm64 Mac. Note that Bazel still runs in emulation on arm64 Mac until we have an arm64 darwin JDK.

  • Linkmap generation feature now works properly. The --objc_generate_linkmap flag has been there for since a long time ago but didn't work with Bazel due to a missing piece in the (open source) Apple CROSSTOOL.

    This adds generate_linkmap feature to Apple CROSSTOOL. To generate a link map, add the --objc_generate_linkmap flag to a bazel build. By default, only the top level linkmap file is built. If you want the linkmap file of the top level target dependencies, add the --output_groups=+linkmaps flag.

  • Wenyu Zhang proposes a change that would allow Xcode DottedVersion to ignore commentive versions like 10.10.experimental. This is extremely useful if you build a custom build of Xcode internally :)

Don't miss what's next. Subscribe to Bazel for Apple Weekly:
Powered by Buttondown, the easiest way to start and grow your newsletter.