dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 1 | # Checking out and building Chromium for Mac |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 2 | |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 3 | There are instructions for other platforms linked from the |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 4 | [get the code](get_the_code.md) page. |
| 5 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 6 | ## Instructions for Google Employees |
| 7 | |
| 8 | Are you a Google employee? See |
| 9 | [go/building-chrome](https://goto.google.com/building-chrome) instead. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 10 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 11 | [TOC] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 12 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 13 | ## System requirements |
sdy | a8197bd2 | 2016-09-14 19:06:42 | [diff] [blame] | 14 | |
Nico Weber | 3c9befa | 2021-11-03 17:07:11 | [diff] [blame] | 15 | * A Mac, Intel or Arm. |
Avi Drissman | ab7729b | 2021-06-10 19:17:15 | [diff] [blame] | 16 | ([More details about Arm Macs](https://chromium.googlesource.com/chromium/src.git/+/main/docs/mac_arm64.md).) |
Nico Weber | 3c9befa | 2021-11-03 17:07:11 | [diff] [blame] | 17 | * [Xcode](https://developer.apple.com/xcode/). Xcode comes with... |
| 18 | * The macOS SDK. Run |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 19 | |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 20 | ```shell |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 21 | $ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs |
dominicc | a4e4c99 | 2016-05-23 22:08:03 | [diff] [blame] | 22 | ``` |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 23 | |
Nico Weber | 3c9befa | 2021-11-03 17:07:11 | [diff] [blame] | 24 | to check whether you have it, and what version you have. |
| 25 | `mac_sdk_official_version` in [mac_sdk.gni](../build/config/mac/mac_sdk.gni) |
| 26 | is the SDK version used on all the bots and for |
| 27 | [official builds](https://source.chromium.org/search?q=MAC_BINARIES_LABEL&ss=chromium), |
| 28 | so that version is guaranteed to work. Building with a newer SDK usually |
| 29 | works too (please fix or file a bug if it doesn't). |
wafuwafu13 | b6854ba5 | 2021-12-24 06:02:43 | [diff] [blame] | 30 | |
Nico Weber | 3c9befa | 2021-11-03 17:07:11 | [diff] [blame] | 31 | Building with an older SDK might also work, but if it doesn't then we won't |
| 32 | accept changes for making it work. |
wafuwafu13 | b6854ba5 | 2021-12-24 06:02:43 | [diff] [blame] | 33 | |
Nico Weber | 3c9befa | 2021-11-03 17:07:11 | [diff] [blame] | 34 | The easiest way to get the newest SDK is to use the newest version of Xcode, |
| 35 | which often requires using the newest version of macOS. We don't use Xcode |
| 36 | itself much, so if you're know what you're doing, you can likely get the |
| 37 | build working with an older version of macOS as long as you get a new |
| 38 | version of the macOS SDK on it. |
Nico Weber | 36cd0a55 | 2022-01-18 16:31:49 | [diff] [blame] | 39 | * An APFS-formatted volume (this is the default format for macOS volumes). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 40 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 41 | ## Install `depot_tools` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 42 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 43 | Clone the `depot_tools` repository: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 44 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 45 | ```shell |
| 46 | $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 47 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 48 | |
Gabriel Charette | b6780c1 | 2019-04-24 16:23:52 | [diff] [blame] | 49 | Add `depot_tools` to the end of your PATH (you will probably want to put this in |
| 50 | your `~/.bash_profile` or `~/.zshrc`). Assuming you cloned `depot_tools` to |
| 51 | `/path/to/depot_tools` (note: you **must** use the absolute path or Python will |
| 52 | not be able to find infra tools): |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 53 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 54 | ```shell |
| 55 | $ export PATH="$PATH:/path/to/depot_tools" |
| 56 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 57 | |
| 58 | ## Get the code |
| 59 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 60 | Create a `chromium` directory for the checkout and change to it (you can call |
| 61 | this whatever you like and put it wherever you like, as long as the full path |
| 62 | has no spaces): |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 63 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 64 | ```shell |
| 65 | $ mkdir chromium && cd chromium |
| 66 | ``` |
| 67 | |
| 68 | Run the `fetch` tool from `depot_tools` to check out the code and its |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 69 | dependencies. |
| 70 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 71 | ```shell |
David Sanders | e382717 | 2022-02-08 15:48:56 | [diff] [blame] | 72 | $ caffeinate fetch chromium |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 73 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 74 | |
David Sanders | e382717 | 2022-02-08 15:48:56 | [diff] [blame] |
|