Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Building with Buck |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 2 | |
| 3 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4 | == Installation |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 5 | |
David Ostrovsky | 3931c16 | 2014-06-15 00:33:40 +0200 | [diff] [blame] | 6 | You need to use Java 8 and Node.js for building gerrit. |
Deniz Türkoglu | d7559c0 | 2014-09-08 11:27:23 +0200 | [diff] [blame] | 7 | |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 8 | There is currently no binary distribution of Buck, so it has to be manually |
Euler Jiang | fa6549a | 2015-11-11 09:28:05 -0800 | [diff] [blame] | 9 | built and installed. Apache Ant and gcc are required. Currently only Linux |
| 10 | and Mac OS are supported. |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 11 | |
| 12 | Clone the git and build it: |
| 13 | |
| 14 | ---- |
David Pursehouse | 3e028c9 | 2015-04-16 16:00:59 +0900 | [diff] [blame] | 15 | git clone https://github.com/facebook/buck |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 16 | cd buck |
Shawn Pearce | 552c1b5 | 2014-11-27 11:48:28 -0800 | [diff] [blame] | 17 | git checkout $(cat ../gerrit/.buckversion) |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 18 | ant |
| 19 | ---- |
| 20 | |
David Pursehouse | e9803ab | 2014-03-12 14:15:10 +0900 | [diff] [blame] | 21 | If you don't have a `bin/` directory in your home directory, create one: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 22 | |
| 23 | ---- |
David Pursehouse | 64c1644 | 2013-05-14 10:49:03 +0900 | [diff] [blame] | 24 | mkdir ~/bin |
David Pursehouse | e9803ab | 2014-03-12 14:15:10 +0900 | [diff] [blame] | 25 | ---- |
| 26 | |
| 27 | Add the `~/bin` folder to the path: |
| 28 | |
| 29 | ---- |
David Pursehouse | 64c1644 | 2013-05-14 10:49:03 +0900 | [diff] [blame] | 30 | PATH=~/bin:$PATH |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 31 | ---- |
| 32 | |
David Pursehouse | e9803ab | 2014-03-12 14:15:10 +0900 | [diff] [blame] | 33 | Note that the buck executable needs to be available in all shell sessions, |
| 34 | so also make sure it is appended to the path globally. |
| 35 | |
David Pursehouse | 1d04f64 | 2014-09-10 11:09:02 +0200 | [diff] [blame] | 36 | Add a symbolic link in `~/bin` to the buck and buckd executables: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 37 | |
| 38 | ---- |
David Pursehouse | 64c1644 | 2013-05-14 10:49:03 +0900 | [diff] [blame] | 39 | ln -s `pwd`/bin/buck ~/bin/ |
David Pursehouse | 1d04f64 | 2014-09-10 11:09:02 +0200 | [diff] [blame] | 40 | ln -s `pwd`/bin/buckd ~/bin/ |
David Pursehouse | 64c1644 | 2013-05-14 10:49:03 +0900 | [diff] [blame] | 41 | ---- |
| 42 | |
David Pursehouse | 5c42b8c | 2013-05-17 13:25:47 +0100 | [diff] [blame] | 43 | Verify that `buck` is accessible: |
David Pursehouse | 64c1644 | 2013-05-14 10:49:03 +0900 | [diff] [blame] | 44 | |
| 45 | ---- |
| 46 | which buck |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 47 | ---- |
| 48 | |
David Pursehouse | be28499 | 2013-09-26 14:43:33 +0900 | [diff] [blame] | 49 | To enable autocompletion of buck commands, install the autocompletion |
Khai Do | 58964f1 | 2016-06-24 10:08:57 -0700 | [diff] [blame] | 50 | script from `./scripts/buck-completion.bash` in the buck project. Refer |
David Pursehouse | ad4ed96 | 2014-09-10 11:09:26 +0200 | [diff] [blame] | 51 | to the script's header comments for installation instructions. |
David Pursehouse | be28499 | 2013-09-26 14:43:33 +0900 | [diff] [blame] | 52 | |
David Ostrovsky | 69349b4 | 2015-04-20 06:56:30 +0200 | [diff] [blame] | 53 | == Prerequisites |
| 54 | |
| 55 | Buck requires Python version 2.7 to be installed. The Maven download toolchain |
| 56 | requires `curl` to be installed. |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 57 | |
David Pursehouse | 5861a9a | 2013-05-15 10:25:19 +0900 | [diff] [blame] | 58 | [[eclipse]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 59 | == Eclipse Integration |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 60 | |
| 61 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 62 | === Generating the Eclipse Project |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 63 | |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 64 | Create the Eclipse project: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 65 | |
| 66 | ---- |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 67 | tools/eclipse/project.py |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 68 | ---- |
| 69 | |
David Pursehouse | 2b16f6a | 2015-08-28 09:38:50 +0900 | [diff] [blame] | 70 | and then follow the link:dev-eclipse.html#setup[setup instructions]. |
David Pursehouse | b46cf49 | 2013-05-14 09:41:30 +0900 | [diff] [blame] | 71 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 72 | === Refreshing the Classpath |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 73 | |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 74 | If an updated classpath is needed, the Eclipse project can be |
| 75 | refreshed and missing dependency JARs can be downloaded: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 76 | |
| 77 | ---- |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 78 | tools/eclipse/project.py |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 79 | ---- |
| 80 | |
| 81 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 82 | === Attaching Sources |
Shawn Pearce | 7b55326 | 2013-05-13 21:25:13 -0700 | [diff] [blame] | 83 | |
David Pursehouse | cb7f914 | 2016-02-19 10:12:06 +0900 | [diff] [blame] | 84 | Source JARs are downloaded by default. This allows Eclipse to show |
| 85 | documentation or dive into the implementation of a library JAR. |
| 86 | |
| 87 | To save time and bandwidth, download of source JARs can be restricted |
| 88 | to only those that are necessary to compile Java source into JavaScript |
| 89 | using the GWT compiler: |
Shawn Pearce | 7b55326 | 2013-05-13 21:25:13 -0700 | [diff] [blame] | 90 | |
| 91 | ---- |
David Pursehouse | cb7f914 | 2016-02-19 10:12:06 +0900 | [diff] [blame] | 92 | tools/eclipse/project.py --no-src |
Shawn Pearce | 7b55326 | 2013-05-13 21:25:13 -0700 | [diff] [blame] | 93 | ---- |
| 94 | |
| 95 | |
David Pursehouse | 6de7ee2 | 2013-05-20 11:08:51 +0900 | [diff] [blame] | 96 | [[build]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 97 | == Building on the Command Line |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 98 | |
| 99 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 100 | === Gerrit Development WAR File |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 101 | |
David Ostrovsky | c43dd07 | 2015-12-01 08:06:51 +0100 | [diff] [blame] | 102 | To build the Gerrit web application that includes GWT UI and PolyGerrit UI: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 103 | |
| 104 | ---- |
| 105 | buck build gerrit |
| 106 | ---- |
| 107 | |
Michael Ochmann | 8129ece | 2016-07-08 11:25:25 +0200 | [diff] [blame] | 108 | [NOTE] |
| 109 | PolyGerrit UI may require additional tools (such as npm). Please read |
Khai Do | 0054528 | 2016-04-16 08:27:23 -0700 | [diff] [blame] | 110 | the polygerrit-ui/README.md for more info. |
| 111 | |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 112 | The output executable WAR will be placed in: |
| 113 | |
| 114 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 115 | buck-out/gen/gerrit/gerrit.war |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 116 | ---- |
| 117 | |
David Ostrovsky | c43dd07 | 2015-12-01 08:06:51 +0100 | [diff] [blame] | 118 | To build the Gerrit web application that includes only GWT UI: |
| 119 | |
| 120 | ---- |
| 121 | buck build gwtgerrit |
| 122 | ---- |
| 123 | |
| 124 | The output executable WAR will be placed in: |
| 125 | |
| 126 | ---- |
| 127 | buck-out/gen/gwtgerrit/gwtgerrit.war |
| 128 | ---- |
| 129 | |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 130 | |
David Ostrovsky | 7a29533 | 2015-02-27 19:19:45 +0100 | [diff] [blame] | 131 | === Headless Mode |
| 132 | |
| 133 | To build Gerrit in headless mode, i.e. without the GWT Web UI: |
| 134 | |
| 135 | ---- |
| 136 | buck build headless |
| 137 | ---- |
| 138 | |
| 139 | The output executable WAR will be placed in: |
| 140 | |
| 141 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 142 | buck-out/gen/headless/headless.war |
David Ostrovsky | 7a29533 | 2015-02-27 19:19:45 +0100 | [diff] [blame] | 143 | ---- |
| 144 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 145 | === Extension and Plugin API JAR Files |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 146 | |
David Ostrovsky | e5487a0 | 2013-11-25 00:00:13 +0100 | [diff] [blame] | 147 | To build the extension, plugin and GWT API JAR files: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 148 | |
| 149 | ---- |
| 150 | buck build api |
| 151 | ---- |
| 152 | |
David Ostrovsky | e5487a0 | 2013-11-25 00:00:13 +0100 | [diff] [blame] | 153 | Java binaries, Java sources and Java docs are generated into corresponding |
David Pursehouse | 43dc748 | 2013-12-13 14:54:42 +0900 | [diff] [blame] | 154 | project directories in `buck-out/gen`, here as example for plugin API: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 155 | |
| 156 | ---- |
David Ostrovsky | e5487a0 | 2013-11-25 00:00:13 +0100 | [diff] [blame] | 157 | buck-out/gen/gerrit-plugin-api/plugin-api.jar |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 158 | buck-out/gen/gerrit-plugin-api/plugin-api-javadoc/plugin-api-javadoc.jar |
David Ostrovsky | e5487a0 | 2013-11-25 00:00:13 +0100 | [diff] [blame] | 159 | buck-out/gen/gerrit-plugin-api/plugin-api-src.jar |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 160 | ---- |
| 161 | |
David Ostrovsky | 358a458 | 2014-05-13 23:55:04 +0200 | [diff] [blame] | 162 | Install {extension,plugin,gwt}-api to the local maven repository: |
David Ostrovsky | 6e6a967 | 2013-05-30 01:10:12 +0200 | [diff] [blame] | 163 | |
| 164 | ---- |
Luca Milanesio | 3301aff | 2016-06-10 09:54:24 +0100 | [diff] [blame] | 165 | tools/maven/api.sh install |
David Ostrovsky | 6e6a967 | 2013-05-30 01:10:12 +0200 | [diff] [blame] | 166 | ---- |
| 167 | |
David Ostrovsky | 358a458 | 2014-05-13 23:55:04 +0200 | [diff] [blame] | 168 | Install gerrit.war to the local maven repository: |
| 169 | |
| 170 | ---- |
Luca Milanesio | 3301aff | 2016-06-10 09:54:24 +0100 | [diff] [blame] | 171 | tools/maven/api.sh war_install |
David Ostrovsky | 358a458 | 2014-05-13 23:55:04 +0200 | [diff] [blame] | 172 | ---- |
| 173 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 174 | === Plugins |
David Pursehouse | 0bc51db | 2013-05-14 12:46:49 +0900 | [diff] [blame] | 175 | |
| 176 | To build all core plugins: |
| 177 | |
| 178 | ---- |
| 179 | buck build plugins:core |
| 180 | ---- |
| 181 | |
| 182 | The output JAR files for individual plugins will be placed in: |
| 183 | |
| 184 | ---- |
| 185 | buck-out/gen/plugins/<name>/<name>.jar |
| 186 | ---- |
| 187 | |
| 188 | The JAR files will also be packaged in: |
| 189 | |
| 190 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 191 | buck-out/gen/plugins/core/core.zip |
David Pursehouse | 0bc51db | 2013-05-14 12:46:49 +0900 | [diff] [blame] | 192 | ---- |
| 193 | |
| 194 | To build a specific plugin: |
| 195 | |
| 196 | ---- |
Shawn Pearce | 6586c20 | 2013-11-09 08:54:48 -0800 | [diff] [blame] | 197 | buck build plugins/<name>:<name> |
David Pursehouse | 0bc51db | 2013-05-14 12:46:49 +0900 | [diff] [blame] | 198 | ---- |
| 199 | |
| 200 | The output JAR file will be be placed in: |
| 201 | |
| 202 | ---- |
| 203 | buck-out/gen/plugins/<name>/<name>.jar |
| 204 | ---- |
| 205 | |
| 206 | Note that when building an individual plugin, the `core.zip` package |
| 207 | is not regenerated. |
| 208 | |
Shawn Pearce | 6586c20 | 2013-11-09 08:54:48 -0800 | [diff] [blame] | 209 | Additional plugins with BUCK files can be added to the build |
| 210 | environment by cloning the source repository into the plugins |
| 211 | subdirectory: |
| 212 | |
| 213 | ---- |
| 214 | git clone https://gerrit.googlesource.com/plugins/<name> plugins/<name> |
| 215 | echo /plugins/<name> >>.git/info/exclude |
| 216 | ---- |
| 217 | |
| 218 | Additional plugin sources will be automatically added to Eclipse the |
| 219 | next time project.py is run: |
| 220 | |
| 221 | ---- |
| 222 | tools/eclipse/project.py |
| 223 | ---- |
| 224 | |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 225 | |
| 226 | [[documentation]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 227 | === Documentation |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 228 | |
Yuxuan 'fishy' Wang | f780397 | 2014-09-03 12:23:21 -0700 | [diff] [blame] | 229 | To build only the documentation for testing or static hosting: |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 230 | |
| 231 | ---- |
| 232 | buck build docs |
| 233 | ---- |
| 234 | |
Yuxuan 'fishy' Wang | f780397 | 2014-09-03 12:23:21 -0700 | [diff] [blame] | 235 | The generated html files will NOT come with the search box, and will be |
| 236 | placed in: |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 237 | |
| 238 | ---- |
Yuxuan 'fishy' Wang | f780397 | 2014-09-03 12:23:21 -0700 | [diff] [blame] | 239 | buck-out/gen/Documentation/searchfree__tmp/Documentation |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 240 | ---- |
| 241 | |
Yuxuan 'fishy' Wang | f780397 | 2014-09-03 12:23:21 -0700 | [diff] [blame] | 242 | The html files will also be bundled into `searchfree.zip` in this location: |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 243 | |
David Ostrovsky | 7cd233e | 2013-09-26 07:21:31 +0200 | [diff] [blame] | 244 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 245 | buck-out/gen/Documentation/searchfree/searchfree.zip |
David Ostrovsky | 7cd233e | 2013-09-26 07:21:31 +0200 | [diff] [blame] | 246 | ---- |
David Pursehouse | 90a9c10 | 2013-09-06 18:42:10 +0900 | [diff] [blame] | 247 | |
David Pursehouse | c08d03e | 2013-12-10 18:16:10 +0900 | [diff] [blame] | 248 | To build the executable WAR with the documentation included: |
| 249 | |
| 250 | ---- |
| 251 | buck build withdocs |
| 252 | ---- |
| 253 | |
| 254 | The WAR file will be placed in: |
| 255 | |
| 256 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 257 | buck-out/gen/withdocs/withdocs.war |
David Pursehouse | c08d03e | 2013-12-10 18:16:10 +0900 | [diff] [blame] | 258 | ---- |
| 259 | |
Shawn Pearce | 1657046 | 2015-01-14 16:27:42 -0800 | [diff] [blame] | 260 | [[soyc]] |
| 261 | === GWT Compile Report |
| 262 | |
| 263 | The GWT compiler can output a compile report (or "story of your compile"), |
| 264 | describing the size of the JavaScript and which source classes contributed |
| 265 | to the overall download size. |
| 266 | |
| 267 | ---- |
| 268 | buck build soyc |
| 269 | ---- |
| 270 | |
| 271 | The report will be written as an HTML page to the extras directory, and |
| 272 | can be opened and viewed in any web browser: |
| 273 | |
| 274 | ---- |
| 275 | extras/gerrit_ui/soycReport/compile-report/index.html |
| 276 | ---- |
| 277 | |
| 278 | Only the "Split Point Report" is created, "Compiler Metrics" are not output. |
| 279 | |
David Ostrovsky | 811e603 | 2013-09-06 08:35:45 +0200 | [diff] [blame] | 280 | [[release]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 281 | === Gerrit Release WAR File |
David Ostrovsky | 811e603 | 2013-09-06 08:35:45 +0200 | [diff] [blame] | 282 | |
| 283 | To build the release of the Gerrit web application, including documentation and |
| 284 | all core plugins: |
| 285 | |
| 286 | ---- |
| 287 | buck build release |
| 288 | ---- |
| 289 | |
| 290 | The output release WAR will be placed in: |
| 291 | |
| 292 | ---- |
David Ostrovsky | f377aa9 | 2015-09-14 17:46:28 +0900 | [diff] [blame] | 293 | buck-out/gen/release/release.war |
David Ostrovsky | 811e603 | 2013-09-06 08:35:45 +0200 | [diff] [blame] | 294 | ---- |
David Pursehouse | 0bc51db | 2013-05-14 12:46:49 +0900 | [diff] [blame] | 295 | |
David Pursehouse | 5861a9a | 2013-05-15 10:25:19 +0900 | [diff] [blame] | 296 | [[tests]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 297 | == Running Unit Tests |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 298 | |
Dave Borowitz | afd7d39 | 2015-06-22 09:48:33 -0700 | [diff] [blame] | 299 | To run all tests including acceptance tests (but not flaky tests): |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 300 | |
| 301 | ---- |
Dave Borowitz | afd7d39 | 2015-06-22 09:48:33 -0700 | [diff] [blame] | 302 | buck test --exclude flaky |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 303 | ---- |
| 304 | |
Dave Borowitz | afd7d39 | 2015-06-22 09:48:33 -0700 | [diff] [blame] | 305 | To exclude flaky and slow tests: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 306 | |
| 307 | ---- |
Dave Borowitz | afd7d39 | 2015-06-22 09:48:33 -0700 | [diff] [blame] | 308 | buck test --exclude flaky slow |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 309 | ---- |
| 310 | |
Christian Aistleitner | 9fb5881 | 2015-06-21 19:46:11 +0200 | [diff] [blame] | 311 | To run only a specific group of acceptance tests: |
David Ostrovsky | c4e0ac6 | 2014-04-21 18:25:18 +0200 | [diff] [blame] | 312 | |
| 313 | ---- |
Christian Aistleitner | 9fb5881 | 2015-06-21 19:46:11 +0200 | [diff] [blame] | 314 | buck test --include api |
David Ostrovsky | c4e0ac6 | 2014-04-21 18:25:18 +0200 | [diff] [blame] | 315 | ---- |
| 316 | |
| 317 | The following groups of tests are currently supported: |
| 318 | |
Christian Aistleitner | b03fc1a | 2015-06-21 19:49:12 +0200 | [diff] [blame] | 319 | * acceptance |
David Ostrovsky | c4e0ac6 | 2014-04-21 18:25:18 +0200 | [diff] [blame] | 320 | * api |
David Ostrovsky | 4efb0f2 | 2014-12-18 08:55:13 +0100 | [diff] [blame] | 321 | * edit |
Dave Borowitz | afd7d39 | 2015-06-22 09:48:33 -0700 | [diff] [blame] | 322 | * flaky |
David Ostrovsky | c4e0ac6 | 2014-04-21 18:25:18 +0200 | [diff] [blame] | 323 | * git |
| 324 | * pgm |
| 325 | * rest |
| 326 | * server |
| 327 | * ssh |
Christian Aistleitner | b03fc1a | 2015-06-21 19:49:12 +0200 | [diff] [blame] | 328 | * slow |
David Ostrovsky | c4e0ac6 | 2014-04-21 18:25:18 +0200 | [diff] [blame] | 329 | |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 330 | To run a specific test group, e.g. the rest-account test group: |
Edwin Kempin | 674078a | 2013-08-20 11:37:14 +0200 | [diff] [blame] | 331 | |
| 332 | ---- |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 333 | buck test //gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account:rest-account |
Edwin Kempin | 674078a | 2013-08-20 11:37:14 +0200 | [diff] [blame] | 334 | ---- |
| 335 | |
David Ostrovsky | faec805 | 2014-08-10 00:32:52 +0200 | [diff] [blame] | 336 | To create test coverage report: |
| 337 | |
| 338 | ---- |
| 339 | buck test --code-coverage --code-coverage-format html --no-results-cache |
| 340 | ---- |
| 341 | |
| 342 | The HTML report is created in `buck-out/gen/jacoco/code-coverage/index.html`. |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 343 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 344 | == Dependencies |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 345 | |
| 346 | Dependency JARs are normally downloaded automatically, but Buck can inspect |
| 347 | its graph and download any missing JAR files. This is useful to enable |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 348 | subsequent builds to run without network access: |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 349 | |
| 350 | ---- |
Shawn Pearce | a7a3ee1 | 2013-09-20 10:42:37 -0700 | [diff] [blame] | 351 | tools/download_all.py |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 352 | ---- |
| 353 | |
David Pursehouse | b46cf49 | 2013-05-14 09:41:30 +0900 | [diff] [blame] | 354 | When downloading from behind a proxy (which is common in some corporate |
| 355 | environments), it might be necessary to explicitly specify the proxy that |
| 356 | is then used by `curl`: |
| 357 | |
| 358 | ---- |
| 359 | export http_proxy=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port> |
| 360 | ---- |
| 361 | |
Shawn Pearce | 1b89f85 | 2013-05-13 20:26:34 -0700 | [diff] [blame] | 362 | Redirection to local mirrors of Maven Central and the Gerrit storage |
| 363 | bucket is supported by defining specific properties in |
| 364 | `local.properties`, a file that is not tracked by Git: |
| 365 | |
| 366 | ---- |
| 367 | echo download.GERRIT = http://nexus.my-company.com/ >>local.properties |
| 368 | echo download.MAVEN_CENTRAL = http://nexus.my-company.com/ >>local.properties |
| 369 | ---- |
| 370 | |
David Pursehouse | 6fb2c4d | 2013-05-16 16:51:46 +0900 | [diff] [blame] | 371 | The `local.properties` file may be placed in the root of the gerrit repository |
| 372 | being built, or in `~/.gerritcodereview/`. The file in the root of the gerrit |
| 373 | repository has precedence. |
| 374 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 375 | == Building against unpublished Maven JARs |
David Ostrovsky | ee9f992 | 2013-08-15 00:21:04 +0200 | [diff] [blame] | 376 | |
| 377 | To build against unpublished Maven JARs, like gwtorm or PrologCafe, the custom |
David Pursehouse | b99db5c | 2013-09-26 11:34:42 +0900 | [diff] [blame] | 378 | JARs must be installed in the local Maven repository (`mvn clean install`) and |
| 379 | `maven_jar()` must be updated to point to the `MAVEN_LOCAL` Maven repository for |
David Ostrovsky | ee9f992 | 2013-08-15 00:21:04 +0200 | [diff] [blame] | 380 | that artifact: |
| 381 | |
David Pursehouse | b99db5c | 2013-09-26 11:34:42 +0900 | [diff] [blame] | 382 | [source,python] |
David Ostrovsky | ee9f992 | 2013-08-15 00:21:04 +0200 | [diff] [blame] | 383 | ---- |
| 384 | maven_jar( |
| 385 | name = 'gwtorm', |
| 386 | id = 'gwtorm:gwtorm:42', |
David Ostrovsky | ee9f992 | 2013-08-15 00:21:04 +0200 | [diff] [blame] | 387 | license = 'Apache2.0', |
| 388 | repository = MAVEN_LOCAL, |
| 389 | ) |
| 390 | ---- |
| 391 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 392 | == Building against artifacts from custom Maven repositories |
David Ostrovsky | 2536d06 | 2013-11-14 00:35:07 +0100 | [diff] [blame] | 393 | |
| 394 | To build against custom Maven repositories, two modes of operations are |
| 395 | supported: with rewrite in local.properties and without. |
| 396 | |
| 397 | Without rewrite the URL of custom Maven repository can be directly passed |
| 398 | to the maven_jar() function: |
| 399 | |
| 400 | [source,python] |
| 401 | ---- |
| 402 | GERRIT_FORGE = 'http://gerritforge.com/snapshot' |
| 403 | |
| 404 | maven_jar( |
| 405 | name = 'gitblit', |
| 406 | id = 'com.gitblit:gitblit:1.4.0', |
| 407 | sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa', |
| 408 | license = 'Apache2.0', |
| 409 | repository = GERRIT_FORGE, |
| 410 | ) |
| 411 | ---- |
| 412 | |
| 413 | When the custom URL has to be rewritten, then the same logic as with Gerrit |
| 414 | known Maven repository is used: Repo name must be defined that matches an entry |
| 415 | in local.properties file: |
| 416 | |
| 417 | ---- |
| 418 | download.GERRIT_FORGE = http://my.company.mirror/gerrit-forge |
| 419 | ---- |
| 420 | |
| 421 | And corresponding BUCK excerpt: |
| 422 | |
| 423 | [source,python] |
| 424 | ---- |
| 425 | GERRIT_FORGE = 'GERRIT_FORGE:' |
| 426 | |
| 427 | maven_jar( |
| 428 | name = 'gitblit', |
| 429 | id = 'com.gitblit:gitblit:1.4.0', |
| 430 | sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa', |
| 431 | license = 'Apache2.0', |
| 432 | repository = GERRIT_FORGE, |
| 433 | ) |
| 434 | ---- |
| 435 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 436 | === Caching Build Results |
Shawn Pearce | 9e4e243 | 2013-05-30 13:09:29 -0700 | [diff] [blame] | 437 | |
| 438 | Build results can be locally cached, saving rebuild time when |
| 439 | switching between Git branches. Buck's documentation covers |
| 440 | caching in link:http://facebook.github.io/buck/concept/buckconfig.html[buckconfig]. |
| 441 | The trivial case using a local directory is: |
| 442 | |
| 443 | ---- |
| 444 | cat >.buckconfig.local <<EOF |
| 445 | [cache] |
| 446 | mode = dir |
| 447 | dir = buck-cache |
| 448 | EOF |
| 449 | ---- |
| 450 | |
David Pursehouse | 6c3fd80 | 2014-10-24 13:50:44 +0900 | [diff] [blame] | 451 | [[clean-cache]] |
| 452 | === Cleaning The Buck Cache |
| 453 | |
| 454 | The cache for the Gerrit Code Review project is located in |
Christian Aistleitner | 6f6de0d | 2015-03-26 14:25:03 +0100 | [diff] [blame] | 455 | `~/.gerritcodereview/buck-cache/locally-built-artifacts`. |
David Pursehouse | 6c3fd80 | 2014-10-24 13:50:44 +0900 | [diff] [blame] | 456 | |
| 457 | The Buck cache should never need to be manually deleted. If you find yourself |
| 458 | deleting the Buck cache regularly, then it is likely that there is something |
| 459 | wrong with your environment or your workflow. |
| 460 | |
| 461 | If you really do need to clean the cache manually, then: |
| 462 | |
| 463 | ---- |
Christian Aistleitner | 6f6de0d | 2015-03-26 14:25:03 +0100 | [diff] [blame] | 464 | rm -rf ~/.gerritcodereview/buck-cache/locally-built-artifacts |
David Pursehouse | 6c3fd80 | 2014-10-24 13:50:44 +0900 | [diff] [blame] | 465 | ---- |
| 466 | |
Christian Aistleitner | 6f6de0d | 2015-03-26 14:25:03 +0100 | [diff] [blame] | 467 | Note that the root `buck-cache` folder should not be deleted as it also contains |
| 468 | the `downloaded-artifacts` directory, which holds the artifacts that got |
| 469 | downloaded (not built locally). |
David Pursehouse | 6c3fd80 | 2014-10-24 13:50:44 +0900 | [diff] [blame] | 470 | |
Edwin Kempin | 9a8b1dc | 2013-09-16 09:08:34 +0200 | [diff] [blame] | 471 | [[buck-daemon]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 472 | === Using Buck daemon |
David Ostrovsky | d5ae8d3 | 2013-09-15 20:10:17 +0200 | [diff] [blame] | 473 | |
David Pursehouse | b99db5c | 2013-09-26 11:34:42 +0900 | [diff] [blame] | 474 | Buck ships with a daemon command `buckd`, which uses the |
David Ostrovsky | d5ae8d3 | 2013-09-15 20:10:17 +0200 | [diff] [blame] | 475 | link:https://github.com/martylamb/nailgun[Nailgun] protocol for running |
| 476 | Java programs from the command line without incurring the JVM startup |
David Pursehouse | b99db5c | 2013-09-26 11:34:42 +0900 | [diff] [blame] | 477 | overhead. |
| 478 | |
| 479 | Using a Buck daemon can save significant amounts of time as it avoids the |
| 480 | overhead of starting a Java virtual machine, loading the buck class files |
| 481 | and parsing the build files for each command. |
| 482 | |
| 483 | It is safe to run several buck daemons started from different project |
| 484 | directories and they will not interfere with each other. Buck's documentation |
| 485 | covers daemon in http://facebook.github.io/buck/command/buckd.html[buckd]. |
| 486 | |
David Ostrovsky | 26e3be6 | 2014-05-23 08:34:07 +0200 | [diff] [blame] | 487 | To use `buckd` the additional |
| 488 | link:https://facebook.github.io/watchman[watchman] program must be installed. |
| 489 | |
David Ostrovsky | 3717542 | 2014-09-22 09:55:40 +0200 | [diff] [blame] | 490 | To disable `buckd`, the environment variable `NO_BUCKD` must be set. It's not |
| 491 | recommended to put it in the shell config, as it can be forgotten about it and |
| 492 | then assumed Buck was working as it should when it should be using buckd. |
| 493 | Prepend the variable to Buck invocation instead: |
| 494 | |
| 495 | ---- |
David Pursehouse | 8d4d316 | 2014-10-24 13:57:06 +0900 | [diff] [blame] | 496 | NO_BUCKD=1 buck build gerrit |
David Ostrovsky | 3717542 | 2014-09-22 09:55:40 +0200 | [diff] [blame] | 497 | ---- |
| 498 | |
David Ostrovsky | 26e3be6 | 2014-05-23 08:34:07 +0200 | [diff] [blame] | 499 | [[watchman]] |
| 500 | === Installing watchman |
| 501 | |
| 502 | Watchman is used internally by Buck to monitor directory trees and is needed |
| 503 | for buck daemon to work properly. Because buckd is activated by default in the |
| 504 | latest version of Buck, it searches for the watchman executable in the |
| 505 | path and issues a warning when it is not found and kills buckd. |
| 506 | |
| 507 | To prepare watchman installation on Linux: |
David Ostrovsky | d5ae8d3 | 2013-09-15 20:10:17 +0200 | [diff] [blame] | 508 | |
| 509 | ---- |
David Ostrovsky | 26e3be6 | 2014-05-23 08:34:07 +0200 | [diff] [blame] | 510 | git clone https://github.com/facebook/watchman.git |
| 511 | cd watchman |
| 512 | ./autogen.sh |
David Ostrovsky | d5ae8d3 | 2013-09-15 20:10:17 +0200 | [diff] [blame] | 513 | ---- |
| 514 | |
David Ostrovsky | 26e3be6 | 2014-05-23 08:34:07 +0200 | [diff] [blame] | 515 | To install it in user home directory (without root privileges): |
| 516 | |
| 517 | ---- |
| 518 | ./configure --prefix $HOME/watchman |
| 519 | make install |
| 520 | ---- |
| 521 | |
| 522 | To install it system wide: |
| 523 | |
| 524 | ---- |
| 525 | ./configure |
| 526 | make |
| 527 | sudo make install |
| 528 | ---- |
| 529 | |
| 530 | Put $HOME/watchman/bin/watchman in path or link to $HOME/bin/watchman. |
| 531 | |
| 532 | To install watchman on OS X: |
| 533 | |
| 534 | ---- |
| 535 | brew install --HEAD watchman |
| 536 | ---- |
| 537 | |
| 538 | See the original documentation for more information: |
| 539 | link:https://facebook.github.io/watchman/docs/install.html[Watchman |
| 540 | installation]. |
| 541 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 542 | === Override Buck's settings |
David Ostrovsky | efaff30 | 2013-09-20 22:36:14 +0200 | [diff] [blame] | 543 | |
Shawn Pearce | 4e1a8bc | 2013-11-28 18:38:30 -0800 | [diff] [blame] | 544 | Additional JVM args for Buck can be set in `.buckjavaargs` in the |
| 545 | project root directory. For example to override Buck's default 1GB |
| 546 | heap size: |
David Ostrovsky | efaff30 | 2013-09-20 22:36:14 +0200 | [diff] [blame] | 547 | |
| 548 | ---- |
Shawn Pearce | 4e1a8bc | 2013-11-28 18:38:30 -0800 | [diff] [blame] | 549 | cat > .buckjavaargs <<EOF |
David Ostrovsky | 3931c16 | 2014-06-15 00:33:40 +0200 | [diff] [blame] | 550 | -Xms8000m -Xmx16000m |
David Ostrovsky | efaff30 | 2013-09-20 22:36:14 +0200 | [diff] [blame] | 551 | EOF |
| 552 | ---- |
| 553 | |
David Ostrovsky | fe2934e | 2014-04-22 00:36:12 +0200 | [diff] [blame] | 554 | == Rerun unit tests |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 555 | |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 556 | Test execution results are cached by Buck. If a test that was already run |
| 557 | needs to be repeated, the unit test cache for that test must be removed first: |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 558 | |
| 559 | ---- |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 560 | rm -rf buck-out/bin/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account/.rest-account/ |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 561 | ---- |
| 562 | |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 563 | After clearing the cache, the test can be run again: |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 564 | |
| 565 | ---- |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 566 | buck test //gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account:rest-account |
| 567 | [-] TESTING...FINISHED 12,3s (12 PASS/0 FAIL) |
| 568 | RESULTS FOR //gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account:rest-account |
| 569 | PASS 970ms 2 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.CapabilitiesIT |
| 570 | PASS 999ms 1 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.EditPreferencesIT |
| 571 | PASS 1,2s 1 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.GetAccountDetailIT |
| 572 | PASS 951ms 2 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.GetAccountIT |
| 573 | PASS 6,4s 2 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.GetDiffPreferencesIT |
| 574 | PASS 1,2s 4 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.PutUsernameIT |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 575 | TESTS PASSED |
| 576 | ---- |
| 577 | |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 578 | An alternative approach is to use Buck's `--filters` (`-f`) option: |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 579 | |
| 580 | ---- |
David Ostrovsky | 7f66014 | 2015-10-16 17:24:17 +0200 | [diff] [blame] | 581 | buck test -f 'com.google.gerrit.acceptance.rest.account.CapabilitiesIT' |
| 582 | Using buckd. |
| 583 | [-] PROCESSING BUCK FILES...FINISHED 1,0s [100%] |
| 584 | [-] BUILDING...FINISHED 2,8s [100%] (334/701 JOBS, 110 UPDATED, 5,1% CACHE MISS) |
| 585 | [-] TESTING...FINISHED 9,2s (6 PASS/0 FAIL) |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 586 | RESULTS FOR SELECTED TESTS |
David Ostrovsky | 7f66014 | 2015-10-16 17:24:17 +0200 | [diff] [blame] | 587 | PASS 8,0s 2 Passed 0 Skipped 0 Failed com.google.gerrit.acceptance.rest.account.CapabilitiesIT |
David Ostrovsky | bb70615 | 2015-10-16 06:29:17 +0200 | [diff] [blame] | 588 | PASS <100ms 4 Passed 0 Skipped 0 Failed //tools:util_test |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 589 | TESTS PASSED |
| 590 | ---- |
| 591 | |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 592 | When this option is used, the cache is disabled per design and doesn't need to |
David Ostrovsky | 7f66014 | 2015-10-16 17:24:17 +0200 | [diff] [blame] | 593 | be explicitly deleted. Note, that this is a known issue, that python tests are |
| 594 | always executed. |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 595 | |
| 596 | Note that when this option is used, the whole unit test cache is dropped, so |
David Ostrovsky | 074859e | 2014-04-19 22:52:47 +0200 | [diff] [blame] | 597 | repeating the |
| 598 | |
| 599 | ---- |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 600 | buck test |
David Ostrovsky | 074859e | 2014-04-19 22:52:47 +0200 | [diff] [blame] | 601 | ---- |
| 602 | |
David Pursehouse | 56f60a4 | 2014-07-10 11:20:33 +0900 | [diff] [blame] | 603 | causes all tests to be executed again. |
| 604 | |
| 605 | To run tests without using cached results at all, use the `--no-results-cache` |
| 606 | option: |
| 607 | |
| 608 | ---- |
| 609 | buck test --no-results-cache |
| 610 | ---- |
David Ostrovsky | a4ea92e7 | 2014-03-25 06:42:33 -0700 | [diff] [blame] | 611 | |
David Ostrovsky | 4f430f3 | 2016-10-21 23:19:58 +0200 | [diff] [blame] | 612 | == Cross-compiling Java8 to Java7 |
| 613 | |
| 614 | After switching to Java8, we should take care to not end up |
| 615 | with Java8 code in stable branches. We assume that we don't |
| 616 | really want to switch java versions locally every time we switch |
| 617 | branches. |
| 618 | |
| 619 | Given that source level on 'stable-2.13' is 7, source level incompatibility |
| 620 | will be already correctly detected, so that Java8 compiler would refuse |
| 621 | to compile lambdas with -source 7 argument. However, unless bootclasspath |
| 622 | is adjusted to point to Java7 runtime, it's possible to end up with broken |
| 623 | code, that would compile with Java8 but will not run on Java7 runtime. |
| 624 | |
| 625 | To prevent this, add this line to your '.buckconfig.local' in the Gerrit |
| 626 | source root directory when working on stable branches: |
| 627 | |
| 628 | ---- |
| 629 | [java] |
| 630 | extra_arguments = -Xbootclasspath/p:/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre/lib/rt.jar |
| 631 | ---- |
| 632 | |
| 633 | With this in place, methods that were added only in Java8 in runtime library, |
| 634 | would be correctly refused to compile by Java8: |
| 635 | |
| 636 | ---- |
| 637 | $ java -version |
| 638 | openjdk version "1.8.0_101" |
| 639 | |
| 640 | $ buck build gerrit-server:server |
| 641 | /home/davido/projects/gerrit/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectCacheImpl.java:218: error: cannot find symbol |
| 642 | return Collections.emptySortedSet(); |
| 643 | ^ |
| 644 | symbol: method emptySortedSet() |
| 645 | location: class java.util.Collections |
| 646 | ---- |
| 647 | |
David Ostrovsky | 7674c52 | 2015-10-15 04:55:46 +0200 | [diff] [blame] | 648 | == Upgrading Buck |
| 649 | |
| 650 | The following tests should be executed, when Buck version is upgraded: |
| 651 | |
| 652 | * buck build release |
Han-Wen Nienhuys | 2e7f5cc | 2016-04-20 18:15:56 +0200 | [diff] [blame] | 653 | * tools/maven/api.sh install |
David Ostrovsky | 7674c52 | 2015-10-15 04:55:46 +0200 | [diff] [blame] | 654 | * buck test |
David Ostrovsky | e3721d1 | 2015-10-17 00:32:20 +0200 | [diff] [blame] | 655 | * buck build gerrit, change some sources in gerrit-server project, |
| 656 | repeat buck build gerrit and verify that gerrit.war was updated |
David Ostrovsky | 7674c52 | 2015-10-15 04:55:46 +0200 | [diff] [blame] | 657 | * install and verify new gerrit site |
| 658 | * upgrade and verify existing gerrit site |
| 659 | * reindex existing gerrit site |
| 660 | * verify that tools/eclipse/project.py produces sane Eclipse project |
| 661 | * verify that tools/eclipse/project.py --src generates sources as well |
| 662 | * verify that unit test execution from Eclipse works |
| 663 | * verify that daemon started from Eclipse works |
| 664 | * verify that GWT SDM debug session started from Eclipse works |
| 665 | |
David Ostrovsky | 44c7e61 | 2015-06-16 08:58:48 +0200 | [diff] [blame] | 666 | == Known issues and bugs |
| 667 | |
| 668 | === Symbolic links and `watchman` |
| 669 | |
| 670 | `Buck` with activated `Watchman` has currently a |
| 671 | [known bug](https://github.com/facebook/buck/issues/341) related to |
| 672 | symbolic links. The symbolic links are used very often with external |
| 673 | plugins, that are linked per symbolic link to the plugins directory. |
David Pursehouse | a61ee50 | 2016-09-06 16:27:09 +0900 | [diff] [blame] | 674 | With this use case Buck is failing to rebuild the plugin artifact |
David Ostrovsky | 44c7e61 | 2015-06-16 08:58:48 +0200 | [diff] [blame] | 675 | after it was built. All attempts to convince Buck to rebuild will fail. |
| 676 | The only known way to recover is to weep out `buck-out` directory. The |
| 677 | better workaround is to avoid using Watchman in this specific use case. |
| 678 | Watchman can either be de-installed or disabled. See |
| 679 | link:#buck-daemon[Using Buck daemon] section above how to temporarily |
| 680 | disable `buckd`. |
| 681 | |
David Pursehouse | 226eaf3 | 2014-12-18 17:49:28 +0900 | [diff] [blame] | 682 | == Troubleshooting Buck |
| 683 | |
| 684 | In some cases problems with Buck itself need to be investigated. See for example |
| 685 | link:https://gerrit-review.googlesource.com/62411[this attempt to upgrade Buck] |
| 686 | and link:https://github.com/facebook/buck/pull/227[the fix that was needed] to |
| 687 | make the update possible. |
| 688 | |
| 689 | To build Gerrit with a custom version of Buck, the following steps are necessary: |
| 690 | |
| 691 | 1. In the Buck git apply any necessary changes from pull requests |
| 692 | 2. Compile Buck with `ant` |
| 693 | 3. In the root of the Gerrit project create a `.nobuckcheck` file to prevent Buck |
| 694 | from updating itself |
| 695 | 4. Replace the sha1 in Gerrit's `.buckversion` file with the required version from |
| 696 | the custom Buck build |
| 697 | 5. Build Gerrit as usual |
| 698 | |
David Pursehouse | d0525a7 | 2013-05-09 17:49:34 +0100 | [diff] [blame] | 699 | GERRIT |
| 700 | ------ |
| 701 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 702 | |
| 703 | SEARCHBOX |
| 704 | --------- |