blob: 0573709547dc87ffbcfb4a756aa5899445317e4c [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:091# Updating clang
2
Nico Weber4071eca2018-09-25 12:29:143We distribute prebuilt packages of LLVM binaries, including clang and lld, that
4all developers and bots pull at `gclient runhooks` time. These binaries are
5just regular LLVM binaries built at a fixed upstream revision. This document
6describes how to build a package at a newer revision and update Chromium to it.
7An archive of all packages built so far is at https://is.gd/chromeclang
8
Nico Weberf218afd2018-09-20 19:11:2191. Check that https://ci.chromium.org/p/chromium/g/chromium.clang/console
Arthur Eubanksa8722a52020-08-25 17:15:1210 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.
nodir06cbaa02015-08-25 17:15:24131. Sync your Chromium tree to the latest revision to pick up any plugin
Arthur Eubanksf055cc52020-06-10 02:21:3714 changes.
Nico Weber98926b022020-06-28 11:27:36151. 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 Eubanksf055cc52020-06-10 02:21:3722 [email protected] to find someone who does.
Arthur Eubanksa8722a52020-08-25 17:15:1223 * 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 Weber916702902020-01-30 19:25:47291. Run an exhaustive set of try jobs to test the new compiler. The CL
Arthur Eubanksf055cc52020-06-10 02:21:3730 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).
331. Commit the roll CL from the previous step.
nodir06cbaa02015-08-25 17:15:24341. The bots will now pull the prebuilt binary, and goma will have a matching
35 binary, too.
Nico Weber4071eca2018-09-25 12:29:1436
Arthur Eubanks637eab42020-06-15 18:03:0737## Performance regressions
38
39After doing a clang roll, you may get a performance bug assigned to you
40([example](https://crbug.com/1094671)). Some performance noise is expected
41while doing a clang roll.
42
43You can check all performance data for a clang roll via
44`https://chromeperf.appspot.com/group_report?rev=XXXXXX`, where `XXXXXX` is the
45revision number, e.g. `778090` for the example bug (look in the first message
46of the performance bug to find this). Click the checkboxes to display graphs.
47Hover over points in the graph to see the value and error.
48
49Serious regressions require bisecting upstream commits (TODO: how to repro?).
50If the regressions look insignificant and there is green as well as red, you
51can close the bug as "WontFix" with an explanation.
52
Nico Weber4071eca2018-09-25 12:29:1453## Adding files to the clang package
54
55The clang package is downloaded unconditionally by all bots and devs. It's
56called "clang" for historical reasons, but nowadays also contains other
57mission-critical toolchain pieces besides clang.
58
59We try to limit the contents of the clang package. They should meet these
60criteria:
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
66If you want to add something to the clang package that doesn't (yet?) meet
67these criteria, you can make package.py upload it to a separate zip file
Hans Wennborg8ee64a12019-11-05 17:31:3068and then download it on an opt-in basis by using update.py's --package option.
Nico Weber4071eca2018-09-25 12:29:1469
70If you're adding a new feature that you expect will meet the inclusion criteria
71eventually but doesn't yet, start by having your things in a separate zip
72and move it to the main zip once the criteria are met.