Welcome to Chromium! If you're here, you want to learn how to check out the Chromium repository and contribute changes to the Chromium project. This guide will show you how to do that.
If you want to know how to go from checking the code out to making a small change and sending it out for review, here is a very detailed guide that explains all those steps.
Chromium supports building on Windows, Mac and Linux. You can also build the mobile versions, iOS (from Mac) and Android (from Linux).
Now, create a chromium directory for the checkout.
Mobile builds have their setup documented elsewhere:
You can fetch one of two targets:
Either way, the fetch can take more than a half hour on the fastest connections, and many hours on a slow connection.
If you're on Linux:
If you're on Mac, you need Xcode 5+ to build. (See MacBuildInstructions for more info).
If you're on Windows, you need Visual Studio 2013 in order to build (see Build Instructions (Windows) for more info; for Googlers, runhooks will install it automatically).
Finally, runhooks to run any post-sync scripts
For navigating the codebase, we recommend either browsing the repo or using the code search tool, but there are other ways to browse the Chromium code.
If you've checked out the code, you should see the following files and folders in the directory where you ran fetch:
ninja -C out/Debug chrome && out/Debug/chrome
Linux build instructions
ninja -C out/Debug chrome && out/Debug chrome
ChromeOS build instructions
ninja -C out\Debug chrome && out\Debug\chrome.exe
Windows build instructions
See build instructions.
Android build instructions
ninja -C out/Release chrome && out/Release/Chromium.app/Contents/MacOS/Chromium
Mac build instructions
See build instructions.
iOS build instructions
You can build other targets, such as unit_tests, by changing the target:
Targets are specified in the *.gyp and *.gypi files, in the targets section. Searching for 'target_name': in these files will give you a list of all the targets you can build. Some targets of interest are:
- chrome , which builds the main chrome executable
- unit_tests , which builds the main set of unit tests
- browser_tests , which builds Chrome's browser tests
You can run chrome with:
For a full list of command-line flags, see the *_switches.cc files.
You can run the unit tests, for example, with:
You can find out more about GoogleTest on the GoogleTest wiki page.
The best way to debug chrome depends on your platform:
You can find detailed instructions on how to submit your code on the depot_tools manpage:
Create a new review with:
This will upload your code to https://codereview.chromium.org/. You should then add reviewers (see wiki page) and submit your code for review. You can also run your code on the trybots to see if it passes all the tests:
For a full list of options, run git cl help , or for help with a particular command just append --help , e.g. git cl upload --help .
You can use branches in your local repository to help separate multiple changes you are submitting to the Chromium code. For more help with branches, see the Working with Branches tutorial, or the Managing Multiple CLs and Managing Dependent CLs sections of the man page. You can also set up multiple working directories to have multiple directories that build Chrome all share the same git database.
Chromium uses branches and tags to separate the various versions and releases it manages (see Working with Release Branches). The repository also contains many sub-repositories that point to external repos using the DEPS files (see the Working with Nested Repositories tutorial). Although we would prefer if you commit changes using the process above, sometimes you do need to commit or revert changes manually. You can also find out more about merging changes into release branches on the git-drover tutorial page:
If you can't get chrome to build and you're not sure why, try the following:
- Ensure your checkout has been properly updated ( git rebase-update )
- Check you're on a stable, unmodified branch from master ( git map-branches )
- Check you have no uncommitted changes ( git status )
- Check you have all the dependencies installed: try run gclient --version and ninja --version from your src/ directory
- Join the #chromium IRC channel on irc.freenode.net (see the IRC page for more info)
- E-mail firstname.lastname@example.org with your question, after taking the time to write it carefully. Note that this is not a support channel for chrome itself, just a forum for developers. You can also join the chromium-dev Google Group, or any other relevant technical discussion groups.
- If you think this is a serious problem that affects many users, file a new bug with the label 'Infra'. It will be looked at by our infrastructure team.
- Check out the legacy documentation for this page, or the other developer documentation available in this wiki
- If you work at Google, check out the Googler-specific Chrome documentation