Steps to clone:
- Follow the instructions on how to get the code with these amendments:
- If the build toolchain can't find the MacOS SDK, run
python3 ./build/mac/find_sdk.py 10.6to help find the root cause. - After cloning the
depot_toolsrepository, copyfetch_configs/chromium.pytofetch_configs/chromium-emereum.pyand replace the repository url with this repository url. - Before running
gn gen out/Defaultread the following section:
Chromium can be built in several ways:
- The default is a debug build. To do a release build add is_debug = false
- The default is a static build. To do a component build add is_component_build = true
- The default is a developer build. To do an official build, set is_official_build = true
- The default is Chromium branding. To do Chrome branding, set is_chrome_branded = true
sources:
- [https://chromium.googlesource.com/chromium/src/+/eca97f87e275a7c9c5b7f13a65ff8635f0821d46/tools/gn/docs/faq.md]
- gn-build-configuration
- build/config/BUILDCONFIG.gn, especially this remark:
# IMPORTANT NOTE: (!is_debug) is *not* sufficient to get satisfying # performance. In particular, DCHECK()s are still enabled for release builds, # which can halve overall performance, and do increase memory usage. Always # set "is_official_build" to true for any build intended to ship to end-users.
Based on the above you may want to set up two build directories:
- Run
gn gen out/Default - Add this to
out/Default/args.gn:
target_cpu = "arm64"
host_cpu = "arm64"
enable_nacl = false
symbol_level = 0
is_debug = false
is_component_build = true
- Run
gen gen out/Official - Add this to
out/Official/args.gn:
target_cpu = "arm64"
host_cpu = "arm64"
enable_nacl = false
symbol_level = 0
is_debug = false
is_component_build = false
is_official_build = true
When you first attempt an Official build it will complain about missing PGO profiles. Follow the instructions in the error message to retrieve them.
Other references for build config:
- [https://www.chromium.org/developers/gn-build-configuration/]
- [https://chromium.googlesource.com/chromium/src/+/eca97f87e275a7c9c5b7f13a65ff8635f0821d46/tools/gn/docs/faq.md]
- Check your release version in chrome://version (on your production Chrome install, not Chromium)
- Use the guide here with some differences:
- Sync this fork first
- Since the github mirror of Chromium does not have the
branch-headsbranches, we need to grab the nearest commit onmain. For example if your revision in chrome://version is6668then: - Navigate to https://chromium.googlesource.com/chromium/src.git/+log/refs/branch-heads/6668
- Find the
Cr-Branched-Fromcommit in latest commit above. - Check out that commit
- Run
gclient sync --with_branch_heads --with_tags - You should now have a branch slightly behind your official Chrome release but still close to it which you can build and ship to users.
- Spot check a submodule, e.g.
pushd third_party/angle && git statusto check that it's on a matching branch (something likechromium/6668notmain) - After building, compare chrome://version and chrome://gpu between Chrome and your Chromium build. Everything should match.
- run
gclient runhooksagain to fetch PGO data
autoninja -C out/Official chrome
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead,
follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.