Building Mixed Language iOS Projects with Buck
Article Summary
Brian Zhang from Airbnb's Mobile Developer Infra team cracked a problem that seemed impossible: getting Buck to build mixed Swift and Objective-C iOS projects. The payoff? 50% faster CI builds and 30% smaller app size.
Buck, Facebook's build system, didn't support mixed-language iOS projects—a dealbreaker for Airbnb's codebase with its even split of Swift and Objective-C. The team had to solve deep technical challenges around bridging headers, module maps, and how Buck's static linking approach differs fundamentally from Xcode's framework-based builds.
Key Takeaways
- Buck treats modules as static libraries versus Xcode's dynamic frameworks
- The -import-underlying-module flag broke because Buck doesn't generate module maps
- Team created custom header map generation and transform scripts for *-Swift.h files
- Replaced @import with #import throughout generated code using automated scripts
- Open-sourced BuckSample project showing mixed-language library configuration
Critical Insight
Airbnb achieved 50% faster CI builds and 30% smaller app size by extending Buck to support mixed Swift/Objective-C projects through custom tooling for header maps and bridging.