the Chromium logo

The Chromium Projects

Checkout Chromium

Some development tasks may require working in the chromium repository, the chromiumos repository, or both. If you only need to work in the chromiumos repository, you can jump ahead to the Checkout ChromiumOS page.

This page details the steps to create the initial checkout of the chromium repository, including configuring the checkout and providing authentication if you are syncing from the internal repository.

Create a directory to host the Chromium checkout

$ mkdir chromium && cd chromium

All commands relevant to the Chromium checkout from here assume the present working directory is the directory you created above and have this prefix:

chromium$ <command>

Checkout the chromium repository

fetch is a binary provided by depot_tools. --nohooks tells fetch not to run any post-fetch executions steps which are not necessary at this stage. This step can take around 30 minutes depending on your connection speed.

chromium$ fetch --nohooks chromium

Checkout the chrome-internal repository

If you have access to the chrome-internal repository (e.g., Googlers and other authorized partners) in order to build a ChromeOS-branded binary, follow the steps below to configure the checkout and provide authentication.

Configure gclient args

gclient is the tool used to download code and resources from the various repositories (e.g., the chromium Git repository) necessary to build ChromiumOS. The .gclient configuration file provides variables which affect which repositories are synced and how they are set up.

To configure your gclient checkout to include the chrome-internal repository, edit your chromium/.gclientfile to include thecheckout_src_internalvariable. Thecros_boardsvariable pulls down board-specific code. Finally, thetarget_os` variable pulls down ChromeOS-specific code.

solutions = [
  {
    "url": "https://chromium.googlesource.com/chromium/src.git",
    "managed": False,
    "name": "src",
    "custom_deps": {},
    "custom_vars": {
      "checkout_src_internal": True,
      "cros_boards": "eve:puff:scarlet",
    },
  },
]
target_os = ['chromeos']

Note that in this example we've specified the boards eve, puff, and scarlet separated by colons. Whenever you get a new test device be sure to add or set the board name here and re-sync.

Authenticate to the internal repository

Navigate to the Chrome internal review page and login with your access-enabled account (@google.com for Googlers). Then authenticate to the internal repository by navigating to the googlesource.com authentication portal, authenticating with your access-enabled account, and executing the provided command in your shell. This command creates an authentication cookie for Git such that you do not need to continually provide authentication to access these resources.

Authenticate to CIPD

CIPD (Chrome Infrastructure Package Deployment) is a repository which hosts versioned binaries. The ChromeOS source checkout includes several dependencies hosted on CIPD. Authenticate to CIPD using the following command (provided by depot_tools):

$ cipd auth-login

Initial gclient sync

gclient sync downloads the external dependencies that chromium (public and internal) need but don't host (e.g., external libraries like Abseil). These external dependencies are hosted in third_party/.

The first gclient sync command you'll run uses the --nohooks flag; you shouldn't need this flag for subsequent uses of gclient sync. You'll need to run gclient sync again each time you pull down from the chromium main git branch (because new dependencies will have been introduced). Read more about this subsequent gclient sync usage in the (Development workflow with git page - TODO(jhawkins)).

chromium$ gclient sync --nohooks

The initial sync of a checkout can take a significant amount of time (up to an hour).

Up next

Now that you have the code, the next step is to build the Chromium binary.

< Setup Chromebook
Build Chromium >