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 | |
Avi Drissman | 1a520bf | 2020-12-08 19:00:47 | [diff] [blame] | 15 | * A 64-bit Intel Mac running 10.15.4+. (Building on Arm Macs is |
| 16 | [not yet supported](https://chromium.googlesource.com/chromium/src.git/+/master/docs/mac_arm64.md).) |
| 17 | * [Xcode](https://developer.apple.com/xcode/) 12.2+. This version of Xcode |
| 18 | comes with ... |
| 19 | * The macOS 11.0 SDK. Run |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 20 | |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 21 | ```shell |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 22 | $ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs |
dominicc | a4e4c99 | 2016-05-23 22:08:03 | [diff] [blame] | 23 | ``` |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 24 | |
Avi Drissman | 1a520bf | 2020-12-08 19:00:47 | [diff] [blame] | 25 | to check whether you have it. Building with a newer SDK usually works too |
| 26 | (please fix it if it doesn't), but the releases |
| 27 | [currently use Xcode 12.2](https://source.chromium.org/search?q=MAC_BINARIES_LABEL&ss=chromium) |
| 28 | and the macOS 11.0 SDK. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 29 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 30 | ## Install `depot_tools` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 31 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 32 | Clone the `depot_tools` repository: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 33 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 34 | ```shell |
| 35 | $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 36 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 37 | |
Gabriel Charette | b6780c1 | 2019-04-24 16:23:52 | [diff] [blame] | 38 | Add `depot_tools` to the end of your PATH (you will probably want to put this in |
| 39 | your `~/.bash_profile` or `~/.zshrc`). Assuming you cloned `depot_tools` to |
| 40 | `/path/to/depot_tools` (note: you **must** use the absolute path or Python will |
| 41 | not be able to find infra tools): |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 42 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 43 | ```shell |
| 44 | $ export PATH="$PATH:/path/to/depot_tools" |
| 45 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 46 | |
| 47 | ## Get the code |
| 48 | |
Aaron Gable | 94b7e2a3 | 2018-01-03 19:14:41 | [diff] [blame] | 49 | Ensure that unicode filenames aren't mangled by HFS: |
| 50 | |
| 51 | ```shell |
| 52 | $ git config --global core.precomposeUnicode true |
| 53 | ``` |
| 54 | |
L. David Baron | 8d606c54 | 2021-03-05 19:56:07 | [diff] [blame] | 55 | In System Preferences, check that "Energy Saver" -> "Power Adapter" -> |
| 56 | "Prevent computer from sleeping automatically when the display is off" is |
| 57 | checked so that your laptop doesn't go to sleep and interrupt the long network |
| 58 | connection needed here. |
| 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 |
| 72 | $ fetch chromium |
| 73 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 74 | |
[email protected] | 1436b95 | 2018-10-26 16:35:13 | [diff] [blame] | 75 | If you don't need the full repo history, you can save time by using |
Yannic Bonenberger | a6855700 | 2019-04-29 14:13:19 | [diff] [blame] | 76 | `fetch --no-history chromium`. You can call `git fetch --unshallow` to retrieve |
| 77 | the full history later. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 78 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 79 | Expect the command to take 30 minutes on even a fast connection, and many |
| 80 | hours on slower ones. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 81 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 82 | When `fetch` completes, it will have created a hidden `.gclient` file and a |
| 83 | directory called `src` in the working directory. The remaining instructions |
| 84 | assume you have switched to the `src` directory: |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] |
|