| OLD | NEW |
| 1 # ChromeOS Build Instructions (Chromium OS on Linux) | 1 # ChromeOS Build Instructions (Chromium OS on Linux) |
| 2 | 2 |
| 3 Chromium on Chromium OS is built on a mix of code sourced from Chromium | 3 Chromium on Chromium OS is built on a mix of code sourced from Chromium |
| 4 on Linux and Chromium on Windows. Much of the user interface code is | 4 on Linux and Chromium on Windows. Much of the user interface code is |
| 5 shared with Chromium on Windows. As such, if you make a change to | 5 shared with Chromium on Windows. As such, if you make a change to |
| 6 Chromium on Windows you may find your changes affect Chromium on | 6 Chromium on Windows you may find your changes affect Chromium on |
| 7 Chromium OS. Fortunately to test the effect of your changes you don't | 7 Chromium OS. Fortunately to test the effect of your changes you don't |
| 8 have to build all of Chromium OS, you can just build Chromium for | 8 have to build all of Chromium OS, you can just build Chromium for |
| 9 Chromium OS directly on Linux. | 9 Chromium OS directly on Linux. |
| 10 | 10 |
| 11 First, follow the [normal Linux build | 11 First, follow the [normal Linux build |
| 12 instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux
_build_instructions.md) | 12 instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux
_build_instructions.md) |
| 13 as usual to get a Chromium checkout. | 13 as usual to get a Chromium checkout. |
| 14 | 14 |
| 15 ## Running Chromium on your local machine | 15 ## Building and running Chromium with Chromium OS UI on your local machine |
| 16 | 16 |
| 17 If you plan to test the Chromium build on your dev machine and not a | 17 If you plan to test the Chromium build on your dev machine and not a |
| 18 Chromium OS device run: | 18 Chromium OS device, run the following in your chromium checkout: |
| 19 | 19 |
| 20 ```shell | 20 $ gn gen out/Default --args='target_os="chromeos"' |
| 21 export GYP_DEFINES="chromeos=1" | 21 $ ninja -C out/Default |
| 22 gclient runhooks | 22 |
| 23 NOTE: You may wish to replace 'Default' with something like 'Cros' if |
| 24 you switch back and forth between Linux and Chromium OS builds, or 'Debug' |
| 25 if you want to differentiate between Debug and Release builds (see below) |
| 26 or DebugCros or whatever you like. |
| 27 |
| 28 Now, when you build, you will build with Chromium OS features turned on. |
| 29 |
| 30 See [GN Build Configuration](https://www.chromium.org/developers/gn-build-config
uration) |
| 31 for more information about configuring your build. |
| 32 |
| 33 Some additional options you may wish to set: |
| 34 ``` |
| 35 is_component_build = true |
| 36 use_goma = true |
| 37 is_debug = false # Release build |
| 38 dcheck_always_on = true # Enable DCHECK (with is_debug = false) |
| 39 is_official_build = true |
| 40 is_chrome_branded = true |
| 23 ``` | 41 ``` |
| 24 | 42 |
| 25 Now, once you build, you will build with Chromium OS features turned on. | 43 ## Notes |
| 26 | |
| 27 ### Notes | |
| 28 | 44 |
| 29 When you build Chromium OS Chromium, you'll be using the TOOLKIT\_VIEWS | 45 When you build Chromium OS Chromium, you'll be using the TOOLKIT\_VIEWS |
| 30 front-end just like Windows, so the files you'll probably want are in | 46 front-end just like Windows, so the files you'll probably want are in |
| 31 src/ui/views and src/chrome/browser/ui/views. | 47 src/ui/views and src/chrome/browser/ui/views. |
| 32 | 48 |
| 33 If chromeos=1 is specified, then toolkit\_views=0 must not be specified. | 49 When target_os = "chromeos", then toolkit\_views need not (and should not) |
| 50 be specified. |
| 34 | 51 |
| 35 The Chromium OS build requires a functioning GL so if you plan on | 52 The Chromium OS build requires a functioning GL so if you plan on |
| 36 testing it through Chromium Remote Desktop you might face drawing | 53 testing it through Chromium Remote Desktop you might face drawing |
| 37 problems (e.g. Aura window not painting anything). Possible remedies: | 54 problems (e.g. Aura window not painting anything). Possible remedies: |
| 38 | 55 |
| 39 * --ui-enable-software-compositing --ui-disable-threaded-compositing | 56 * --ui-enable-software-compositing --ui-disable-threaded-compositing |
| 40 * --use-gl=osmesa, but it's ultra slow, and you'll have to build | 57 * --use-gl=osmesa, but it's ultra slow, and you'll have to build |
| 41 osmesa yourself. | 58 osmesa yourself. |
| 42 * ... or just don't use Remote Desktop. :) | 59 * ... or just don't use Remote Desktop. :) |
| 43 | 60 |
| 44 Note the underscore in the GYP_DEFINES variable name, as people | |
| 45 sometimes mistakenly write it GYPDEFINES. | |
| 46 | |
| 47 To more closely match the UI used on devices, you can install fonts used | 61 To more closely match the UI used on devices, you can install fonts used |
| 48 by Chrome OS, such as Roboto, on your Linux distro. | 62 by Chrome OS, such as Roboto, on your Linux distro. |
| 49 | 63 |
| 50 To specify a logged in user: | 64 To specify a logged in user: |
| 51 | 65 |
| 52 * For first run, add the following options to the command line: | 66 * For first run, add the following options to the command line: |
| 53 **--user-data-dir=/tmp/chrome --login-manager** | 67 **--user-data-dir=/tmp/chrome --login-manager** |
| 54 * Go through the out-of-the-box UX and sign in as | 68 * Go through the out-of-the-box UX and sign in as |
| 55 **username@gmail.com** | 69 **username@gmail.com** |
| 56 * For subsequent runs, add the following to the command line: | 70 * For subsequent runs, add the following to the command line: |
| 57 **--user-data-dir=/tmp/chrome --login-user=username@gmail.com**. | 71 **--user-data-dir=/tmp/chrome --login-user=username@gmail.com**. |
| 58 * To run in guest mode instantly, you can run add the arguments | 72 * To run in guest mode instantly, you can run add the arguments |
| 59 **--user-data-dir=/tmp/chrome --bwsi --incognito | 73 **--user-data-dir=/tmp/chrome --bwsi --incognito |
| 60 --login-user='$guest' --login-profile=user** | 74 --login-user='$guest' --login-profile=user** |
| 61 | 75 |
| 62 Signing in as a specific user is useful for debugging features like sync | 76 Signing in as a specific user is useful for debugging features like sync |
| 63 that require a logged in user. | 77 that require a logged in user. |
| 64 | 78 |
| 65 ### Compile Testing Chromium with the Chromium OS SDK (quick version) | 79 ## Compile Testing Chromium with the Chromium OS SDK (quick version) |
| 66 | 80 |
| 67 Note: These instructions are intended for Chromium developers trying to | 81 See [Building Chromium for a Chromium OS device](https://www.chromium.org/chromi
um-os/how-tos-and-troubleshooting/building-chromium-browser) |
| 68 diagnose compile issues on Chromium OS, which can block changes in the | 82 for information about building & testing chromium for Chromium OS. |
| 69 CQ. See the [full | |
| 70 documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/b
uilding-chromium-browser) | |
| 71 for more information about building & testing chromium for Chromium OS. | |
| 72 | |
| 73 To do a build of Chromium that can run on Chromium OS itself, the Chromium OS | |
| 74 SDK must be used. The SDK provides all of chromium's dependencies as they are | |
| 75 distributed with Chromium OS (as opposed to other distributions such as Ubuntu). | |
| 76 | |
| 77 To enter the SDK build environment, run the following command (replace the value | |
| 78 of the `--board` flag with the name of the configuration you want to test). | |
| 79 | |
| 80 ```shell | |
| 81 cros chrome-sdk --board=amd64-generic --use-external-config | |
| 82 ``` | |
| 83 | |
| 84 Once in the SDK build environment, build using the normal linux workflow (except | |
| 85 for a different build directory): | |
| 86 | |
| 87 ```shell | |
| 88 gclient runhooks | |
| 89 ninja -C out_amd64-generic/Release chromium_builder_tests | |
| 90 ``` | |
| 91 | |
| 92 The current configurations verified by the CQ are: | |
| 93 | |
| 94 Board Flag | Build Directory | CPU architecture | |
| 95 --- | --- | --- | |
| 96 amd64-generic | out_amd64-generic | 64-bit Intel | |
| 97 x86-generic | out_x86-generic | 32-bit Intel | |
| 98 daisy | out_daisy | 32-bit ARM | |
| 99 | |
| 100 ## Running Chromium on a Chromium OS device | |
| 101 | |
| 102 Look at the [Chromium OS | |
| 103 documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/b
uilding-chromium-browser) | |
| 104 for the official flow for doing this. | |
| OLD | NEW |