Bazel for Apple Weekly Issue #3
Welcome to the third 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
- Liu Liu wrote a blog post about using Bazel for distributing open-source C/C++ libraries.
My main knowledge comes from Buck dating 8 years back. At that time, it never occurred to me such a build system could eventually be a library distribution mechanism. During the same 8 years, NPM has taken over the world. New language-dependent package managers such as Go module, Cargo and Swift Package Manager popularized the concept of using the public repositories (GitHub) as the dependency references. Languages prior to this period, mainly C/C++ are moving to this direction, slowly.
The choice of Bazel is not accidental. I’ve been doing some Swift development with Bazel and the experience has been positive. Moreover, the choice of high-level binding language for
nnc
, I figured, would be Swift.
-
Keith Smiley wrote an answer about how Bazel handles header files differently from Xcode. This knowledge might seem obvious to someone who is familiar with Bazel, but the lack of publicly searchable information is still making it somewhat a roadblock to new teams looking to evaluate Bazel for building their Obj-C projects.
-
Two talks about Bazel for Apple platforms were given at iOSDC 2020 – a local iOS conference in Japan: Two birds with one stone: Modularization, faster build times (Japanese) by Saryong Kang; and Micro Modular Architecture with Bazel by Ryo Aoyama.
Commits
- Thomas Van Lenten added a feature flag named “swift.generate_from_raw_proto_files” to enable generation from raw proto sources.
If enabled, the toolchain will directly generate from the raw proto files and not from the DescriptorSets.
The DescriptorSets ProtoInfo exposes don’t have source info, so comments in the .proto files don’t get carried over to the generated Swift sources as documentation comments. https://github.com/bazelbuild/bazel/issues/9337 is open to attempt to get that, but this provides a way to opt into forcing it.
This does come with a minor risk for cross repository and/or generated proto files where the protoc command line might not be crafted correctly, so it remains opt in.
- Kayla McArthur submitted a change that added support App Clips to rules, based on a pull request submitted by Brentley Jones a while ago. At the time of writing, it hasn’t been merged into the community-maintained branch yet, but if you have an app clip that you’d like to deliver soon, you can apply the patch to your rules_apple repositoty.
This change adds a new ios_app_clip rule, and enables embedding app clips in ios_application rules through a new app_clips property.