blob: 332c716838a158d5ec42aaf4001a4b617bf1c420 [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
10 looks reasonably green.
nodir06cbaa02015-08-25 17:15:24111. Sync your Chromium tree to the latest revision to pick up any plugin
rnk61e1abc62016-05-04 16:50:2112 changes
pccc9228e42017-06-16 10:36:53131. Run `python tools/clang/scripts/upload_revision.py NNNN`
hansc3a66162017-05-12 16:27:0714 with the target LLVM SVN revision number. This creates a roll CL on a new
15 branch, uploads it and starts tryjobs that build the compiler binaries into
16 a staging bucket on Google Cloud Storage (GCS).
171. If the clang upload try bots succeed, copy the binaries from the staging
18 bucket to the production one. For example:
19
ingloriond277c61f2017-09-15 23:08:0620 ```shell
Nico Weber8c533212020-01-23 16:39:5621 $ export rev=n123456-abcd1234-1
ingloriond277c61f2017-09-15 23:08:0622 $ for x in Linux_x64 Mac Win ; do \
23 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/clang-$rev.tgz \
24 gs://chromium-browser-clang/$x/clang-$rev.tgz ; \
Nico Weberc3ea97e2019-05-06 22:30:2725 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/clang-$rev-buildlog.txt \
26 gs://chromium-browser-clang/$x/clang-$rev-buildlog.txt ; \
George Burgess IV6d81dc12019-12-05 23:29:2827 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/clang-tidy-$rev.tgz \
28 gs://chromium-browser-clang/$x/clang-tidy-$rev.tgz ; \
ingloriond277c61f2017-09-15 23:08:0629 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/llvmobjdump-$rev.tgz \
30 gs://chromium-browser-clang/$x/llvmobjdump-$rev.tgz ; \
31 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/translation_unit-$rev.tgz \
32 gs://chromium-browser-clang/$x/translation_unit-$rev.tgz ; \
33 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/llvm-code-coverage-$rev.tgz \
34 gs://chromium-browser-clang/$x/llvm-code-coverage-$rev.tgz ; \
Taylor Woll8e5423332019-10-24 17:34:2035 gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/libclang-$rev.tgz \
36 gs://chromium-browser-clang/$x/libclang-$rev.tgz ; \
Hans Wennborg955cfdf2019-07-17 14:00:4737 done && gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/Mac/lld-$rev.tgz \
38 gs://chromium-browser-clang/Mac/lld-$rev.tgz
ingloriond277c61f2017-09-15 23:08:0639 ```
Hans Wennborge583b5e2017-10-11 02:40:5540
George Burgess IV587ef372019-12-14 03:42:2441 **Note** that writing to this bucket requires special permissions. File a
42 bug at g.co/bugatrooper if you don't have these already (e.g.,
43 https://crbug.com/1034081).
44
hansc3a66162017-05-12 16:27:07451. Run the goma package update script to push these packages to goma. If you do
46 not have the necessary credentials to do the upload, ask [email protected]
47 to find someone who does
Nico Weber916702902020-01-30 19:25:47481. Run an exhaustive set of try jobs to test the new compiler. The CL
49 description created by upload_revision.py includes `CQ_INCLUDE_TRYBOTS`
50 lines for all needed bots, so it's sufficient to just run:
ingloriond277c61f2017-09-15 23:08:0651
52 ```shell
Nico Weber916702902020-01-30 19:25:4753 git cl try && \
Hans Wennborgddff3722019-12-13 14:54:0954 git cl try -B chrome/try -b iphone-device -b ipad-device \
55 -b linux-chromeos-chrome
ingloriond277c61f2017-09-15 23:08:0656 ```
57
nodir06cbaa02015-08-25 17:15:24581. Commit roll CL from the first step
591. The bots will now pull the prebuilt binary, and goma will have a matching
60 binary, too.
Nico Weber4071eca2018-09-25 12:29:1461
62## Adding files to the clang package
63
64The clang package is downloaded unconditionally by all bots and devs. It's
65called "clang" for historical reasons, but nowadays also contains other
66mission-critical toolchain pieces besides clang.
67
68We try to limit the contents of the clang package. They should meet these
69criteria:
70
71- things that are used by most developers use most of the time (e.g. a
72 compiler, a linker, sanitizer runtimes)
73- things needed for doing official builds
74
75If you want to add something to the clang package that doesn't (yet?) meet
76these criteria, you can make package.py upload it to a separate zip file
Hans Wennborg8ee64a12019-11-05 17:31:3077and then download it on an opt-in basis by using update.py's --package option.
Nico Weber4071eca2018-09-25 12:29:1478
79If you're adding a new feature that you expect will meet the inclusion criteria
80eventually but doesn't yet, start by having your things in a separate zip
81and move it to the main zip once the criteria are met.