blob: 33f78ca0d61d0a821f866662af7d4572a08ca84d [file] [log] [blame] [view]
dpranke1a70d0c2016-12-01 02:42:291# Checking out and building Chromium for Mac
andybons3322f762015-08-24 21:37:092
erikchen7d7509a2017-10-02 23:40:363There are instructions for other platforms linked from the
dpranke1a70d0c2016-12-01 02:42:294[get the code](get_the_code.md) page.
5
dpranke1a70d0c2016-12-01 02:42:296## Instructions for Google Employees
7
8Are you a Google employee? See
9[go/building-chrome](https://goto.google.com/building-chrome) instead.
dpranke0ae7cad2016-11-30 07:47:5810
andybonsad92aa32015-08-31 02:27:4411[TOC]
andybons3322f762015-08-24 21:37:0912
dpranke0ae7cad2016-11-30 07:47:5813## System requirements
sdya8197bd22016-09-14 19:06:4214
Avi Drissman1a520bf2020-12-08 19:00:4715* 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
sdy93387fa2016-12-01 01:03:4420
erikchen7d7509a2017-10-02 23:40:3621 ```shell
sdy93387fa2016-12-01 01:03:4422 $ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
dominicca4e4c992016-05-23 22:08:0323 ```
erikchen7d7509a2017-10-02 23:40:3624
Avi Drissman1a520bf2020-12-08 19:00:4725 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.
andybons3322f762015-08-24 21:37:0929
dpranke0ae7cad2016-11-30 07:47:5830## Install `depot_tools`
andybons3322f762015-08-24 21:37:0931
sdy93387fa2016-12-01 01:03:4432Clone the `depot_tools` repository:
andybons3322f762015-08-24 21:37:0933
sdy93387fa2016-12-01 01:03:4434```shell
35$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
36```
andybons3322f762015-08-24 21:37:0937
Gabriel Charetteb6780c12019-04-24 16:23:5238Add `depot_tools` to the end of your PATH (you will probably want to put this in
39your `~/.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
41not be able to find infra tools):
dpranke0ae7cad2016-11-30 07:47:5842
sdy93387fa2016-12-01 01:03:4443```shell
44$ export PATH="$PATH:/path/to/depot_tools"
45```
dpranke0ae7cad2016-11-30 07:47:5846
47## Get the code
48
Aaron Gable94b7e2a32018-01-03 19:14:4149Ensure that unicode filenames aren't mangled by HFS:
50
51```shell
52$ git config --global core.precomposeUnicode true
53```
54
L. David Baron8d606c542021-03-05 19:56:0755In System Preferences, check that "Energy Saver" -> "Power Adapter" ->
56"Prevent computer from sleeping automatically when the display is off" is
57checked so that your laptop doesn't go to sleep and interrupt the long network
58connection needed here.
59
sdy93387fa2016-12-01 01:03:4460Create a `chromium` directory for the checkout and change to it (you can call
61this whatever you like and put it wherever you like, as long as the full path
62has no spaces):
dpranke0ae7cad2016-11-30 07:47:5863
sdy93387fa2016-12-01 01:03:4464```shell
65$ mkdir chromium && cd chromium
66```
67
68Run the `fetch` tool from `depot_tools` to check out the code and its
dpranke0ae7cad2016-11-30 07:47:5869dependencies.
70
sdy93387fa2016-12-01 01:03:4471```shell
72$ fetch chromium
73```
dpranke0ae7cad2016-11-30 07:47:5874
[email protected]1436b952018-10-26 16:35:1375If you don't need the full repo history, you can save time by using
Yannic Bonenbergera68557002019-04-29 14:13:1976`fetch --no-history chromium`. You can call `git fetch --unshallow` to retrieve
77the full history later.
dpranke0ae7cad2016-11-30 07:47:5878
sdy93387fa2016-12-01 01:03:4479Expect the command to take 30 minutes on even a fast connection, and many
80hours on slower ones.
dpranke0ae7cad2016-11-30 07:47:5881
sdy93387fa2016-12-01 01:03:4482When `fetch` completes, it will have created a hidden `.gclient` file and a
83directory called `src` in the working directory. The remaining instructions
84assume you have switched to the `src` directory:
dpranke0ae7cad2016-11-30 07:47:58