Make some small tweaks to the build instructions.
- Standardize on fenced code blocks, add 'shell' where appropriate. - Add '$' to shell commands where missing. - Add `code` marks to more identifiers. - Minor stylistic/grammatical suggestions. R=dpranke@chromium.org, teresam@google.com Review-Url: https://codereview.chromium.org/2536723008 Cr-Commit-Position: refs/heads/master@{#435508}
This commit is contained in:
docs
android_build_instructions.mdios_build_instructions.mdlinux_arch_build_instructions.mdlinux_build_instructions.mdlinux_debian_build_instructions.mdlinux_fedora_build_instructions.mdlinux_mandriva_build_instructions.mdlinux_open_suse_build_instructions.mdmac_build_instructions.mdwindows_build_instructions.md
@ -14,137 +14,163 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
|
|||||||
* You must have Git and Python installed already.
|
* You must have Git and Python installed already.
|
||||||
|
|
||||||
Most development is done on Ubuntu. Other distros may or may not work;
|
Most development is done on Ubuntu. Other distros may or may not work;
|
||||||
see the [linux instructions](linux_build_instructions.md) for some suggestions.
|
see the [Linux instructions](linux_build_instructions.md) for some suggestions.
|
||||||
|
|
||||||
Building the Android client on Windows or Mac is not supported and doesn't work.
|
Building the Android client on Windows or Mac is not supported and doesn't work.
|
||||||
|
|
||||||
## Install `depot_tools`
|
## Install `depot_tools`
|
||||||
|
|
||||||
Clone the depot_tools repository:
|
Clone the `depot_tools` repository:
|
||||||
|
|
||||||
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
```shell
|
||||||
|
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
```
|
||||||
|
|
||||||
Add depot_tools to the end of your PATH (you will probably want to put this
|
Add `depot_tools` to the end of your PATH (you will probably want to put this
|
||||||
in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools
|
in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools`
|
||||||
to /path/to/depot_tools:
|
to `/path/to/depot_tools`:
|
||||||
|
|
||||||
$ export PATH=$PATH:/path/to/depot_tools
|
```shell
|
||||||
|
$ export PATH="$PATH:/path/to/depot_tools"
|
||||||
|
```
|
||||||
|
|
||||||
## Get the code
|
## Get the code
|
||||||
|
|
||||||
Create a chromium directory for the checkout and change to it (you can call
|
Create a `chromium` directory for the checkout and change to it (you can call
|
||||||
this whatever you like and put it wherever you like, as
|
this whatever you like and put it wherever you like, as
|
||||||
long as the full path has no spaces):
|
long as the full path has no spaces):
|
||||||
|
|
||||||
$ mkdir ~/chromium && cd ~/chromium
|
```shell
|
||||||
$ fetch --nohooks android
|
$ mkdir ~/chromium && cd ~/chromium
|
||||||
|
$ fetch --nohooks android
|
||||||
|
```
|
||||||
|
|
||||||
If you don't want the full repo history, you can save a lot of time by
|
If you don't want the full repo history, you can save a lot of time by
|
||||||
adding the `--no-history` flag to fetch.
|
adding the `--no-history` flag to `fetch`.
|
||||||
|
|
||||||
Expect the command to take 30 minutes on even a fast connection, and many
|
Expect the command to take 30 minutes on even a fast connection, and many
|
||||||
hours on slower ones.
|
hours on slower ones.
|
||||||
|
|
||||||
If you've already installed the build dependencies on the machine (from another
|
If you've already installed the build dependencies on the machine (from another
|
||||||
checkout, for example), you can omit the `--nohooks` flag and fetch
|
checkout, for example), you can omit the `--nohooks` flag and `fetch`
|
||||||
will automatically execute `gclient runhooks` at the end.
|
will automatically execute `gclient runhooks` at the end.
|
||||||
|
|
||||||
When fetch completes, it will have created a directory called `src`.
|
When `fetch` completes, it will have created a hidden `.gclient` file and a
|
||||||
The remaining instructions assume you are now in that directory:
|
directory called `src` in the working directory. The remaining instructions
|
||||||
|
assume you have switched to the `src` directory:
|
||||||
|
|
||||||
$ cd src
|
```shell
|
||||||
|
$ cd src
|
||||||
|
```
|
||||||
|
|
||||||
### Converting an existing Linux checkout
|
### Converting an existing Linux checkout
|
||||||
|
|
||||||
If you have an existing Linux checkout, you can add Android support by
|
If you have an existing Linux checkout, you can add Android support by
|
||||||
appending `target_os = ['android']` to your .gclient file (in the
|
appending `target_os = ['android']` to your `.gclient` file (in the
|
||||||
directory above src):
|
directory above `src`):
|
||||||
|
|
||||||
$ echo "target_os = [ 'android' ]" >> ../.gclient
|
```shell
|
||||||
|
$ echo "target_os = [ 'android' ]" >> ../.gclient
|
||||||
|
```
|
||||||
|
|
||||||
Then run gclient sync to pull the new Android dependencies:
|
Then run `gclient sync` to pull the new Android dependencies:
|
||||||
|
|
||||||
gclient sync
|
```shell
|
||||||
|
$ gclient sync
|
||||||
|
```
|
||||||
|
|
||||||
(This is actually the difference between `fetch android` and `fetch chromium`).
|
(This is the only difference between `fetch android` and `fetch chromium`.)
|
||||||
|
|
||||||
### Install additional build dependencies
|
### Install additional build dependencies
|
||||||
|
|
||||||
Once you have checked out the code, run
|
Once you have checked out the code, run
|
||||||
|
|
||||||
build/install-build-deps-android.sh
|
```shell
|
||||||
|
$ build/install-build-deps-android.sh
|
||||||
|
```
|
||||||
|
|
||||||
to get all of the dependencies you need to build on Linux *plus* all of the
|
to get all of the dependencies you need to build on Linux, *plus* all of the
|
||||||
Android-specific dependencies (you need some of the regular Linux dependencies
|
Android-specific dependencies (you need some of the regular Linux dependencies
|
||||||
because an Android build builds a bunch of the Linux tools and utilities).
|
because an Android build includes a bunch of the Linux tools and utilities).
|
||||||
|
|
||||||
### Run the hooks
|
### Run the hooks
|
||||||
|
|
||||||
Once you've run `install-build-deps` at least once, you can now run the
|
Once you've run `install-build-deps` at least once, you can now run the
|
||||||
chromium-specific hooks, which will download additional binaries and other
|
Chromium-specific hooks, which will download additional binaries and other
|
||||||
things you might need:
|
things you might need:
|
||||||
|
|
||||||
$ gclient runhooks
|
```shell
|
||||||
|
$ gclient runhooks
|
||||||
|
```
|
||||||
|
|
||||||
*Optional*: You can also [install API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
*Optional*: You can also [install API
|
||||||
if you want to talk to some of the Google services, but this is not necessary
|
keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
|
||||||
for most development and testing purposes.
|
build to talk to some Google services, but this is not necessary for most
|
||||||
|
development and testing purposes.
|
||||||
|
|
||||||
### Configure the JDK
|
### Configure the JDK
|
||||||
|
|
||||||
Make also sure that OpenJDK 1.7 is selected as default:
|
Make also sure that OpenJDK 1.7 is selected as default:
|
||||||
|
|
||||||
`sudo update-alternatives --config javac`
|
```shell
|
||||||
`sudo update-alternatives --config java`
|
$ sudo update-alternatives --config javac
|
||||||
`sudo update-alternatives --config javaws`
|
$ sudo update-alternatives --config java
|
||||||
`sudo update-alternatives --config javap`
|
$ sudo update-alternatives --config javaws
|
||||||
`sudo update-alternatives --config jar`
|
$ sudo update-alternatives --config javap
|
||||||
`sudo update-alternatives --config jarsigner`
|
$ sudo update-alternatives --config jar
|
||||||
|
$ sudo update-alternatives --config jarsigner
|
||||||
|
```
|
||||||
|
|
||||||
## Setting up the Build
|
## Setting up the Build
|
||||||
|
|
||||||
Chromium uses [Ninja](https://ninja-build.org) as its main build tool, and
|
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
|
||||||
a tool called [GN](../tools/gn/docs/quick_start.md) to generate
|
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
|
||||||
the .ninja files to do the build. To create a build directory configured
|
files. You can create any number of *build directories* with different
|
||||||
to build Android, run:
|
configurations. To create a build directory which builds Chrome for Android,
|
||||||
|
run:
|
||||||
|
|
||||||
$ gn gen '--args="target_os="android"' out/Default
|
```shell
|
||||||
|
$ gn gen '--args="target_os="android"' out/Default
|
||||||
|
```
|
||||||
|
|
||||||
* You only have to do run this command once, it will self-update the build
|
* You only have to run this once for each new build directory, Ninja will
|
||||||
files as needed after that.
|
update the build files as needed.
|
||||||
* You can replace `out/Default` with another directory name, but we recommend
|
* You can replace `Default` with another name, but
|
||||||
it should still be a subdirectory of `out`.
|
it should be a subdirectory of `out`.
|
||||||
* To specify build parameters for GN builds, including release settings,
|
* For other build arguments, including release settings, see [GN build
|
||||||
see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration).
|
configuration](https://www.chromium.org/developers/gn-build-configuration).
|
||||||
The default will be a debug component build matching the current host
|
The default will be a debug component build matching the current host
|
||||||
operating system and CPU.
|
operating system and CPU.
|
||||||
* For more info on GN, run `gn help` on the command line or read the
|
* For more info on GN, run `gn help` on the command line or read the
|
||||||
[quick start guide](../tools/gn/docs/quick_start.md).
|
[quick start guide](../tools/gn/docs/quick_start.md).
|
||||||
|
|
||||||
Also be aware that some scripts (e.g. tombstones.py, adb_gdb.py)
|
Also be aware that some scripts (e.g. `tombstones.py`, `adb_gdb.py`)
|
||||||
require you to set `CHROMIUM_OUTPUT_DIR=out/Default`.
|
require you to set `CHROMIUM_OUTPUT_DIR=out/Default`.
|
||||||
|
|
||||||
## Build Chromium
|
## Build Chromium
|
||||||
|
|
||||||
Build Chromium with Ninja using the command:
|
Build Chromium with Ninja using the command:
|
||||||
|
|
||||||
$ ninja -C out/Default chrome_public_apk
|
```shell
|
||||||
|
$ ninja -C out/Default chrome_public_apk
|
||||||
|
```
|
||||||
|
|
||||||
|
You can get a list of all of the other build targets from GN by running `gn ls
|
||||||
|
out/Default` from the command line. To compile one, pass the GN label to Ninja
|
||||||
|
with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C
|
||||||
|
out/Default chrome/test:unit_tests`).
|
||||||
|
|
||||||
You can get a list of all of the other build targets from GN by running
|
|
||||||
`gn ls out/Default` from the command line. To compile one, pass to Ninja
|
|
||||||
the GN label with no preceding "//" (so for `//chrome/test:unit_tests`
|
|
||||||
use ninja -C out/Default chrome/test:unit_tests`).
|
|
||||||
## Installing and Running Chromium on a device
|
## Installing and Running Chromium on a device
|
||||||
|
|
||||||
If the `adb_install_apk.py` script below fails, make sure aapt is in
|
If the `adb_install_apk.py` script below fails, make sure `aapt` is in your
|
||||||
your PATH. If not, add aapt's path to your PATH environment variable (it
|
PATH. If not, add `aapt`'s parent directory to your `PATH` environment variable
|
||||||
should be
|
(it should be
|
||||||
`/path/to/src/third_party/android_tools/sdk/build-tools/{latest_version}/`).
|
`/path/to/src/third_party/android_tools/sdk/build-tools/{latest_version}/`).
|
||||||
|
|
||||||
Prepare the environment:
|
Prepare the environment:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
. build/android/envsetup.sh
|
$ . build/android/envsetup.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Plug in your Android device
|
### Plug in your Android device
|
||||||
|
@ -10,77 +10,87 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
|
|||||||
|
|
||||||
* A 64-bit Mac running 10.11+.
|
* A 64-bit Mac running 10.11+.
|
||||||
* [Xcode](https://developer.apple.com/xcode) 8.0+.
|
* [Xcode](https://developer.apple.com/xcode) 8.0+.
|
||||||
* The OSX 10.10 SDK. Run
|
* The OS X 10.10 SDK. Run
|
||||||
|
|
||||||
ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
|
```shell
|
||||||
|
$ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
|
||||||
|
```
|
||||||
|
|
||||||
to check whether you have it. Building with the 10.11 SDK works too, but
|
to check whether you have it. Building with the 10.11 SDK works too, but
|
||||||
the releases currently use the 10.10 SDK.
|
the releases currently use the 10.10 SDK.
|
||||||
* The current version of the JDK (which is required for the Closure compiler).
|
* The current version of the JDK (required for the Closure compiler).
|
||||||
|
|
||||||
## Install `depot_tools`
|
## Install `depot_tools`
|
||||||
|
|
||||||
Clone the depot_tools repository:
|
Clone the `depot_tools` repository:
|
||||||
|
|
||||||
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
```shell
|
||||||
|
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
```
|
||||||
|
|
||||||
Add depot_tools to the end of your PATH (you will probably want to put this
|
Add `depot_tools` to the end of your PATH (you will probably want to put this
|
||||||
in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools
|
in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
|
||||||
to /path/to/depot_tools:
|
`/path/to/depot_tools`:
|
||||||
|
|
||||||
$ export PATH=$PATH:/path/to/depot_tools
|
```shell
|
||||||
|
$ export PATH="$PATH:/path/to/depot_tools"
|
||||||
|
```
|
||||||
|
|
||||||
## Get the code
|
## Get the code
|
||||||
|
|
||||||
Create a chromium directory for the checkout and change to it (you can call
|
Create a `chromium` directory for the checkout and change to it (you can call
|
||||||
this whatever you like and put it wherever you like, as
|
this whatever you like and put it wherever you like, as
|
||||||
long as the full path has no spaces):
|
long as the full path has no spaces):
|
||||||
|
|
||||||
$ mkdir chromium
|
|
||||||
$ cd chromium
|
|
||||||
|
|
||||||
Run the `fetch` tool from depot_tools to check out the code and its
|
```shell
|
||||||
|
$ mkdir chromium && cd chromium
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the `fetch` tool from `depot_tools` to check out the code and its
|
||||||
dependencies.
|
dependencies.
|
||||||
|
|
||||||
$ fetch ios
|
```shell
|
||||||
|
$ fetch ios
|
||||||
(This is identical to `fetch chromium`, except that it sets `target_os=["ios"]`
|
```
|
||||||
in your `.gclient` file.
|
|
||||||
|
|
||||||
If you don't want the full repo history, you can save a lot of time by
|
If you don't want the full repo history, you can save a lot of time by
|
||||||
adding the `--no-history` flag to fetch. Expect the command to take
|
adding the `--no-history` flag to `fetch`.
|
||||||
30 minutes on even a fast connection, and many hours on slower ones.
|
|
||||||
|
|
||||||
When fetch completes, it will have created a directory called `src`.
|
Expect the command to take 30 minutes on even a fast connection, and many
|
||||||
The remaining instructions assume you are now in that directory:
|
hours on slower ones.
|
||||||
|
|
||||||
$ cd src
|
When `fetch` completes, it will have created a hidden `.gclient` file and a
|
||||||
|
directory called `src` in the working directory. The remaining instructions
|
||||||
|
assume you have switched to the `src` directory:
|
||||||
|
|
||||||
*Optional*: You can also [install API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
```shell
|
||||||
if you want to talk to some of the Google services, but this is not necessary
|
$ cd src
|
||||||
for most development and testing purposes.
|
```
|
||||||
|
|
||||||
|
*Optional*: You can also [install API
|
||||||
|
keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
|
||||||
|
build to talk to some Google services, but this is not necessary for most
|
||||||
|
development and testing purposes.
|
||||||
|
|
||||||
## Setting up the build
|
## Setting up the build
|
||||||
|
|
||||||
Since the iOS build is a bit more complicated than a desktop build, we
|
Since the iOS build is a bit more complicated than a desktop build, we provide
|
||||||
provide the `ios/build/tools/setup-gn.py`, which will create four
|
`ios/build/tools/setup-gn.py`, which will create four appropriately configured
|
||||||
appropriately configured build directories under `out` for Release and
|
build directories under `out` for Release and Debug device and simulator
|
||||||
Debug device and simulator builds, and generates an appropriate Xcode
|
builds, and generates an appropriate Xcode workspace as well.
|
||||||
workspace as well.
|
|
||||||
|
|
||||||
This script is run automatically by fetch (as part of `gclient runhooks`).
|
This script is run automatically by fetch (as part of `gclient runhooks`).
|
||||||
|
|
||||||
You can customize the build by editing the file `$HOME/.setup-gn` (create it
|
You can customize the build by editing the file `$HOME/.setup-gn` (create it if
|
||||||
if it does not exists). Look at `src/ios/build/tools/setup-gn.config` for
|
it does not exist). Look at `src/ios/build/tools/setup-gn.config` for
|
||||||
available configuration options.
|
available configuration options.
|
||||||
|
|
||||||
From this point, you can either build from Xcode or from the command-line
|
From this point, you can either build from Xcode or from the command line using
|
||||||
using `ninja`. The script `setup-gn.py` creates sub-directories named
|
`ninja`. `setup-gn.py` creates sub-directories named
|
||||||
`out/${configuration}-${platform}`, so for a `Debug` build for simulator
|
`out/${configuration}-${platform}`, so for a `Debug` build for simulator use:
|
||||||
use:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ninja -C out/Debug-iphonesimulator gn_all
|
$ ninja -C out/Debug-iphonesimulator gn_all
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: you need to run `setup-gn.py` script every time one of the `BUILD.gn`
|
Note: you need to run `setup-gn.py` script every time one of the `BUILD.gn`
|
||||||
@ -88,42 +98,43 @@ file is updated (either by you or after rebasing). If you forget to run it,
|
|||||||
the list of targets and files in the Xcode solution may be stale.
|
the list of targets and files in the Xcode solution may be stale.
|
||||||
|
|
||||||
You can also follow the manual instructions on the
|
You can also follow the manual instructions on the
|
||||||
[mac page](mac_build_instructions.md), but make sure you set the
|
[Mac page](mac_build_instructions.md), but make sure you set the
|
||||||
GN arg `target_os="ios"`.
|
GN arg `target_os="ios"`.
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
Any target that is built and runs on the bots (see [below](#Troubleshooting))
|
Any target that is built and runs on the bots (see [below](#Troubleshooting))
|
||||||
should run successfully in a local build. As of the time of writing, this is
|
should run successfully in a local build. As of the time of writing, this is
|
||||||
only ios_web_shell and unit test targets—see the note at the top of this
|
only the `ios_web_shell` and `ios_chrome_unittests` targets—see the note at the
|
||||||
page. Check the bots periodically for updates; more targets (new components)
|
top of this page. Check the bots periodically for updates; more targets (new
|
||||||
will come on line over time.
|
components) will come on line over time.
|
||||||
|
|
||||||
To run in the simulator from the command line, you can use `iossim`. For
|
To run in the simulator from the command line, you can use `iossim`. For
|
||||||
example, to run a debug build of ios_web_shell:
|
example, to run a debug build of `ios_web_shell`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
out/Debug-iphonesimulator/iossim out/Debug-iphonesimulator/ios_web_shell.app
|
$ out/Debug-iphonesimulator/iossim out/Debug-iphonesimulator/ios_web_shell.app
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update your checkout
|
## Update your checkout
|
||||||
|
|
||||||
To update an existing checkout, you can run
|
To update an existing checkout, you can run
|
||||||
|
|
||||||
$ git rebase-update
|
```shell
|
||||||
$ gclient sync
|
$ git rebase-update
|
||||||
|
$ gclient sync
|
||||||
|
```
|
||||||
|
|
||||||
The first command updates the primary Chromium source repository and rebases
|
The first command updates the primary Chromium source repository and rebases
|
||||||
any of your local branches on top of tip-of-tree (aka the Git branch `origin/master`).
|
any of your local branches on top of tip-of-tree (aka the Git branch
|
||||||
If you don't want to use this script, you can also just use `git pull` or
|
`origin/master`). If you don't want to use this script, you can also just use
|
||||||
other common Git commands to update the repo.
|
`git pull` or other common Git commands to update the repo.
|
||||||
|
|
||||||
The second command syncs the subrepositories to the appropriate versions and
|
The second command syncs dependencies to the appropriate versions and re-runs
|
||||||
re-runs the hooks as needed.
|
hooks as needed.
|
||||||
|
|
||||||
## Tips, tricks, and troubleshooting
|
## Tips, tricks, and troubleshooting
|
||||||
|
|
||||||
|
|
||||||
If you have problems building, join us in `#chromium` on `irc.freenode.net` and
|
If you have problems building, join us in `#chromium` on `irc.freenode.net` and
|
||||||
ask there. As mentioned above, be sure that the
|
ask there. As mentioned above, be sure that the
|
||||||
[waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the tree
|
[waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the tree
|
||||||
@ -132,43 +143,54 @@ is open before checking out. This will increase your chances of success.
|
|||||||
### Improving performance of `git status`
|
### Improving performance of `git status`
|
||||||
|
|
||||||
`git status` is used frequently to determine the status of your checkout. Due
|
`git status` is used frequently to determine the status of your checkout. Due
|
||||||
to the number of files in Chromium's checkout, `git status` performance can be
|
to the large number of files in Chromium's checkout, `git status` performance
|
||||||
quite variable. Increasing the system's vnode cache appears to help. By
|
can be quite variable. Increasing the system's vnode cache appears to help.
|
||||||
default, this command:
|
By default, this command:
|
||||||
|
|
||||||
sysctl -a | egrep kern\..*vnodes
|
```shell
|
||||||
|
$ sysctl -a | egrep kern\..*vnodes
|
||||||
|
```
|
||||||
|
|
||||||
Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
|
Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
|
||||||
setting:
|
setting:
|
||||||
|
|
||||||
sudo sysctl kern.maxvnodes=$((512*1024))
|
```shell
|
||||||
|
$ sudo sysctl kern.maxvnodes=$((512*1024))
|
||||||
|
```
|
||||||
|
|
||||||
Higher values may be appropriate if you routinely move between different
|
Higher values may be appropriate if you routinely move between different
|
||||||
Chromium checkouts. This setting will reset on reboot, the startup setting can
|
Chromium checkouts. This setting will reset on reboot, the startup setting can
|
||||||
be set in `/etc/sysctl.conf`:
|
be set in `/etc/sysctl.conf`:
|
||||||
|
|
||||||
echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
|
```shell
|
||||||
|
$ echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
|
||||||
|
```
|
||||||
|
|
||||||
Or edit the file directly.
|
Or edit the file directly.
|
||||||
|
|
||||||
If your `git --version` reports 2.6 or higher, the following may also improve
|
If `git --version` reports 2.6 or higher, the following may also improve
|
||||||
performance of `git status`:
|
performance of `git status`:
|
||||||
|
|
||||||
git update-index --untracked-cache
|
```shell
|
||||||
|
$ git update-index --untracked-cache
|
||||||
|
```
|
||||||
|
|
||||||
### Xcode license agreement
|
### Xcode license agreement
|
||||||
|
|
||||||
If you're getting the error
|
If you're getting the error
|
||||||
|
|
||||||
```
|
> Agreeing to the Xcode/iOS license requires admin privileges, please re-run as
|
||||||
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
|
> root via sudo.
|
||||||
```
|
|
||||||
|
|
||||||
the Xcode license hasn't been accepted yet which (contrary to the message) any
|
the Xcode license hasn't been accepted yet which (contrary to the message) any
|
||||||
user can do by running:
|
user can do by running:
|
||||||
|
|
||||||
xcodebuild -license
|
```shell
|
||||||
|
$ xcodebuild -license
|
||||||
|
```
|
||||||
|
|
||||||
Only accepting for all users of the machine requires root:
|
Only accepting for all users of the machine requires root:
|
||||||
|
|
||||||
sudo xcodebuild -license
|
```shell
|
||||||
|
$ sudo xcodebuild -license
|
||||||
|
```
|
||||||
|
@ -3,18 +3,21 @@
|
|||||||
Generally speaking, follow the [Linux Build Instructions](linux_build_instructions.md).
|
Generally speaking, follow the [Linux Build Instructions](linux_build_instructions.md).
|
||||||
However, do the following instead to install the build dependencies:
|
However, do the following instead to install the build dependencies:
|
||||||
|
|
||||||
## Install the build dependencies:
|
## Install the build dependencies
|
||||||
|
|
||||||
Most of these packages are probably already installed since they're often used,
|
Most of these packages are probably already installed since they're often used,
|
||||||
and the parameter --needed ensures that packages up to date are not reinstalled.
|
and the `--needed` parameter ensures that up-to-date packages are not
|
||||||
|
reinstalled.
|
||||||
|
|
||||||
sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
|
```shell
|
||||||
nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
|
$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
|
||||||
libgnome-keyring
|
nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
|
||||||
|
libgnome-keyring
|
||||||
|
```
|
||||||
|
|
||||||
For the optional packages on Arch Linux:
|
For the optional packages on Arch Linux:
|
||||||
|
|
||||||
* php-cgi is provided with pacman
|
* `php-cgi` is provided with `pacman`
|
||||||
* wdiff is not in the main repository but dwdiff is. You can get wdiff in
|
* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
|
||||||
AUR/yaourt
|
in AUR/`yaourt`
|
||||||
* sun-java6-fonts do not seem to be in main repository or AUR.
|
* `sun-java6-fonts` do not seem to be in main repository or AUR.
|
||||||
|
@ -13,49 +13,59 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
|
|||||||
* At least 100GB of free disk space.
|
* At least 100GB of free disk space.
|
||||||
* You must have Git and Python installed already.
|
* You must have Git and Python installed already.
|
||||||
|
|
||||||
Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are
|
Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are
|
||||||
some instructions for other distros below, but they are mostly unsupported.
|
some instructions for other distros below, but they are mostly unsupported.
|
||||||
|
|
||||||
## Install `depot_tools`
|
## Install `depot_tools`
|
||||||
|
|
||||||
Clone the depot_tools repository:
|
Clone the `depot_tools` repository:
|
||||||
|
|
||||||
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
```shell
|
||||||
|
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
```
|
||||||
|
|
||||||
Add depot_tools to the end of your PATH (you will probably want to put this
|
Add `depot_tools` to the end of your PATH (you will probably want to put this
|
||||||
in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools
|
in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
|
||||||
to /path/to/depot_tools:
|
`/path/to/depot_tools`:
|
||||||
|
|
||||||
$ export PATH=$PATH:/path/to/depot_tools
|
```shell
|
||||||
|
$ export PATH="$PATH:/path/to/depot_tools"
|
||||||
|
```
|
||||||
|
|
||||||
## Get the code
|
## Get the code
|
||||||
|
|
||||||
Create a chromium directory for the checkout and change to it (you can call
|
Create a `chromium` directory for the checkout and change to it (you can call
|
||||||
this whatever you like and put it wherever you like, as
|
this whatever you like and put it wherever you like, as long as the full path
|
||||||
long as the full path has no spaces):
|
has no spaces):
|
||||||
|
|
||||||
$ mkdir chromium
|
```shell
|
||||||
$ cd chromium
|
$ mkdir ~/chromium && cd ~/chromium
|
||||||
|
```
|
||||||
|
|
||||||
Run the `fetch` tool from depot_tools to check out the code and its
|
Run the `fetch` tool from depot_tools to check out the code and its
|
||||||
dependencies.
|
dependencies.
|
||||||
|
|
||||||
$ fetch --nohooks chromium
|
```shell
|
||||||
|
$ fetch --nohooks chromium
|
||||||
|
```
|
||||||
|
|
||||||
If you don't want the full repo history, you can save a lot of time by
|
If you don't want the full repo history, you can save a lot of time by
|
||||||
adding the `--no-history` flag to fetch.
|
adding the `--no-history` flag to `fetch`.
|
||||||
|
|
||||||
Expect the command to take 30 minutes on even a fast connection, and many
|
Expect the command to take 30 minutes on even a fast connection, and many
|
||||||
hours on slower ones.
|
hours on slower ones.
|
||||||
|
|
||||||
If you've already installed the build dependencies on the machine (from another
|
If you've already installed the build dependencies on the machine (from another
|
||||||
checkout, for example), you can omit the `--nohooks` flag and fetch
|
checkout, for example), you can omit the `--nohooks` flag and `fetch`
|
||||||
will automatically execute `gclient runhooks` at the end.
|
will automatically execute `gclient runhooks` at the end.
|
||||||
|
|
||||||
When fetch completes, it will have created a directory called `src`.
|
When `fetch` completes, it will have created a hidden `.gclient` file and a
|
||||||
The remaining instructions assume you are now in that directory:
|
directory called `src` in the working directory. The remaining instructions
|
||||||
|
assume you have switched to the `src` directory:
|
||||||
|
|
||||||
$ cd src
|
```shell
|
||||||
|
$ cd src
|
||||||
|
```
|
||||||
|
|
||||||
### Install additional build dependencies
|
### Install additional build dependencies
|
||||||
|
|
||||||
@ -75,29 +85,35 @@ For Gentoo, you can just run `emerge www-client/chromium`.
|
|||||||
### Run the hooks
|
### Run the hooks
|
||||||
|
|
||||||
Once you've run `install-build-deps` at least once, you can now run the
|
Once you've run `install-build-deps` at least once, you can now run the
|
||||||
chromium-specific hooks, which will download additional binaries and other
|
Chromium-specific hooks, which will download additional binaries and other
|
||||||
things you might need:
|
things you might need:
|
||||||
|
|
||||||
$ gclient runhooks
|
```shell
|
||||||
|
$ gclient runhooks
|
||||||
|
```
|
||||||
|
|
||||||
*Optional*: You can also [install API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
*Optional*: You can also [install API
|
||||||
if you want to talk to some of the Google services, but this is not necessary
|
keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
|
||||||
for most development and testing purposes.
|
build to talk to some Google services, but this is not necessary for most
|
||||||
|
development and testing purposes.
|
||||||
|
|
||||||
## Seting up the Build
|
## Setting up the Build
|
||||||
|
|
||||||
Chromium uses [Ninja](https://ninja-build.org) as its main build tool, and
|
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
|
||||||
a tool called [GN](../tools/gn/docs/quick_start.md) to generate
|
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
|
||||||
the .ninja files to do the build. To create a build directory, run:
|
files. You can create any number of *build directories* with different
|
||||||
|
configurations. To create a build directory, run:
|
||||||
|
|
||||||
$ gn gen out/Default
|
```shell
|
||||||
|
$ gn gen out/Default
|
||||||
|
```
|
||||||
|
|
||||||
* You only have to do run this command once, it will self-update the build
|
* You only have to run this once for each new build directory, Ninja will
|
||||||
files as needed after that.
|
update the build files as needed.
|
||||||
* You can replace `out/Default` with another directory name, but we recommend
|
* You can replace `Default` with another name, but
|
||||||
it should still be a subdirectory of `out`.
|
it should be a subdirectory of `out`.
|
||||||
* To specify build parameters for GN builds, including release settings,
|
* For other build arguments, including release settings, see [GN build
|
||||||
see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration).
|
configuration](https://www.chromium.org/developers/gn-build-configuration).
|
||||||
The default will be a debug component build matching the current host
|
The default will be a debug component build matching the current host
|
||||||
operating system and CPU.
|
operating system and CPU.
|
||||||
* For more info on GN, run `gn help` on the command line or read the
|
* For more info on GN, run `gn help` on the command line or read the
|
||||||
@ -112,25 +128,31 @@ settings that may speed up your build.
|
|||||||
|
|
||||||
Build Chromium (the "chrome" target) with Ninja using the command:
|
Build Chromium (the "chrome" target) with Ninja using the command:
|
||||||
|
|
||||||
$ ninja -C out/Default chrome
|
```shell
|
||||||
|
$ ninja -C out/Default chrome
|
||||||
|
```
|
||||||
|
|
||||||
You can get a list of all of the other build targets from GN by running
|
You can get a list of all of the other build targets from GN by running `gn ls
|
||||||
`gn ls out/Default` from the command line. To compile one, pass to Ninja
|
out/Default` from the command line. To compile one, pass the GN label to Ninja
|
||||||
the GN label with no preceding "//" (so for `//chrome/test:unit_tests`
|
with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C
|
||||||
use ninja -C out/Default chrome/test:unit_tests`).
|
out/Default chrome/test:unit_tests`).
|
||||||
|
|
||||||
## Run Chromium
|
## Run Chromium
|
||||||
|
|
||||||
Once it is built, you can simply run the browser:
|
Once it is built, you can simply run the browser:
|
||||||
|
|
||||||
$ out/Default/chrome
|
```shell
|
||||||
|
$ out/Default/chrome
|
||||||
|
```
|
||||||
|
|
||||||
## Running test targets
|
## Running test targets
|
||||||
|
|
||||||
You can run the tests in the same way. You can also limit which tests are
|
You can run the tests in the same way. You can also limit which tests are
|
||||||
run using the `--gtest_filter` arg, e.g.:
|
run using the `--gtest_filter` arg, e.g.:
|
||||||
|
|
||||||
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*"
|
```shell
|
||||||
|
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*"
|
||||||
|
```
|
||||||
|
|
||||||
You can find out more about GoogleTest at its
|
You can find out more about GoogleTest at its
|
||||||
[GitHub page](https://github.com/google/googletest).
|
[GitHub page](https://github.com/google/googletest).
|
||||||
@ -139,16 +161,18 @@ You can find out more about GoogleTest at its
|
|||||||
|
|
||||||
To update an existing checkout, you can run
|
To update an existing checkout, you can run
|
||||||
|
|
||||||
$ git rebase-update
|
```shell
|
||||||
$ gclient sync
|
$ git rebase-update
|
||||||
|
$ gclient sync
|
||||||
|
```
|
||||||
|
|
||||||
The first command updates the primary Chromium source repository and rebases
|
The first command updates the primary Chromium source repository and rebases
|
||||||
any of your local branches on top of tip-of-tree (aka the Git branch `origin/master`).
|
any of your local branches on top of tip-of-tree (aka the Git branch
|
||||||
If you don't want to use this script, you can also just use `git pull` or
|
`origin/master`). If you don't want to use this script, you can also just use
|
||||||
other common Git commands to update the repo.
|
`git pull` or other common Git commands to update the repo.
|
||||||
|
|
||||||
The second command syncs the subrepositories to the appropriate versions and
|
The second command syncs dependencies to the appropriate versions and re-runs
|
||||||
re-runs the hooks as needed.
|
hooks as needed.
|
||||||
|
|
||||||
## Tips, tricks, and troubleshooting
|
## Tips, tricks, and troubleshooting
|
||||||
|
|
||||||
@ -156,25 +180,27 @@ re-runs the hooks as needed.
|
|||||||
|
|
||||||
If, during the final link stage:
|
If, during the final link stage:
|
||||||
|
|
||||||
LINK out/Debug/chrome
|
```
|
||||||
|
LINK out/Debug/chrome
|
||||||
|
```
|
||||||
|
|
||||||
You get an error like:
|
You get an error like:
|
||||||
|
|
||||||
collect2: ld terminated with signal 6 Aborted terminate called after throwing an
|
```
|
||||||
instance of 'std::bad_alloc'
|
collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
|
||||||
|
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
|
||||||
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
|
```
|
||||||
|
|
||||||
you are probably running out of memory when linking. You *must* use a 64-bit
|
you are probably running out of memory when linking. You *must* use a 64-bit
|
||||||
system to build. Try the following build settings (see [GN build
|
system to build. Try the following build settings (see [GN build
|
||||||
configuration](https://www.chromium.org/developers/gn-build-configuration) for
|
configuration](https://www.chromium.org/developers/gn-build-configuration) for
|
||||||
setting):
|
other settings):
|
||||||
|
|
||||||
* Build in release mode (debugging symbols require more memory).
|
* Build in release mode (debugging symbols require more memory):
|
||||||
`is_debug = false`
|
`is_debug = false`
|
||||||
* Turn off symbols. `symbol_level = 0`
|
* Turn off symbols: `symbol_level = 0`
|
||||||
* Build in component mode (this is for developers only, it will be slower and
|
* Build in component mode (this is for development only, it will be slower and
|
||||||
may have broken functionality). `is_component_build = true`
|
may have broken functionality): `is_component_build = true`
|
||||||
|
|
||||||
### More links
|
### More links
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
Generally speaking, follow the [Linux Build Instructions](linux_build_instructions.md).
|
Generally speaking, follow the [Linux Build Instructions](linux_build_instructions.md).
|
||||||
However, you may need to update the package names in `install-build-deps.sh`:
|
However, you may need to update the package names in `install-build-deps.sh`:
|
||||||
|
|
||||||
* libexpat-dev -> libexpat1-dev
|
* `libexpat-dev` → `libexpat1-dev`
|
||||||
* freetype-dev -> libfreetype6-dev
|
* `freetype-dev` → `libfreetype6-dev`
|
||||||
* libbzip2-dev -> libbz2-dev
|
* `libbzip2-dev` → `libbz2-dev`
|
||||||
* libcupsys2-dev -> libcups2-dev
|
* `libcupsys2-dev` → `libcups2-dev`
|
||||||
|
|
||||||
Additionally, if you're building Chromium components for Android, you'll need to
|
Additionally, if you're building Chromium components for Android, you'll need to
|
||||||
install the package: lib32z1
|
install the package `lib32z1`.
|
||||||
|
@ -6,20 +6,22 @@ However, do the following instead to install the build dependenies:
|
|||||||
Generally, follow the main [Linux Build instructions], but instead of
|
Generally, follow the main [Linux Build instructions], but instead of
|
||||||
running `build/install-build-deps.sh`, run:
|
running `build/install-build-deps.sh`, run:
|
||||||
|
|
||||||
su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
|
```shell
|
||||||
bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
|
su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
|
||||||
cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
|
bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
|
||||||
freetype-devel gcc-c++ GConf2-devel glib2-devel glibc.i686 gperf \
|
cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
|
||||||
glib2-devel gtk2-devel gtk3-devel java-1.*.0-openjdk-devel libatomic \
|
freetype-devel gcc-c++ GConf2-devel glib2-devel glibc.i686 gperf \
|
||||||
libcap-devel libffi-devel libgcc.i686 libgnome-keyring-devel libjpeg-devel \
|
glib2-devel gtk2-devel gtk3-devel java-1.*.0-openjdk-devel libatomic \
|
||||||
libstdc++.i686 libX11-devel libXScrnSaver-devel libXtst-devel \
|
libcap-devel libffi-devel libgcc.i686 libgnome-keyring-devel libjpeg-devel \
|
||||||
libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel pam-devel \
|
libstdc++.i686 libX11-devel libXScrnSaver-devel libXtst-devel \
|
||||||
pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd mod_ssl \
|
libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel pam-devel \
|
||||||
php php-cli python-psutil wdiff'
|
pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd mod_ssl \
|
||||||
|
php php-cli python-psutil wdiff'
|
||||||
|
```
|
||||||
|
|
||||||
The msttcorefonts packages can be obtained by following the instructions
|
The `msttcorefonts` packages can be obtained by following [these
|
||||||
present [here](http://www.fedorafaq.org/#installfonts). For the optional
|
instructions](http://www.fedorafaq.org/#installfonts). For the optional
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
* php-cgi is provided by the php-cli package
|
* `php-cgi` is provided by the `php-cli` package.
|
||||||
* sun-java6-fonts doesn't exist in Fedora repositories, needs investigating
|
* `sun-java6-fonts` doesn't exist in Fedora repositories, needs investigating.
|
||||||
|
@ -5,16 +5,18 @@ However, do the following instead to install the build dependencies:
|
|||||||
|
|
||||||
## Install the build dependencies:
|
## Install the build dependencies:
|
||||||
|
|
||||||
urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
|
```shell
|
||||||
lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
|
urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
|
||||||
lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
|
lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
|
||||||
perl bison flex subversion gperf
|
lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
|
||||||
|
perl bison flex subversion gperf
|
||||||
|
```
|
||||||
|
|
||||||
* msttcorefonts are not available, you will need to build your own (see
|
* `msttcorefonts` are not available, you will need to build your own (see
|
||||||
instructions, not hard to do, see
|
instructions, not hard to do, see
|
||||||
[mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use drakfont to
|
[mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use `drakfont` to
|
||||||
import the fonts from a windows installation
|
import the fonts from a Windows installation.
|
||||||
* These packages are for 64 bit, to download the 32 bit packages,
|
* These packages are for 64 bit, to download the 32 bit packages, substitute
|
||||||
substitute lib64 with lib
|
`lib64` with `lib`.
|
||||||
* Some of these packages might not be explicitly necessary as they come as
|
* Some of these packages might not be explicitly necessary as they come as
|
||||||
dependencies, there is no harm in including them however.
|
dependencies, there is no harm in including them however.
|
||||||
|
@ -5,15 +5,17 @@ However, do the following instead to install the build dependencies:
|
|||||||
|
|
||||||
## Install the build dependencies:
|
## Install the build dependencies:
|
||||||
|
|
||||||
Use zypper command to install dependencies:
|
Use `zypper` command to install dependencies:
|
||||||
|
|
||||||
(openSUSE 11.1 and higher)
|
(openSUSE 11.1 and higher)
|
||||||
|
|
||||||
sudo zypper in subversion pkg-config python perl \
|
```shell
|
||||||
bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
|
sudo zypper in subversion pkg-config python perl \
|
||||||
wdiff lighttpd gcc gcc-c++ gconf2-devel mozilla-nspr \
|
bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
|
||||||
mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
|
wdiff lighttpd gcc gcc-c++ gconf2-devel mozilla-nspr \
|
||||||
libjpeg-devel libbz2-devel
|
mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
|
||||||
|
libjpeg-devel libbz2-devel
|
||||||
|
```
|
||||||
|
|
||||||
For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
|
For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
|
||||||
`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need
|
`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need
|
||||||
@ -21,20 +23,26 @@ For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
|
|||||||
|
|
||||||
(openSUSE 11.0)
|
(openSUSE 11.0)
|
||||||
|
|
||||||
sudo zypper in subversion pkg-config python perl \
|
```shell
|
||||||
bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
|
sudo zypper in subversion pkg-config python perl \
|
||||||
libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
|
bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
|
||||||
php5-cgi gconf2-devel alsa-devel gtk2-devel jpeg-devel
|
libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
|
||||||
|
php5-cgi gconf2-devel alsa-devel gtk2-devel jpeg-devel
|
||||||
|
```
|
||||||
|
|
||||||
The Ubuntu package sun-java6-fonts contains a subset of Java of the fonts used.
|
The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
|
||||||
Since this package requires Java as a prerequisite anyway, we can do the same
|
Since this package requires Java as a prerequisite anyway, we can do the same
|
||||||
thing by just installing the equivalent OpenSUSE Sun Java package:
|
thing by just installing the equivalent openSUSE Sun Java package:
|
||||||
|
|
||||||
sudo zypper in java-1_6_0-sun
|
```shell
|
||||||
|
sudo zypper in java-1_6_0-sun
|
||||||
|
```
|
||||||
|
|
||||||
Webkit is currently hard-linked to the Microsoft fonts. To install these using zypper
|
WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
|
||||||
|
|
||||||
sudo zypper in fetchmsttfonts pullin-msttf-fonts
|
```shell
|
||||||
|
sudo zypper in fetchmsttfonts pullin-msttf-fonts
|
||||||
|
```
|
||||||
|
|
||||||
To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
|
To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
|
||||||
create symlinks to the appropriate locations:
|
create symlinks to the appropriate locations:
|
||||||
|
@ -8,68 +8,84 @@ Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
|
|||||||
|
|
||||||
* A 64-bit Mac running 10.9+.
|
* A 64-bit Mac running 10.9+.
|
||||||
* [Xcode](https://developer.apple.com/xcode) 7.3+.
|
* [Xcode](https://developer.apple.com/xcode) 7.3+.
|
||||||
* The OSX 10.10 SDK. Run
|
* The OS X 10.10 SDK. Run
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
|
||||||
```
|
```
|
||||||
ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
|
|
||||||
```
|
to check whether you have it. Building with a newer SDK works too, but
|
||||||
to check whether you have it. Building with the 10.11 SDK works too, but
|
|
||||||
the releases currently use the 10.10 SDK.
|
the releases currently use the 10.10 SDK.
|
||||||
* Git v
|
|
||||||
* Python 2.7.x.
|
|
||||||
|
|
||||||
## Install `depot_tools`
|
## Install `depot_tools`
|
||||||
|
|
||||||
Clone the depot_tools repository:
|
Clone the `depot_tools` repository:
|
||||||
|
|
||||||
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
```shell
|
||||||
|
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
```
|
||||||
|
|
||||||
Add depot_tools to the end of your PATH (you will probably want to put this
|
Add `depot_tools` to the end of your PATH (you will probably want to put this
|
||||||
in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools
|
in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
|
||||||
to /path/to/depot_tools:
|
`/path/to/depot_tools`:
|
||||||
|
|
||||||
$ export PATH=$PATH:/path/to/depot_tools
|
```shell
|
||||||
|
$ export PATH="$PATH:/path/to/depot_tools"
|
||||||
|
```
|
||||||
|
|
||||||
## Get the code
|
## Get the code
|
||||||
|
|
||||||
Create a chromium directory for the checkout and change to it (you can call
|
Create a `chromium` directory for the checkout and change to it (you can call
|
||||||
this whatever you like and put it wherever you like, as
|
this whatever you like and put it wherever you like, as long as the full path
|
||||||
long as the full path has no spaces):
|
has no spaces):
|
||||||
|
|
||||||
$ mkdir chromium
|
|
||||||
$ cd chromium
|
|
||||||
|
|
||||||
Run the `fetch` tool from depot_tools to check out the code and its
|
```shell
|
||||||
|
$ mkdir chromium && cd chromium
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the `fetch` tool from `depot_tools` to check out the code and its
|
||||||
dependencies.
|
dependencies.
|
||||||
|
|
||||||
$ fetch chromium
|
```shell
|
||||||
|
$ fetch chromium
|
||||||
|
```
|
||||||
|
|
||||||
If you don't want the full repo history, you can save a lot of time by
|
If you don't want the full repo history, you can save a lot of time by
|
||||||
adding the `--no-history` flag to fetch. Expect the command to take
|
adding the `--no-history` flag to `fetch`.
|
||||||
30 minutes on even a fast connection, and many hours on slower ones.
|
|
||||||
|
|
||||||
When fetch completes, it will have created a directory called `src`.
|
Expect the command to take 30 minutes on even a fast connection, and many
|
||||||
The remaining instructions assume you are now in that directory:
|
hours on slower ones.
|
||||||
|
|
||||||
$ cd src
|
When `fetch` completes, it will have created a hidden `.gclient` file and a
|
||||||
|
directory called `src` in the working directory. The remaining instructions
|
||||||
|
assume you have switched to the `src` directory:
|
||||||
|
|
||||||
*Optional*: You can also [install API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
```shell
|
||||||
if you want to talk to some of the Google services, but this is not necessary
|
$ cd src
|
||||||
for most development and testing purposes.
|
```
|
||||||
|
|
||||||
|
*Optional*: You can also [install API
|
||||||
|
keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
|
||||||
|
build to talk to some Google services, but this is not necessary for most
|
||||||
|
development and testing purposes.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Chromium uses [Ninja](https://ninja-build.org) as its main build tool, and
|
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
|
||||||
a tool called [GN](../tools/gn/docs/quick_start.md) to generate
|
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
|
||||||
the .ninja files to do the build. To create a build directory:
|
files. You can create any number of *build directories* with different
|
||||||
|
configurations. To create a build directory:
|
||||||
|
|
||||||
$ gn gen out/Default
|
```shell
|
||||||
|
$ gn gen out/Default
|
||||||
|
```
|
||||||
|
|
||||||
* You only have to do run this command once, it will self-update the build
|
* You only have to run this once for each new build directory, Ninja will
|
||||||
files as needed after that.
|
update the build files as needed.
|
||||||
* You can replace `out/Default` with another directory name, but we recommend
|
* You can replace `Default` with another name, but
|
||||||
it should still be a subdirectory of `out`.
|
it should be a subdirectory of `out`.
|
||||||
* To specify build parameters for GN builds, including release settings,
|
* For other build arguments, including release settings, see [GN build
|
||||||
see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration).
|
configuration](https://www.chromium.org/developers/gn-build-configuration).
|
||||||
The default will be a debug component build matching the current host
|
The default will be a debug component build matching the current host
|
||||||
operating system and CPU.
|
operating system and CPU.
|
||||||
* For more info on GN, run `gn help` on the command line or read the
|
* For more info on GN, run `gn help` on the command line or read the
|
||||||
@ -83,21 +99,28 @@ lot faster in Release builds.
|
|||||||
|
|
||||||
Put
|
Put
|
||||||
|
|
||||||
is_debug = false
|
```
|
||||||
|
is_debug = false
|
||||||
|
```
|
||||||
|
|
||||||
in your args.gn to do a release build.
|
in your `args.gn` to do a release build.
|
||||||
|
|
||||||
Put
|
Put
|
||||||
|
|
||||||
is_component_build = true
|
```
|
||||||
|
is_component_build = true
|
||||||
|
```
|
||||||
|
|
||||||
in your args.gn to build many small dylibs instead of a single large executable.
|
in your `args.gn` to build many small dylibs instead of a single large
|
||||||
This makes incremental builds much faster, at the cost of producing a binary
|
executable. This makes incremental builds much faster, at the cost of producing
|
||||||
that opens less quickly. Component builds work in both debug and release.
|
a binary that opens less quickly. Component builds work in both debug and
|
||||||
|
release.
|
||||||
|
|
||||||
Put
|
Put
|
||||||
|
|
||||||
symbol_level = 0
|
```
|
||||||
|
symbol_level = 0
|
||||||
|
```
|
||||||
|
|
||||||
in your args.gn to disable debug symbols altogether. This makes both full
|
in your args.gn to disable debug symbols altogether. This makes both full
|
||||||
rebuilds and linking faster (at the cost of not getting symbolized backtraces
|
rebuilds and linking faster (at the cost of not getting symbolized backtraces
|
||||||
@ -109,14 +132,18 @@ You might also want to [install ccache](ccache_mac.md) to speed up the build.
|
|||||||
|
|
||||||
Once it is built, you can simply run the browser:
|
Once it is built, you can simply run the browser:
|
||||||
|
|
||||||
$ out/Default/chrome
|
```shell
|
||||||
|
$ out/Default/chrome
|
||||||
|
```
|
||||||
|
|
||||||
## Running test targets
|
## Running test targets
|
||||||
|
|
||||||
You can run the tests in the same way. You can also limit which tests are
|
You can run the tests in the same way. You can also limit which tests are
|
||||||
run using the `--gtest_filter` arg, e.g.:
|
run using the `--gtest_filter` arg, e.g.:
|
||||||
|
|
||||||
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*"
|
```
|
||||||
|
$ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*"
|
||||||
|
```
|
||||||
|
|
||||||
You can find out more about GoogleTest at its
|
You can find out more about GoogleTest at its
|
||||||
[GitHub page](https://github.com/google/googletest).
|
[GitHub page](https://github.com/google/googletest).
|
||||||
@ -126,102 +153,114 @@ You can find out more about GoogleTest at its
|
|||||||
Good debugging tips can be found
|
Good debugging tips can be found
|
||||||
[here](http://dev.chromium.org/developers/how-tos/debugging-on-os-x). If you
|
[here](http://dev.chromium.org/developers/how-tos/debugging-on-os-x). If you
|
||||||
would like to debug in a graphical environment, rather than using `lldb` at the
|
would like to debug in a graphical environment, rather than using `lldb` at the
|
||||||
command line, that is possible without building in Xcode. See
|
command line, that is possible without building in Xcode (see
|
||||||
[Debugging in Xcode](http://www.chromium.org/developers/how-tos/debugging-on-os-x/building-with-ninja-debugging-with-xcode)
|
[Debugging in Xcode](http://www.chromium.org/developers/how-tos/debugging-on-os-x/building-with-ninja-debugging-with-xcode)).
|
||||||
for information on how.
|
|
||||||
|
|
||||||
## Update your checkout
|
## Update your checkout
|
||||||
|
|
||||||
To update an existing checkout, you can run
|
To update an existing checkout, you can run
|
||||||
|
|
||||||
$ git rebase-update
|
```shell
|
||||||
$ gclient sync
|
$ git rebase-update
|
||||||
|
$ gclient sync
|
||||||
|
```
|
||||||
|
|
||||||
The first command updates the primary Chromium source repository and rebases
|
The first command updates the primary Chromium source repository and rebases
|
||||||
any of your local branches on top of tip-of-tree (aka the Git branch `origin/master`).
|
any of your local branches on top of tip-of-tree (aka the Git branch
|
||||||
If you don't want to use this script, you can also just use `git pull` or
|
`origin/master`). If you don't want to use this script, you can also just use
|
||||||
other common Git commands to update the repo.
|
`git pull` or other common Git commands to update the repo.
|
||||||
|
|
||||||
The second command syncs the subrepositories to the appropriate versions and
|
The second command syncs dependencies to the appropriate versions and re-runs
|
||||||
re-runs the hooks as needed.
|
hooks as needed.
|
||||||
|
|
||||||
## Tips, tricks, and troubleshooting
|
## Tips, tricks, and troubleshooting
|
||||||
|
|
||||||
### Using Xcode-Ninja Hybrid
|
### Using Xcode-Ninja Hybrid
|
||||||
|
|
||||||
While using Xcode is unsupported, gn supports a hybrid approach of using ninja
|
While using Xcode is unsupported, GN supports a hybrid approach of using Ninja
|
||||||
for building, but Xcode for editing and driving compilation. Xcode is still
|
for building, but Xcode for editing and driving compilation. Xcode is still
|
||||||
slow, but it runs fairly well even **with indexing enabled**. Most people
|
slow, but it runs fairly well even **with indexing enabled**. Most people
|
||||||
build in the Terminal and write code with a text editor though.
|
build in the Terminal and write code with a text editor, though.
|
||||||
|
|
||||||
With hybrid builds, compilation is still handled by ninja, and can be run by the
|
With hybrid builds, compilation is still handled by Ninja, and can be run from
|
||||||
command line (e.g. ninja -C out/gn chrome) or by choosing the chrome target
|
the command line (e.g. `ninja -C out/gn chrome`) or by choosing the `chrome`
|
||||||
in the hybrid workspace and choosing build.
|
target in the hybrid workspace and choosing Build.
|
||||||
|
|
||||||
To use Xcode-Ninja Hybrid pass --ide=xcode to `gn gen`
|
To use Xcode-Ninja Hybrid pass `--ide=xcode` to `gn gen`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
gn gen out/gn --ide=xcode
|
$ gn gen out/gn --ide=xcode
|
||||||
```
|
```
|
||||||
|
|
||||||
Open it:
|
Open it:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
open out/gn/ninja/all.xcworkspace
|
$ open out/gn/ninja/all.xcworkspace
|
||||||
```
|
```
|
||||||
|
|
||||||
You may run into a problem where http://YES is opened as a new tab every time
|
You may run into a problem where http://YES is opened as a new tab every time
|
||||||
you launch Chrome. To fix this, open the scheme editor for the Run scheme,
|
you launch Chrome. To fix this, open the scheme editor for the Run scheme,
|
||||||
choose the Options tab, and uncheck "Allow debugging when using document
|
choose the Options tab, and uncheck "Allow debugging when using document
|
||||||
Versions Browser". When this option is checked, Xcode adds
|
Versions Browser". When this option is checked, Xcode adds
|
||||||
`--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` gets
|
`--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES`
|
||||||
interpreted as a URL to open.
|
gets interpreted as a URL to open.
|
||||||
|
|
||||||
If you have problems building, join us in `#chromium` on `irc.freenode.net` and
|
If you have problems building, join us in `#chromium` on `irc.freenode.net` and
|
||||||
ask there. As mentioned above, be sure that the
|
ask there. Be sure that the
|
||||||
[waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the tree
|
[waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the
|
||||||
is open before checking out. This will increase your chances of success.
|
tree is open before checking out. This will increase your chances of success.
|
||||||
|
|
||||||
### Improving performance of `git status`
|
### Improving performance of `git status`
|
||||||
|
|
||||||
`git status` is used frequently to determine the status of your checkout. Due
|
`git status` is used frequently to determine the status of your checkout. Due
|
||||||
to the number of files in Chromium's checkout, `git status` performance can be
|
to the large number of files in Chromium's checkout, `git status` performance
|
||||||
quite variable. Increasing the system's vnode cache appears to help. By
|
can be quite variable. Increasing the system's vnode cache appears to help. By
|
||||||
default, this command:
|
default, this command:
|
||||||
|
|
||||||
sysctl -a | egrep kern\..*vnodes
|
```shell
|
||||||
|
$ sysctl -a | egrep kern\..*vnodes
|
||||||
|
```
|
||||||
|
|
||||||
Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
|
Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
|
||||||
setting:
|
setting:
|
||||||
|
|
||||||
sudo sysctl kern.maxvnodes=$((512*1024))
|
```shell
|
||||||
|
$ sudo sysctl kern.maxvnodes=$((512*1024))
|
||||||
|
```
|
||||||
|
|
||||||
Higher values may be appropriate if you routinely move between different
|
Higher values may be appropriate if you routinely move between different
|
||||||
Chromium checkouts. This setting will reset on reboot, the startup setting can
|
Chromium checkouts. This setting will reset on reboot, the startup setting can
|
||||||
be set in `/etc/sysctl.conf`:
|
be set in `/etc/sysctl.conf`:
|
||||||
|
|
||||||
echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
|
```shell
|
||||||
|
$ echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
|
||||||
|
```
|
||||||
|
|
||||||
Or edit the file directly.
|
Or edit the file directly.
|
||||||
|
|
||||||
If your `git --version` reports 2.6 or higher, the following may also improve
|
If `git --version` reports 2.6 or higher, the following may also improve
|
||||||
performance of `git status`:
|
performance of `git status`:
|
||||||
|
|
||||||
git update-index --untracked-cache
|
```shell
|
||||||
|
$ git update-index --untracked-cache
|
||||||
|
```
|
||||||
|
|
||||||
### Xcode license agreement
|
### Xcode license agreement
|
||||||
|
|
||||||
If you're getting the error
|
If you're getting the error
|
||||||
|
|
||||||
```
|
> Agreeing to the Xcode/iOS license requires admin privileges, please re-run as
|
||||||
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
|
> root via sudo.
|
||||||
```
|
|
||||||
|
|
||||||
the Xcode license hasn't been accepted yet which (contrary to the message) any
|
the Xcode license hasn't been accepted yet which (contrary to the message) any
|
||||||
user can do by running:
|
user can do by running:
|
||||||
|
|
||||||
xcodebuild -license
|
```shell
|
||||||
|
$ xcodebuild -license
|
||||||
|
```
|
||||||
|
|
||||||
Only accepting for all users of the machine requires root:
|
Only accepting for all users of the machine requires root:
|
||||||
|
|
||||||
sudo xcodebuild -license
|
```shell
|
||||||
|
$ sudo xcodebuild -license
|
||||||
|
```
|
||||||
|
@ -88,47 +88,57 @@ using gn - see [crbug.com/611087](https://crbug.com/611087).
|
|||||||
|
|
||||||
## Get the code
|
## Get the code
|
||||||
|
|
||||||
Create a chromium directory for the checkout and change to it (you can call
|
Create a `chromium` directory for the checkout and change to it (you can call
|
||||||
this whatever you like and put it wherever you like, as
|
this whatever you like and put it wherever you like, as
|
||||||
long as the full path has no spaces):
|
long as the full path has no spaces):
|
||||||
|
|
||||||
$ mkdir chromium
|
|
||||||
$ cd chromium
|
|
||||||
|
|
||||||
Run the `fetch` tool from depot_tools to check out the code and its
|
```shell
|
||||||
|
$ mkdir chromium && cd chromium
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the `fetch` tool from `depot_tools` to check out the code and its
|
||||||
dependencies.
|
dependencies.
|
||||||
|
|
||||||
$ fetch chromium
|
```shell
|
||||||
|
$ fetch ios
|
||||||
|
```
|
||||||
|
|
||||||
If you don't want the full repo history, you can save a lot of time by
|
If you don't want the full repo history, you can save a lot of time by
|
||||||
adding the `--no-history` flag to fetch. Expect the command to take
|
adding the `--no-history` flag to `fetch`.
|
||||||
30 minutes on even a fast connection, and many hours on slower ones.
|
|
||||||
|
|
||||||
When fetch completes, it will have created a directory called `src`.
|
Expect the command to take 30 minutes on even a fast connection, and many
|
||||||
The remaining instructions assume you are now in that directory:
|
hours on slower ones.
|
||||||
|
|
||||||
$ cd src
|
When `fetch` completes, it will have created a hidden `.gclient` file and a
|
||||||
|
directory called `src` in the working directory. The remaining instructions
|
||||||
|
assume you have switched to the `src` directory:
|
||||||
|
|
||||||
### (optional) Install API keys
|
```shell
|
||||||
|
$ cd src
|
||||||
|
```
|
||||||
|
|
||||||
You can also [instaldl API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
*Optional*: You can also [install API
|
||||||
if you want to talk to some of the Google services, but this is not necessary
|
keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
|
||||||
for most development and testing purposes.
|
build to talk to some Google services, but this is not necessary for most
|
||||||
|
development and testing purposes.
|
||||||
|
|
||||||
## Seting up the Build
|
## Building
|
||||||
|
|
||||||
Chromium uses [Ninja](https://ninja-build.org) as its main build tool, and
|
Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
|
||||||
a tool called [GN](../tools/gn/docs/quick_start.md) to generate
|
with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
|
||||||
the .ninja files to do the build. To create a build directory:
|
files. You can create any number of *build directories* with different
|
||||||
|
configurations. To create a build directory:
|
||||||
|
|
||||||
$ gn gen out/Default
|
```shell
|
||||||
|
$ gn gen out/Default
|
||||||
|
```
|
||||||
|
|
||||||
* You only have to do run this command once, it will self-update the build
|
* You only have to run this once for each new build directory, Ninja will
|
||||||
files as needed after that.
|
update the build files as needed.
|
||||||
* You can replace `out/Default` with another directory name, but we recommend
|
* You can replace `Default` with another name, but
|
||||||
it should still be a subdirectory of `out`.
|
it should be a subdirectory of `out`.
|
||||||
* To specify build parameters for GN builds, including release settings,
|
* For other build arguments, including release settings, see [GN build
|
||||||
see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration).
|
configuration](https://www.chromium.org/developers/gn-build-configuration).
|
||||||
The default will be a debug component build matching the current host
|
The default will be a debug component build matching the current host
|
||||||
operating system and CPU.
|
operating system and CPU.
|
||||||
* For more info on GN, run `gn help` on the command line or read the
|
* For more info on GN, run `gn help` on the command line or read the
|
||||||
|
Reference in New Issue
Block a user