andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 1 | # Updating clang |
| 2 | |
Nico Weber | 4071eca | 2018-09-25 12:29:14 | [diff] [blame] | 3 | We distribute prebuilt packages of LLVM binaries, including clang and lld, that |
| 4 | all developers and bots pull at `gclient runhooks` time. These binaries are |
| 5 | just regular LLVM binaries built at a fixed upstream revision. This document |
| 6 | describes how to build a package at a newer revision and update Chromium to it. |
| 7 | An archive of all packages built so far is at https://is.gd/chromeclang |
| 8 | |
Nico Weber | f218afd | 2018-09-20 19:11:21 | [diff] [blame] | 9 | 1. Check that https://ci.chromium.org/p/chromium/g/chromium.clang/console |
Arthur Eubanks | a8722a5 | 2020-08-25 17:15:12 | [diff] [blame] | 10 | looks reasonably green. Red bots with seemingly normal test failures are |
| 11 | usually ok, that likely means the test is broken with the stable Clang as |
| 12 | well. |
nodir | 06cbaa0 | 2015-08-25 17:15:24 | [diff] [blame] | 13 | 1. Sync your Chromium tree to the latest revision to pick up any plugin |
Arthur Eubanks | f055cc5 | 2020-06-10 02:21:37 | [diff] [blame] | 14 | changes. |
Nico Weber | 98926b02 | 2020-06-28 11:27:36 | [diff] [blame] | 15 | 1. Run [go/chrome-push-clang-to-goma](https://goto.google.com/chrome-push-clang-to-goma). |
| 16 | This takes a recent dry run CL to update clang, and if the trybots were |
| 17 | successful it will copy the binaries from the staging bucket to the |
| 18 | production one. Writing to this bucket requires special permissions. File a |
| 19 | bug at g.co/bugatrooper if you don't have these already (e.g., |
| 20 | https://crbug.com/1034081). Then it will push the packages to goma. If you |
| 21 | do not have the necessary credentials to do the upload, ask |
Arthur Eubanks | f055cc5 | 2020-06-10 02:21:37 | [diff] [blame] | 22 | [email protected] to find someone who does. |
Arthur Eubanks | a8722a5 | 2020-08-25 17:15:12 | [diff] [blame] | 23 | * Alternatively, to create your own roll CL, you can manually run |
| 24 | `tools/clang/scripts/upload_revision.py` with a recent upstream LLVM |
| 25 | commit hash as the argument. After the `*_upload_clang` trybots are |
| 26 | successfully finished, run |
| 27 | [go/chrome-promote-clang](https://goto.google.com/chrome-promote-clang) |
| 28 | on the new Clang package name. |
Nico Weber | 91670290 | 2020-01-30 19:25:47 | [diff] [blame] | 29 | 1. Run an exhaustive set of try jobs to test the new compiler. The CL |
Arthur Eubanks | f055cc5 | 2020-06-10 02:21:37 | [diff] [blame] | 30 | description created previously by upload_revision.py includes |
| 31 | `Cq-Include-Trybots:` lines for all needed bots, so it's sufficient to just |
| 32 | run `git cl try` (or hit "CQ DRY RUN" on gerrit). |
| 33 | 1. Commit the roll CL from the previous step. |
nodir | 06cbaa0 | 2015-08-25 17:15:24 | [diff] [blame] | 34 | 1. The bots will now pull the prebuilt binary, and goma will have a matching |
| 35 | binary, too. |
Nico Weber | 4071eca | 2018-09-25 12:29:14 | [diff] [blame] | 36 | |
Arthur Eubanks | 637eab4 | 2020-06-15 18:03:07 | [diff] [blame] | 37 | ## Performance regressions |
| 38 | |
| 39 | After doing a clang roll, you may get a performance bug assigned to you |
| 40 | ([example](https://crbug.com/1094671)). Some performance noise is expected |
| 41 | while doing a clang roll. |
| 42 | |
| 43 | You can check all performance data for a clang roll via |
| 44 | `https://chromeperf.appspot.com/group_report?rev=XXXXXX`, where `XXXXXX` is the |
| 45 | revision number, e.g. `778090` for the example bug (look in the first message |
| 46 | of the performance bug to find this). Click the checkboxes to display graphs. |
| 47 | Hover over points in the graph to see the value and error. |
| 48 | |
| 49 | Serious regressions require bisecting upstream commits (TODO: how to repro?). |
| 50 | If the regressions look insignificant and there is green as well as red, you |
| 51 | can close the bug as "WontFix" with an explanation. |
| 52 | |
Nico Weber | 4071eca | 2018-09-25 12:29:14 | [diff] [blame] | 53 | ## Adding files to the clang package |
| 54 | |
| 55 | The clang package is downloaded unconditionally by all bots and devs. It's |
| 56 | called "clang" for historical reasons, but nowadays also contains other |
| 57 | mission-critical toolchain pieces besides clang. |
| 58 | |
| 59 | We try to limit the contents of the clang package. They should meet these |
| 60 | criteria: |
| 61 | |
| 62 | - things that are used by most developers use most of the time (e.g. a |
| 63 | compiler, a linker, sanitizer runtimes) |
| 64 | - things needed for doing official builds |
| 65 | |
| 66 | If you want to add something to the clang package that doesn't (yet?) meet |
| 67 | these criteria, you can make package.py upload it to a separate zip file |
Hans Wennborg | 8ee64a1 | 2019-11-05 17:31:30 | [diff] [blame] | 68 | and then download it on an opt-in basis by using update.py's --package option. |
Nico Weber | 4071eca | 2018-09-25 12:29:14 | [diff] [blame] | 69 | |
| 70 | If you're adding a new feature that you expect will meet the inclusion criteria |
| 71 | eventually but doesn't yet, start by having your things in a separate zip |
| 72 | and move it to the main zip once the criteria are met. |