Uber Mar 1, 2017

iOS Monorepo

Article Summary

Uber scaled from a dozen iOS engineers to hundreds in just a few years. Their tooling nearly collapsed under the weight.

Uber Engineering migrated their entire iOS codebase to a monorepo powered by Buck build system. This article details why they abandoned CocoaPods, how they executed the migration, and what they gained.

Key Takeaways

Critical Insight

Uber's monorepo migration eliminated version conflicts, cut build times massively, and let hundreds of engineers move faster despite growing complexity.

The article reveals the surprising percentage of commits that initially failed after the monorepo launch, and the clever system they built to fix it.

About This Article

Problem

Uber built out over 40 interdependent modules with complex semantic versioning constraints. Small code changes like adding enum cases or protocol properties would trigger compiler errors that cascaded across dependent modules and applications.

Solution

Uber Engineering switched to the Buck build system, which has intelligent incremental compilation and reliable distributed caching. This replaced CocoaPods' slow dependency resolution and let them make breaking changes across modules in a single commit without version conflicts.

Impact

Buck's cache architecture removed the need to clean CI caches. Build artifacts could be shared across machines and test results could be skipped for unaffected modules. This cut down the time developers spent waiting across hundreds of daily commits.