chromeos_config: Add generic pre-cq builders for chromeos-{4.4,4.14,4.19}

The default generic builders are currently defined use kernel-4_14.
At the same time, amd64-generic-pre-cq and arm-generic-pre-cq are
specified in COMMIT-QUEUE.ini for chromeos-4.4, meaning the pre-cq
for chromeos-4.4 actually runs builds with chromeos-4.14 kernels.

On a higher level, generic builders are currently only supported for
only one kernel branch, even though we support many different kernel
branches. To solve the problem, add new per-release pre-cq builders
which override the default kernel version with the desired version.
This lets us run generic pre-cq builds on multiple kernel branches.

TEST=Run unit tests

Change-Id: I7a1a56d0d23494385adf1761d2467f4ad24f7319
Signed-off-by: Guenter Roeck <>
3 files changed
tree: 9f252bb0df244687604a7b1cfdafdae251f3cb94
  1. .dir-locals.el
  2. .env
  3. .gitignore
  4. .style.yapf
  5. .vpython
  6. .vscode/
  10. OWNERS
  11. PRESUBMIT.cfg
  12. README.chromium
  15. api/
  16. appengine/
  17. bin/
  18. bootstrap/
  19. cbuildbot/
  20. cidb/
  21. cli/
  22. codereview.settings
  23. config/
  24. contrib/
  25. cros/
  26. cros_bisect/
  27. lib/
  28. licensing/
  29. mobmonitor/
  30. pylintrc
  31. run_tests
  32. scripts/
  33. signing/
  34. ssh_keys/
  35. testingconfig/
  36. third_party/
  37. venv/

Chromite Development: Starter Guide


This doc tries to give an overview and head start to anyone just starting out on Chromite development.


Before you get started on Chromite, we recommend that you go through ChromeOS developer guides at external (first) and then goto/chromeos-building for internal. The Gerrit starter guide may also be helpful. You should flash a built image on a test device (Ask around for one!).

Chromite was intended to be the unified codebase for anything related to building ChromeOS/ChromiumOS. Currently, it is the codebase responsible for several things including: building the OS from the requisite packages for the necessary board (parallel_emerge), driving the infrastructure build workflow (CBuildBot), hosting a Google App Engine App, and providing utility functions for various scripts scattered around ChromeOS repositories. It is written for the most part in Python with some Bash sprinkled in.

Directory Overview

You can use Code Search to lookup things in Chromite or ChromeOS in general. You can add a ChromeOS filter to only show files from CrOS repositories by going to CS Settings and adding a new Saved query: “package:^chromeos” named “chromeos”.


CBuildBot is the collection of entire code that runs on both the parent and the child build machines. It kicks off the individual stages in a particular build. It is a configurable bot that builds ChromeOS. More details on CBuildBot can be found in this tech talk (slides).


This folder contains configurations of the different builders in use. Each has its own set of stages to run usually called under RunStages function. Most builders used regularly are derived from SimpleBuilder class.


Each file here has implementations of stages in the build process grouped by similarity. Each stage usually has PerformStage as its primary function.


Code here is expected to be imported whenever necessary throughout Chromite.


Unlike lib, code in scripts will not and should not be imported anywhere. Instead they are executed as required in the build process. Each executable is linked to either or Some of these links are in chromite/bin. The wrapper figures out the directory of the executable script and the $PYTHONPATH. Finally, it invokes the correct Python installation by moving up the directory structure to find which git repo is making the call.


This folder contains all the third_party python libraries required by Chromite. You need a very strong reason to add any library to the current list. Please confirm with the owners beforehand.


There are smaller folders with miscellaneous functions like config, licencing, cidb, etc.

Testing your Chromite changes

Before any testing, you should check your code for lint errors with:

$ cros lint <filename>

Unit Tests

Every Python file in Chromite is accompanied by a corresponding file. More on unit tests here. Once written, the unit tests can be run using ./run_tests command in the Chromite directory. To test a specific file (say lib/, use

~/trunk/chromite $ ./run_tests lib/triage_lib_unittest

Run_tests without any argument runs all unit tests in Chromite. These unit tests are run in tryjobs, preCQ and CQ as well.

If you have to create a new Python file in Chromite, you should also create a {filename} in the same directory with all the unit tests. Also make a link called {filename}_unittest to /mnt/host/source/chromite/scripts/ See the other unittest files around if unclear.


You can also fire a build on a server (or even locally) to have an entire build happen similar to how it would in Commit Queue.

$ cros tryjob -g <gerrit-change-id> <trybot-config>
$ cros tryjob -h -> for help on more options

Add --hwtest to add hardware testing to your tryjob. You can use the link provided by the command to check the status of your tryjob. Alternatively, you can go to the CI UI tryjobs page and filter results by your email.


Once you mark your CL as Trybot-ready on Chromium Gerrit, the PreCQ will pick up your change and fire few preset config runs as a precursor to CQ. Currently, it doesn’t include any hardware or VM testing (for now!).

Commit Queue

This is the final step in getting your change pushed. CQ is the most comprehensive of all tests. There are a multitude of CL's being validated in the same CQ. Once a CL is verified by CQ, it is merged into the codebase.

How does ChromeOS build work?

Refer to these talk slides on ChromeOS Build Overview.