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