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 | |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 15 | * A 64-bit Mac running 10.12+. |
| 16 | * [Xcode](https://developer.apple.com/xcode) 8+ |
| 17 | * The OS X 10.12 SDK. Run |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 18 | |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 19 | ```shell |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 20 | $ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs |
dominicc | a4e4c99 | 2016-05-23 22:08:03 | [diff] [blame] | 21 | ``` |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 22 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 23 | to check whether you have it. Building with a newer SDK works too, but |
erikchen | 7d7509a | 2017-10-02 23:40:36 | [diff] [blame] | 24 | the releases currently use the 10.12 SDK. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 25 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 26 | ## Install `depot_tools` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 27 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 28 | Clone the `depot_tools` repository: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 29 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 30 | ```shell |
| 31 | $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 32 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 33 | |
Gabriel Charette | b6780c1 | 2019-04-24 16:23:52 | [diff] [blame] | 34 | Add `depot_tools` to the end of your PATH (you will probably want to put this in |
| 35 | your `~/.bash_profile` or `~/.zshrc`). Assuming you cloned `depot_tools` to |
| 36 | `/path/to/depot_tools` (note: you **must** use the absolute path or Python will |
| 37 | not be able to find infra tools): |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 38 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 39 | ```shell |
| 40 | $ export PATH="$PATH:/path/to/depot_tools" |
| 41 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 42 | |
| 43 | ## Get the code |
| 44 | |
Aaron Gable | 94b7e2a3 | 2018-01-03 19:14:41 | [diff] [blame] | 45 | Ensure that unicode filenames aren't mangled by HFS: |
| 46 | |
| 47 | ```shell |
| 48 | $ git config --global core.precomposeUnicode true |
| 49 | ``` |
| 50 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 51 | Create a `chromium` directory for the checkout and change to it (you can call |
| 52 | this whatever you like and put it wherever you like, as long as the full path |
| 53 | has no spaces): |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 54 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 55 | ```shell |
| 56 | $ mkdir chromium && cd chromium |
| 57 | ``` |
| 58 | |
| 59 | Run the `fetch` tool from `depot_tools` to check out the code and its |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 60 | dependencies. |
| 61 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 62 | ```shell |
| 63 | $ fetch chromium |
| 64 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 65 | |
[email protected] | 1436b95 | 2018-10-26 16:35:13 | [diff] [blame] | 66 | 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^] | 67 | `fetch --no-history chromium`. You can call `git fetch --unshallow` to retrieve |
| 68 | the full history later. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 69 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 70 | Expect the command to take 30 minutes on even a fast connection, and many |
| 71 | hours on slower ones. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 72 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 73 | When `fetch` completes, it will have created a hidden `.gclient` file and a |
| 74 | directory called `src` in the working directory. The remaining instructions |
| 75 | assume you have switched to the `src` directory: |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 76 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 77 | ```shell |
| 78 | $ cd src |
| 79 | ``` |
| 80 | |
| 81 | *Optional*: You can also [install API |
| 82 | keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your |
| 83 | build to talk to some Google services, but this is not necessary for most |
| 84 | development and testing purposes. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 85 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 86 | ## Setting up the build |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 87 | |
Tom Bridgwater | eef40154 | 2018-08-17 00:54:43 | [diff] [blame] | 88 | Chromium uses [Ninja](https://ninja-build.org) as its main build tool along with |
| 89 | a tool called [GN](https://gn.googlesource.com/gn/+/master/docs/quick_start.md) |
| 90 | to generate `.ninja` files. You can create any number of *build directories* |
| 91 | with different configurations. To create a build directory: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 92 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 93 | ```shell |
| 94 | $ gn gen out/Default |
| 95 | ``` |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 96 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 97 | * You only have to run this once for each new build directory, Ninja will |
| 98 | update the build files as needed. |
| 99 | * You can replace `Default` with another name, but |
| 100 | it should be a subdirectory of `out`. |
| 101 | * For other build arguments, including release settings, see [GN build |
| 102 | configuration](https://www.chromium.org/developers/gn-build-configuration). |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 103 | The default will be a debug component build matching the current host |
| 104 | operating system and CPU. |
| 105 | * For more info on GN, run `gn help` on the command line or read the |
| 106 | [quick start guide](../tools/gn/docs/quick_start.md). |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 107 | |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 108 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 109 | ### Faster builds |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 110 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 111 | Full rebuilds are about the same speed in Debug and Release, but linking is a |
| 112 | lot faster in Release builds. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 113 | |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 114 | Put |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 115 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 116 | ``` |
| 117 | is_debug = false |
| 118 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 119 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 120 | in your `args.gn` to do a release build. |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 121 | |
| 122 | Put |
| 123 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 124 | ``` |
| 125 | is_component_build = true |
| 126 | ``` |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 127 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 128 | in your `args.gn` to build many small dylibs instead of a single large |
| 129 | executable. This makes incremental builds much faster, at the cost of producing |
| 130 | a binary that opens less quickly. Component builds work in both debug and |
| 131 | release. |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 132 | |
| 133 | Put |
| 134 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 135 | ``` |
| 136 | symbol_level = 0 |
| 137 | ``` |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 138 | |
| 139 | in your args.gn to disable debug symbols altogether. This makes both full |
| 140 | rebuilds and linking faster (at the cost of not getting symbolized backtraces |
| 141 | in gdb). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 142 | |
Philip Rogers | eb84168 | 2017-10-09 16:08:50 | [diff] [blame] | 143 | #### Jumbo/Unity builds |
| 144 | |
| 145 | Jumbo builds merge many translation units ("source files") and compile them |
| 146 | together. Since a large portion of Chromium's code is in shared header files, |
| 147 | this dramatically reduces the total amount of work needed. Check out the |
| 148 | [Jumbo / Unity builds](jumbo.md) for more information. |
| 149 | |
| 150 | Enable jumbo builds by setting the GN arg `use_jumbo_build=true`. |
| 151 | |
| 152 | #### CCache |
| 153 | |
philipj | 5a0fcb9 | 2016-01-23 23:23:40 | [diff] [blame] | 154 | You might also want to [install ccache](ccache_mac.md) to speed up the build. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 155 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 156 | ## Build Chromium |
| 157 | |
| 158 | Build Chromium (the "chrome" target) with Ninja using the command: |
| 159 | |
| 160 | ```shell |
Max Moroz | f5b31fcd | 2018-08-10 21:55:48 | [diff] [blame] | 161 | $ autoninja -C out/Default chrome |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 162 | ``` |
| 163 | |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 164 | (`autoninja` is a wrapper that automatically provides optimal values for the |
| 165 | arguments passed to `ninja`.) |
Max Moroz | f5b31fcd | 2018-08-10 21:55:48 | [diff] [blame] | 166 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 167 | You can get a list of all of the other build targets from GN by running `gn ls |
| 168 | out/Default` from the command line. To compile one, pass the GN label to Ninja |
Max Moroz | f5b31fcd | 2018-08-10 21:55:48 | [diff] [blame] | 169 | with no preceding "//" (so, for `//chrome/test:unit_tests` use `autoninja -C |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 170 | out/Default chrome/test:unit_tests`). |
| 171 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 172 | ## Run Chromium |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 173 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 174 | Once it is built, you can simply run the browser: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 175 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 176 | ```shell |
Owen Min | 83eda110 | 2017-06-28 18:47:21 | [diff] [blame] | 177 | $ out/Default/Chromium.app/Contents/MacOS/Chromium |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 178 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 179 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 180 | ## Running test targets |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 181 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 182 | You can run the tests in the same way. You can also limit which tests are |
| 183 | run using the `--gtest_filter` arg, e.g.: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 184 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 185 | ``` |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 186 | $ out/Default/unit_tests --gtest_filter="PushClientTest.*" |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 187 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 188 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 189 | You can find out more about GoogleTest at its |
| 190 | [GitHub page](https://github.com/google/googletest). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 191 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 192 | ## Debugging |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 193 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 194 | Good debugging tips can be found |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 195 | [here](https://dev.chromium.org/developers/how-tos/debugging-on-os-x). If you |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 196 | would like to debug in a graphical environment, rather than using `lldb` at the |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 197 | command line, that is possible without building in Xcode (see |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 198 | [Debugging in Xcode](https://www.chromium.org/developers/how-tos/debugging-on-os-x/building-with-ninja-debugging-with-xcode)). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 199 | |
Vaclav Brozek | 539499e | 2018-07-18 11:19:51 | [diff] [blame] | 200 | Tips for printing variables from `lldb` prompt (both in Xcode or in terminal): |
| 201 | * If `uptr` is a `std::unique_ptr`, the address it wraps is accessible as |
| 202 | `uptr.__ptr_.__value_`. |
| 203 | * To pretty-print `base::string16`, ensure you have a `~/.lldbinit` file and |
| 204 | add the following line into it (substitute {SRC} for your actual path to the |
| 205 | root of Chromium's sources): |
| 206 | ``` |
| 207 | command script import {SRC}/tools/lldb/lldb_chrome.py |
| 208 | ``` |
| 209 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 210 | ## Update your checkout |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 211 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 212 | To update an existing checkout, you can run |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 213 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 214 | ```shell |
| 215 | $ git rebase-update |
| 216 | $ gclient sync |
| 217 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 218 | |
| 219 | The first command updates the primary Chromium source repository and rebases |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 220 | any of your local branches on top of tip-of-tree (aka the Git branch |
| 221 | `origin/master`). If you don't want to use this script, you can also just use |
| 222 | `git pull` or other common Git commands to update the repo. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 223 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 224 | The second command syncs dependencies to the appropriate versions and re-runs |
| 225 | hooks as needed. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 226 | |
| 227 | ## Tips, tricks, and troubleshooting |
| 228 | |
| 229 | ### Using Xcode-Ninja Hybrid |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 230 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 231 | While using Xcode is unsupported, GN supports a hybrid approach of using Ninja |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 232 | for building, but Xcode for editing and driving compilation. Xcode is still |
| 233 | slow, but it runs fairly well even **with indexing enabled**. Most people |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 234 | build in the Terminal and write code with a text editor, though. |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 235 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 236 | With hybrid builds, compilation is still handled by Ninja, and can be run from |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 237 | the command line (e.g. `autoninja -C out/gn chrome`) or by choosing the `chrome` |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 238 | target in the hybrid workspace and choosing Build. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 239 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 240 | To use Xcode-Ninja Hybrid pass `--ide=xcode` to `gn gen`: |
tfarina | 59fb57ac | 2016-03-02 18:17:24 | [diff] [blame] | 241 | |
| 242 | ```shell |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 243 | $ gn gen out/gn --ide=xcode |
tfarina | 59fb57ac | 2016-03-02 18:17:24 | [diff] [blame] | 244 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 245 | |
thakis | f28551b | 2016-08-09 14:42:55 | [diff] [blame] | 246 | Open it: |
tfarina | 59fb57ac | 2016-03-02 18:17:24 | [diff] [blame] | 247 | |
| 248 | ```shell |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 249 | $ open out/gn/ninja/all.xcworkspace |
tfarina | 59fb57ac | 2016-03-02 18:17:24 | [diff] [blame] | 250 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 251 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 252 | You may run into a problem where http://YES is opened as a new tab every time |
| 253 | you launch Chrome. To fix this, open the scheme editor for the Run scheme, |
| 254 | choose the Options tab, and uncheck "Allow debugging when using document |
| 255 | Versions Browser". When this option is checked, Xcode adds |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 256 | `--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` |
| 257 | gets interpreted as a URL to open. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 258 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 259 | If you have problems building, join us in `#chromium` on `irc.freenode.net` and |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 260 | ask there. Be sure that the |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 261 | [waterfall](https://build.chromium.org/buildbot/waterfall/) is green and the |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 262 | tree is open before checking out. This will increase your chances of success. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 263 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 264 | ### Improving performance of `git status` |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 265 | |
isherman | ce1d9d8 | 2017-05-12 23:10:04 | [diff] [blame] | 266 | #### Increase the vnode cache size |
| 267 | |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 268 | `git status` is used frequently to determine the status of your checkout. Due |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 269 | to the large number of files in Chromium's checkout, `git status` performance |
| 270 | can be quite variable. Increasing the system's vnode cache appears to help. By |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 271 | default, this command: |
| 272 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 273 | ```shell |
| 274 | $ sysctl -a | egrep kern\..*vnodes |
| 275 | ``` |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 276 | |
| 277 | Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this |
| 278 | setting: |
| 279 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 280 | ```shell |
| 281 | $ sudo sysctl kern.maxvnodes=$((512*1024)) |
| 282 | ``` |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 283 | |
| 284 | Higher values may be appropriate if you routinely move between different |
| 285 | Chromium checkouts. This setting will reset on reboot, the startup setting can |
| 286 | be set in `/etc/sysctl.conf`: |
| 287 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 288 | ```shell |
| 289 | $ echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf |
| 290 | ``` |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 291 | |
| 292 | Or edit the file directly. |
| 293 | |
isherman | ce1d9d8 | 2017-05-12 23:10:04 | [diff] [blame] | 294 | #### Configure git to use an untracked cache |
| 295 | |
| 296 | If `git --version` reports 2.8 or higher, try running |
| 297 | |
| 298 | ```shell |
| 299 | $ git update-index --test-untracked-cache |
| 300 | ``` |
| 301 | |
| 302 | If the output ends with `OK`, then the following may also improve performance of |
| 303 | `git status`: |
| 304 | |
| 305 | ```shell |
| 306 | $ git config core.untrackedCache true |
| 307 | ``` |
| 308 | |
| 309 | If `git --version` reports 2.6 or higher, but below 2.8, you can instead run |
shess | 1f4c3d9 | 2015-11-05 18:15:37 | [diff] [blame] | 310 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 311 | ```shell |
| 312 | $ git update-index --untracked-cache |
| 313 | ``` |
tnagel | cad63169 | 2016-04-15 11:02:36 | [diff] [blame] | 314 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 315 | ### Xcode license agreement |
tnagel | cad63169 | 2016-04-15 11:02:36 | [diff] [blame] | 316 | |
| 317 | If you're getting the error |
| 318 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 319 | > Agreeing to the Xcode/iOS license requires admin privileges, please re-run as |
| 320 | > root via sudo. |
tnagel | cad63169 | 2016-04-15 11:02:36 | [diff] [blame] | 321 | |
| 322 | the Xcode license hasn't been accepted yet which (contrary to the message) any |
| 323 | user can do by running: |
| 324 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 325 | ```shell |
| 326 | $ xcodebuild -license |
| 327 | ``` |
tnagel | cad63169 | 2016-04-15 11:02:36 | [diff] [blame] | 328 | |
| 329 | Only accepting for all users of the machine requires root: |
| 330 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 331 | ```shell |
| 332 | $ sudo xcodebuild -license |
| 333 | ``` |