Flighting the build systems - Is it worth the switch?

Last updated: 4 months ago

Developing for Apple platforms, Xcode has always been the standard build system. Xcode is not only a great build system, it is also a great—if not the best IDE for Objective-C and Swift in general. However, Xcode doesn’t scale well when you’re working with a super large codebase.

In recent years, it is not uncommon to see a number of iOS projects switching from Xcode to some open source build systems like Buck or Bazel. For example, Facebook, Uber, Airbnb and Telegram switched to Buck; Pinterest, LinkedIn and Lyft switched to Bazel. What was the driving force behind this motivation?

One of the most desired features when working in a large codebase is the ability to use the cache, which Bazel provides. The build system hashes all the inputs and caches all the outputs. For local development, this makes switching branches effectively free. If you built branch A, then switched to branch B and built B, then switched back to A, Bazel should complete building A within no time (in reality it does take some time to copy the build outputs from the cache). Furthermore, if the cache is shared between machines, a single revision of the source should only be built once and shared between everyone.

Why this is so great, but still very few teams and projects have adopted Bazel?

In this talk, we'll be sharing the current state of Bazel for Apple platforms, our learnings along the way and hopefully open source some of our work so we could make Bazel "just works" for building apps for Apple platforms.

Note: This talk will focus on Bazel but most of the ideas apply to Buck as well.