blob: 968002bf0593024de87283a1ffab9a54a7fbe24b [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"'
22 $ ninja -C out/Default
23
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
29Now, when you build, you will build with Chromium OS features turned on.
30
31See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration)
32for more information about configuring your build.
33
Matt Giucad8cebe42018-01-09 04:37:4634Some additional options you may wish to set by passing in `--args` to `gn gen`
35or running `gn args out/Default`:
stevenjb89ee24b2016-04-19 19:26:4236
stevenjbec7b4e3c2016-04-18 22:52:0237 is_component_build = true
38 use_goma = true
39 is_debug = false # Release build
40 dcheck_always_on = true # Enable DCHECK (with is_debug = false)
41 is_official_build = true
42 is_chrome_branded = true
tfarina5b373372016-03-27 08:06:2143
stevenjbec7b4e3c2016-04-18 22:52:0244## Notes
tfarina5b373372016-03-27 08:06:2145
46When you build Chromium OS Chromium, you'll be using the TOOLKIT\_VIEWS
47front-end just like Windows, so the files you'll probably want are in
48src/ui/views and src/chrome/browser/ui/views.
49
stevenjbec7b4e3c2016-04-18 22:52:0250When target_os = "chromeos", then toolkit\_views need not (and should not)
51be specified.
tfarina5b373372016-03-27 08:06:2152
53The Chromium OS build requires a functioning GL so if you plan on
54testing it through Chromium Remote Desktop you might face drawing
55problems (e.g. Aura window not painting anything). Possible remedies:
56
Matt Giucad8cebe42018-01-09 04:37:4657* `--ui-enable-software-compositing --ui-disable-threaded-compositing`
58* `--use-gl=osmesa`, but it's ultra slow, and you'll have to build osmesa
59 yourself.
tfarina5b373372016-03-27 08:06:2160* ... or just don't use Remote Desktop. :)
61
tfarina5b373372016-03-27 08:06:2162To more closely match the UI used on devices, you can install fonts used
63by Chrome OS, such as Roboto, on your Linux distro.
64
65To specify a logged in user:
66
67* For first run, add the following options to the command line:
Matt Giucad8cebe42018-01-09 04:37:4668 `--user-data-dir=/tmp/chrome --login-manager`
tfarina5b373372016-03-27 08:06:2169* Go through the out-of-the-box UX and sign in as
Matt Giucad8cebe42018-01-09 04:37:4670 **username@gmail.com**.
tfarina5b373372016-03-27 08:06:2171* For subsequent runs, add the following to the command line:
Matt Giucad8cebe42018-01-09 04:37:4672 `--user-data-dir=/tmp/chrome [email protected]`
73* To run in guest mode instantly, you can run add the arguments:
74 `--user-data-dir=/tmp/chrome --bwsi --incognito --login-user='$guest'
75 --login-profile=user`
tfarina5b373372016-03-27 08:06:2176
77Signing in as a specific user is useful for debugging features like sync
78that require a logged in user.
79
stevenjb89ee24b2016-04-19 19:26:4280## Compile Chromium for a Chromium OS device using the Chromium OS SDK
tfarina5b373372016-03-27 08:06:2181
stevenjbec7b4e3c2016-04-18 22:52:0282See [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:4283for information about building and testing chromium for Chromium OS.