Bazel for Apple Weekly Issue #4
Welcome to Bazel for Apple Weekly, a weekly casual newsletter
covering news and developments in Bazel for Apple platforms, and related
projects. Subscribe to future issues at
bazelappleweekly.email and pass it on to
anyone else you think may be interested.
News
-
Proposal about contributing Bazel BUILD files for LLVM was raised again.
As you may know, Google uses Bazel internally and has maintained a Bazel BUILD of LLVM for years. Especially with the introduction of MLIR, we've got more and more OSS projects with a Bazel BUILD depending on LLVM (e.g. IREE and TensorFlow). We're also not the only ones using Bazel: e.g. PlaidML also has a Bazel BUILD of LLVM that they've borrowed from TF. Each of these projects has to jump through some weird hoops to keep their version of the Bazel BUILD files in sync with the code, which requires some fragile combination of scripts and human intervention. Instead, we'd like to move general-purpose Bazel BUILD files into the LLVM Project monorepo. We expect to follow the model of the GN build where these will be maintained by interested contributors rather than expecting the general community to maintain them.
-
Keith Smiley summarized Apple BoF at BazelCon 2020. I think giving this a read is worth your time, even if you were at the meeting.
-
Target open-sources XCBBuildServiceProxy - a framework to create proxies for XCBBuildService, which allows for custom Xcode build integrations. It's nice to see more open movements in this field, since there has not been a solution that works for everyone.
-
Bazel for Apple Silicon is almost ready. There isn't an official release yet, but if you want to take advantage of your new fast machine, you can follow the instructions in the GitHub issue to build yourself a Bazel binary that runs natively on Apple Silicon hardware. There are still unresolved issues, for instance, building an arm64 slice targeting the iOS Simulator, but there is a workaround patch from the community that you can use until the official support for it is added to Bazel.
Commits
-
Apple rules can now package dynamic frameworks for Xcode consumption.
This scope of work was to develop a rule that can be used with Bazel that will output a dynamic framework which can be imported and used in Xcode. The existing
ios_framework
rule did not meet this requirement because it doesn’t include the headers, modulemap, or swiftmodule, and swiftdoc files bundled into the packaged .framework file. Therefore, we wrote theios_dynamic_framework
andwatchos_dynamic_framework
rules that output a .framework file with the compiled dynamic framework, Info.plist, Headers folder with the generated headers file, and Modules folder with the swiftmodule and modulemap files. -
A new feature -
swift.split_derived_files_generation
- was added to Swift rules, which can (theoretically) speed up Swift incremental builds.