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