Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
BuckOutsideValley.pdf
Search
Bruno Rocha
November 09, 2019
1
100
BuckOutsideValley.pdf
Bruno Rocha
November 09, 2019
Tweet
Share
More Decks by Bruno Rocha
See All by Bruno Rocha
Avoiding Release Anxiety
rockbruno
0
18
Creating Scalable iOS Apps
rockbruno
0
11
iOS Security - Hacking iOS Apps
rockbruno
0
17
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
How to train your dragon (web standard)
notwaldorf
94
6.1k
Music & Morning Musume
bryan
46
6.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Designing for Performance
lara
609
69k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Visualization
eitanlees
146
16k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
710
Statistics for Hackers
jakevdp
799
220k
Transcript
Buck Build outside Silicon Valley Bruno Rocha - Software Engineer
+
None
None
None
Tons of developers Several apps that share components Giant codebases
Developers work in very localized squads (localized changes) Valley Companies Ability to create internal helper tools
None
iFood 1. 40+ Developers 2. Four apps that need to
share components 3. Developers work in very specialized squads 4. Most pull requests are very localized
.pbxproj conflicts
Maintaining modules is hard
Huge build times
No project conflicts Automatic management of modules Easy way to
share components between projects Build only what was changed, both locally and in the CI All apps in one repo Valley Companies
Monorepo Build Systems
Monorepo Build Systems
Bazel Build Monorepo Build Systems
Buck Build Monorepo Build Systems
App App Splash Checkout Profile Login Architecture Client Keychain …
More modules = less builds!
Multirepos vs Monorepos App A Repo 1 App B Library
C Repo 2 Repo 3
Multirepos vs Monorepos App A Repo 1 App B Library
C
App A Project A App B Project B Library C
Library C
App A Project A App B Project B Library C
Library C Builds Library C, then App A
App A Project A App B Project B Library C
Library C Builds Library C, then App A Builds Library C again, then App B
//MyApps:AppA Projects A/B //MyApps:AppB //MyLibs:LibraryC
//MyApps:AppA Projects A/B //MyApps:AppB //MyLibs:LibraryC
Builds Library C, then App A Builds App B only
//MyApps:AppA Projects A/B //MyApps:AppB //MyLibs:LibraryC
Buck Caches (Rulekeys) //MyLibs:LibraryC Hash of dependencies Compiler flags Compiler
version Buck version Source contents 3fb80a353db183675fd561b284bc5085
CI Builds PR 1 PR 2 PR 3
CI Builds PR 1 PR 2 PR 3 30 minutes
30 minutes 30 minutes
CI Builds PR 1 PR 2 PR 3
CI Builds PR 1 PR 2 PR 3 30 minutes
5 minutes 3 minutes Cache Cache
Network Cache
Network Cache Upload Cache Download Remote Cache
Creating iOS Apps with Buck Defining rules and using the
build system
None
None
.buckconfig
Buck Rules (Libraries & Tests)
Buck Rules (Libraries & Tests)
Buck Rules (Libraries & Tests)
Buck Rules (Libraries & Tests)
Building Libraries //Libraries/uUserData:UserData {root}{BUCK file path}{Rule name}
Building Libraries //Libraries/uUserData:UserData {root}{BUCK file path}{Rule name}
Build Trace buck-out/logs/build.trace
Testing Libraries
Testing Libraries
App A Library B Library A Library D Library C
Saving time while testing iFood with Xcode: All PRs tested all modules
App A Library B Library A Library D Library C
iFood with Buck: PRs only test the affected graph Saving time while testing
Buck Rules (iOS Apps)
Buck Rules (iOS Apps)
Building iOS Apps buck install {rule} -r
Building iOS Apps buck install {rule} -r
Visual Studio Code + SourceKit-LSP + CodeLLDB
Xcode Project Generation
Xcode Project Generation
None
iFood’s Build/Test CI Evolution Xcode: ~32 minutes Buck + Cache:
~21 minutes Buck + Cache + Only Test Graph: ~9 minutes
iFood’s .pbxproj Conflicts Evolution Xcode: All the time Buck: None
at all
iFood’s Modularization Evolution Xcode: Create a podspec Create an example
project Create the files Add it to the podfile Make our CI run the example’s tests Hope changes won’t break the spec Buck: Just create a folder!
airbnb/BuckSample
Buck Slack
Buck Slack
#VemProiFood + swiftrocks.com @rockthebruno Obrigado!