xref: /aosp_15_r20/external/cronet/build/docs/mac_hermetic_toolchain.md (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker# Mac and iOS hermetic toolchain instructions
2*6777b538SAndroid Build Coastguard Worker
3*6777b538SAndroid Build Coastguard WorkerThe following is a short explanation of why we use a the hermetic toolchain
4*6777b538SAndroid Build Coastguard Workerand instructions on how to roll a new toolchain. This toolchain is only
5*6777b538SAndroid Build Coastguard Workeravailable to Googlers and infra bots.
6*6777b538SAndroid Build Coastguard Worker
7*6777b538SAndroid Build Coastguard Worker## How to roll a new hermetic toolchain.
8*6777b538SAndroid Build Coastguard Worker
9*6777b538SAndroid Build Coastguard Worker1. Download a new version of Xcode, and confirm either mac or ios builds
10*6777b538SAndroid Build Coastguard Worker   properly with this new version.
11*6777b538SAndroid Build Coastguard Worker
12*6777b538SAndroid Build Coastguard Worker2. Create a new CIPD package by moving Xcode.app to the `build/` directory, then
13*6777b538SAndroid Build Coastguard Worker   follow the instructions in
14*6777b538SAndroid Build Coastguard Worker   [build/xcode_binaries.yaml](../xcode_binaries.yaml).
15*6777b538SAndroid Build Coastguard Worker
16*6777b538SAndroid Build Coastguard Worker   The CIPD package creates a subset of the toolchain necessary for a build.
17*6777b538SAndroid Build Coastguard Worker
18*6777b538SAndroid Build Coastguard Worker2. Create a CL with the updated `MAC_BINARIES_TAG` in
19*6777b538SAndroid Build Coastguard Worker   [mac_toolchain.py](../mac_toolchain.py) with the version created by the
20*6777b538SAndroid Build Coastguard Worker   previous command.
21*6777b538SAndroid Build Coastguard Worker
22*6777b538SAndroid Build Coastguard Worker3. Run the CL through the trybots to confirm the roll works.
23*6777b538SAndroid Build Coastguard Worker
24*6777b538SAndroid Build Coastguard Worker## Why we use a hermetic toolchain.
25*6777b538SAndroid Build Coastguard Worker
26*6777b538SAndroid Build Coastguard WorkerBuilding Chrome Mac currently requires many binaries that come bundled with
27*6777b538SAndroid Build Coastguard WorkerXcode, as well the macOS and iphoneOS SDK (also bundled with Xcode). Note that
28*6777b538SAndroid Build Coastguard WorkerChrome ships its own version of clang (compiler), but is dependent on Xcode
29*6777b538SAndroid Build Coastguard Workerfor these other binaries. Using a hermetic toolchain has two main benefits:
30*6777b538SAndroid Build Coastguard Worker
31*6777b538SAndroid Build Coastguard Worker1. Build Chrome with a well-defined toolchain (rather than whatever happens to
32*6777b538SAndroid Build Coastguard Worker   be installed on the machine).
33*6777b538SAndroid Build Coastguard Worker
34*6777b538SAndroid Build Coastguard Worker2. Easily roll/update the toolchain.
35