derat | 8171050 | 2017-02-22 17:57:55 | [diff] [blame] | 1 | # Chrome OS Build Instructions (Chromium OS on Linux) |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 2 | |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 3 | Chromium on Chromium OS is built from a mix of code sourced from Chromium |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 4 | on Linux and Chromium on Windows. Much of the user interface code is |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 5 | shared with Chromium on Windows. |
| 6 | |
| 7 | If you make changes to Chromium on Windows, they may affect Chromium |
| 8 | on Chromium OS. Fortunately to test the effects of your changes you |
| 9 | don't need to build all of Chromium OS, you can just build Chromium for |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 10 | Chromium OS directly on Linux. |
| 11 | |
| 12 | First, follow the [normal Linux build |
| 13 | instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md) |
| 14 | as usual to get a Chromium checkout. |
| 15 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 16 | ## Building and running Chromium with Chromium OS UI on your local machine |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 17 | |
| 18 | If you plan to test the Chromium build on your dev machine and not a |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 19 | Chromium OS device, run the following in your chromium checkout: |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 20 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 21 | $ gn gen out/Default --args='target_os="chromeos"' |
Jacob Dufault | bfef58b | 2018-01-12 22:39:48 | [diff] [blame^] | 22 | $ ninja -C out/Default -j32 |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 23 | |
| 24 | NOTE: You may wish to replace 'Default' with something like 'Cros' if |
| 25 | you switch back and forth between Linux and Chromium OS builds, or 'Debug' |
| 26 | if you want to differentiate between Debug and Release builds (see below) |
| 27 | or DebugCros or whatever you like. |
| 28 | |
Jacob Dufault | bfef58b | 2018-01-12 22:39:48 | [diff] [blame^] | 29 | NOTE: If using goma increase -j32 (which controls parallelization) to something |
| 30 | higher, 500 or 1000. Consider adding `-l20` which prevents ninja from starting |
| 31 | jobs if the load average is too high - this prevents system hangs when using |
| 32 | -j1000 when goma is down. |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 33 | |
| 34 | See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration) |
| 35 | for more information about configuring your build. |
| 36 | |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 37 | Some additional options you may wish to set by passing in `--args` to `gn gen` |
| 38 | or running `gn args out/Default`: |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 39 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 40 | is_component_build = true |
| 41 | use_goma = true |
Jacob Dufault | bfef58b | 2018-01-12 22:39:48 | [diff] [blame^] | 42 | is_debug = false # Release build, significantly faster |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 43 | dcheck_always_on = true # Enable DCHECK (with is_debug = false) |
Jacob Dufault | bfef58b | 2018-01-12 22:39:48 | [diff] [blame^] | 44 | |
| 45 | # Set the following true to create a Chrome (instead of Chromium) build. |
| 46 | is_official_build = false |
| 47 | is_chrome_branded = false |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 48 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 49 | ## Notes |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 50 | |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 51 | The Chromium OS build requires a functioning GL so if you plan on |
| 52 | testing it through Chromium Remote Desktop you might face drawing |
| 53 | problems (e.g. Aura window not painting anything). Possible remedies: |
| 54 | |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 55 | * `--ui-enable-software-compositing --ui-disable-threaded-compositing` |
| 56 | * `--use-gl=osmesa`, but it's ultra slow, and you'll have to build osmesa |
| 57 | yourself. |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 58 | |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 59 | To more closely match the UI used on devices, you can install fonts used |
| 60 | by Chrome OS, such as Roboto, on your Linux distro. |
| 61 | |
| 62 | To specify a logged in user: |
| 63 | |
| 64 | * For first run, add the following options to the command line: |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 65 | `--user-data-dir=/tmp/chrome --login-manager` |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 66 | * Go through the out-of-the-box UX and sign in as |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 67 | **[email protected]**. |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 68 | * For subsequent runs, add the following to the command line: |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 69 | `--user-data-dir=/tmp/chrome [email protected]` |
| 70 | * To run in guest mode instantly, you can run add the arguments: |
| 71 | `--user-data-dir=/tmp/chrome --bwsi --incognito --login-user='$guest' |
| 72 | --login-profile=user` |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 73 | |
| 74 | Signing in as a specific user is useful for debugging features like sync |
| 75 | that require a logged in user. |
| 76 | |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 77 | ## Compile Chromium for a Chromium OS device using the Chromium OS SDK |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 78 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 79 | See [Building Chromium for a Chromium OS device](https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser) |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 80 | for information about building and testing chromium for Chromium OS. |