| OLD | NEW |
| 1 # Linux-specific build instructions | 1 # Linux-specific build instructions |
| 2 | 2 |
| 3 [TOC] | 3 [TOC] |
| 4 | 4 |
| 5 ## Get the code | 5 ## Get the code |
| 6 | 6 |
| 7 [Get the Code](https://www.chromium.org/developers/how-tos/get-the-code). The | 7 [Get the Code](https://www.chromium.org/developers/how-tos/get-the-code). The |
| 8 general instructions on the "Get the code" page cover basic Linux build setup | 8 general instructions on the "Get the code" page cover basic Linux build setup |
| 9 and configuration. | 9 and configuration. |
| 10 | 10 |
| 11 This page documents some additional Linux-specific build issues. | 11 This page documents some additional Linux-specific build issues. |
| 12 | 12 |
| 13 ## Overview | 13 ## Overview |
| 14 | 14 |
| 15 Due its complexity, Chromium uses a set of custom tools to check out and build. | 15 Due its complexity, Chromium uses a set of custom tools to check out and build. |
| 16 Here's an overview of the steps you'll run: | 16 Here's an overview of the steps you'll run: |
| 17 | 17 |
| 18 1. **gclient**. A checkout involves pulling nearly 100 different SVN | 18 1. **gclient**. A checkout involves pulling nearly 100 different SVN |
| 19 repositories of code. This process is managed with a tool called `gclient`. | 19 repositories of code. This process is managed with a tool called `gclient`. |
| 20 1. **GN** / **gyp**. Cross-platform build configuration systems (GYP is the | 20 1. **GN**. Cross-platform build configuration system. It generates ninja |
| 21 older one, GN is the one being transitioned to). It generates ninja build | 21 build files. Running `gn` is analogous to the `./configure` step seen in |
| 22 files. Running `gn`/`gyp` is analogous to the `./configure` step seen in | |
| 23 most other software. | 22 most other software. |
| 24 1. **ninja**. The actual build itself uses `ninja`. A prebuilt binary is in | 23 1. **ninja**. The actual build itself uses `ninja`. A prebuilt binary is in |
| 25 `depot_tools` and should already be in your path if you followed the steps | 24 `depot_tools` and should already be in your path if you followed the steps |
| 26 to check out Chromium. | 25 to check out Chromium. |
| 27 1. We don't provide any sort of "install" step. | 26 1. We don't provide any sort of "install" step. |
| 28 1. You may want to | 27 1. You may want to |
| 29 [use a chroot](using_a_linux_chroot.md) to | 28 [use a chroot](using_a_linux_chroot.md) to |
| 30 isolate yourself from versioning or packaging conflicts (or to run the | 29 isolate yourself from versioning or packaging conflicts (or to run the |
| 31 layout tests). | 30 layout tests). |
| 32 | 31 |
| 33 ## Getting a checkout | 32 ## Getting a checkout |
| 34 | 33 |
| 35 [Prerequisites](linux_build_instructions_prerequisites.md): what you need before | 34 [Prerequisites](linux_build_instructions_prerequisites.md): what you need before |
| 36 you build. | 35 you build. |
| 37 | 36 |
| 38 **Note**. If you are working on Chromium OS and already have sources in | 37 **Note**. If you are working on Chromium OS and already have sources in |
| 39 `chromiumos/chromium`, you **must** run `chrome_set_ver --runhooks` to set the | 38 `chromiumos/chromium`, you **must** run `chrome_set_ver --runhooks` to set the |
| 40 correct dependencies. This step is otherwise performed by `gclient` as part of | 39 correct dependencies. This step is otherwise performed by `gclient` as part of |
| 41 your checkout. | 40 your checkout. |
| 42 | 41 |
| 43 ## Compilation | 42 ## Compilation |
| 44 | 43 |
| 45 The weird "`src/`" directory is an artifact of `gclient`. Start with: | 44 The "`src/`" directory is an artifact of `gclient`. Start with: |
| 46 | 45 |
| 47 $ cd src | 46 $ cd src |
| 48 | 47 |
| 49 ### Faster builds | 48 ### Faster builds |
| 50 | 49 |
| 51 See [Linux Faster Builds](linux_faster_builds.md) | 50 See [Linux Faster Builds](linux_faster_builds.md) |
| 52 | 51 |
| 53 ### Build every test | 52 ### Build every test |
| 54 | 53 |
| 55 $ ninja -C out/Debug | 54 $ ninja -C out/Debug |
| (...skipping 26 matching lines...) Expand all Loading... |
| 82 If you want to see the actual commands that ninja is invoking, add `-v` to the | 81 If you want to see the actual commands that ninja is invoking, add `-v` to the |
| 83 ninja invocation. | 82 ninja invocation. |
| 84 | 83 |
| 85 $ ninja -v -C out/Debug chrome | 84 $ ninja -v -C out/Debug chrome |
| 86 | 85 |
| 87 This is useful if, for example, you are debugging gyp changes, or otherwise need | 86 This is useful if, for example, you are debugging gyp changes, or otherwise need |
| 88 to see what ninja is actually doing. | 87 to see what ninja is actually doing. |
| 89 | 88 |
| 90 ### Clean builds | 89 ### Clean builds |
| 91 | 90 |
| 92 If you're using GN, you can clean the build directory (`out/Default` in this | 91 You can clean the build directory (`out/Default` in this example): |
| 93 example): | |
| 94 | 92 |
| 95 gn clean out/Default | 93 gn clean out/Default |
| 96 | 94 |
| 97 This will delete all files except a bootstrap ninja file necessary for | 95 This will delete all files except a bootstrap ninja file necessary for |
| 98 recreating the build. | 96 recreating the build. |
| 99 | 97 |
| 100 If you're using GYP, do: | |
| 101 | |
| 102 rm -rf out | |
| 103 gclient runhooks | |
| 104 | |
| 105 Ninja can also be used to clean a build with `ninja -C out/Debug -t clean` but | 98 Ninja can also be used to clean a build with `ninja -C out/Debug -t clean` but |
| 106 this will not be as complete as the above methods. | 99 this will not be as complete as the above methods. |
| 107 | 100 |
| 108 ### Linker Crashes | 101 ### Linker Crashes |
| 109 | 102 |
| 110 If, during the final link stage: | 103 If, during the final link stage: |
| 111 | 104 |
| 112 LINK(target) out/Debug/chrome | 105 LINK(target) out/Debug/chrome |
| 113 | 106 |
| 114 You get an error like: | 107 You get an error like: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 139 * Want to use Eclipse as your IDE? See | 132 * Want to use Eclipse as your IDE? See |
| 140 [LinuxEclipseDev](linux_eclipse_dev.md). | 133 [LinuxEclipseDev](linux_eclipse_dev.md). |
| 141 * Built version as Default Browser? See | 134 * Built version as Default Browser? See |
| 142 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md). | 135 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md). |
| 143 | 136 |
| 144 ## Next Steps | 137 ## Next Steps |
| 145 | 138 |
| 146 If you want to contribute to the effort toward a Chromium-based browser for | 139 If you want to contribute to the effort toward a Chromium-based browser for |
| 147 Linux, please check out the [Linux Development page](linux_development.md) for | 140 Linux, please check out the [Linux Development page](linux_development.md) for |
| 148 more information. | 141 more information. |
| OLD | NEW |