blob: 13eece5746ce6b3ec5d8e86b171ade2bdf558510 [file] [log] [blame] [view]
derat81710502017-02-22 17:57:551# Chrome OS Build Instructions (Chromium OS on Linux)
tfarina5b373372016-03-27 08:06:212
stevenjb89ee24b2016-04-19 19:26:423Chromium on Chromium OS is built from a mix of code sourced from Chromium
tfarina5b373372016-03-27 08:06:214on Linux and Chromium on Windows. Much of the user interface code is
stevenjb89ee24b2016-04-19 19:26:425shared with Chromium on Windows.
6
7If you make changes to Chromium on Windows, they may affect Chromium
8on Chromium OS. Fortunately to test the effects of your changes you
9don't need to build all of Chromium OS, you can just build Chromium for
tfarina5b373372016-03-27 08:06:2110Chromium OS directly on Linux.
11
12First, follow the [normal Linux build
13instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md)
14as usual to get a Chromium checkout.
15
stevenjbec7b4e3c2016-04-18 22:52:0216## Building and running Chromium with Chromium OS UI on your local machine
tfarina5b373372016-03-27 08:06:2117
18If you plan to test the Chromium build on your dev machine and not a
stevenjbec7b4e3c2016-04-18 22:52:0219Chromium OS device, run the following in your chromium checkout:
tfarina5b373372016-03-27 08:06:2120
stevenjbec7b4e3c2016-04-18 22:52:0221 $ gn gen out/Default --args='target_os="chromeos"'
Jacob Dufaultbfef58b2018-01-12 22:39:4822 $ ninja -C out/Default -j32
stevenjbec7b4e3c2016-04-18 22:52:0223
24NOTE: You may wish to replace 'Default' with something like 'Cros' if
25you switch back and forth between Linux and Chromium OS builds, or 'Debug'
26if you want to differentiate between Debug and Release builds (see below)
27or DebugCros or whatever you like.
28
Jacob Dufaultbfef58b2018-01-12 22:39:4829NOTE: If using goma increase -j32 (which controls parallelization) to something
30higher, 500 or 1000. Consider adding `-l20` which prevents ninja from starting
31jobs if the load average is too high - this prevents system hangs when using
32-j1000 when goma is down.
stevenjbec7b4e3c2016-04-18 22:52:0233
34See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration)
35for more information about configuring your build.
36
Matt Giucad8cebe42018-01-09 04:37:4637Some additional options you may wish to set by passing in `--args` to `gn gen`
38or running `gn args out/Default`:
stevenjb89ee24b2016-04-19 19:26:4239
stevenjbec7b4e3c2016-04-18 22:52:0240 is_component_build = true
41 use_goma = true
Jacob Dufaultbfef58b2018-01-12 22:39:4842 is_debug = false # Release build, significantly faster
stevenjbec7b4e3c2016-04-18 22:52:0243 dcheck_always_on = true # Enable DCHECK (with is_debug = false)
Jacob Dufaultbfef58b2018-01-12 22:39:4844
45 # Set the following true to create a Chrome (instead of Chromium) build.
46 is_official_build = false
47 is_chrome_branded = false
tfarina5b373372016-03-27 08:06:2148
stevenjbec7b4e3c2016-04-18 22:52:0249## Notes
tfarina5b373372016-03-27 08:06:2150
tfarina5b373372016-03-27 08:06:2151The Chromium OS build requires a functioning GL so if you plan on
52testing it through Chromium Remote Desktop you might face drawing
53problems (e.g. Aura window not painting anything). Possible remedies:
54
Matt Giucad8cebe42018-01-09 04:37:4655* `--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.
tfarina5b373372016-03-27 08:06:2158
tfarina5b373372016-03-27 08:06:2159To more closely match the UI used on devices, you can install fonts used
60by Chrome OS, such as Roboto, on your Linux distro.
61
62To specify a logged in user:
63
64* For first run, add the following options to the command line:
Matt Giucad8cebe42018-01-09 04:37:4665 `--user-data-dir=/tmp/chrome --login-manager`
tfarina5b373372016-03-27 08:06:2166* Go through the out-of-the-box UX and sign in as
Matt Giucad8cebe42018-01-09 04:37:4667 **[email protected]**.
tfarina5b373372016-03-27 08:06:2168* For subsequent runs, add the following to the command line:
Matt Giucad8cebe42018-01-09 04:37:4669 `--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`
tfarina5b373372016-03-27 08:06:2173
74Signing in as a specific user is useful for debugging features like sync
75that require a logged in user.
76
stevenjb89ee24b2016-04-19 19:26:4277## Compile Chromium for a Chromium OS device using the Chromium OS SDK
tfarina5b373372016-03-27 08:06:2178
stevenjbec7b4e3c2016-04-18 22:52:0279See [Building Chromium for a Chromium OS device](https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser)
stevenjb89ee24b2016-04-19 19:26:4280for information about building and testing chromium for Chromium OS.