blob: a24800e0b9e9cdaa4f9bd682dc320da6563ed2fe [file] [log] [blame] [view]
Nico Weber1683eec92020-02-14 12:31:001Configurations supported by the toolchain team
2==============================================
3
4This document describes considerations to follow when adding a new build
5config. A build config is something like a new compiler / linker configuration,
6a new test binary, a new `target_os`, a new `target_cpu`, etc.
7
8Background
9----------
10
11We update our toolchain (the C/C++/Objective-C compiler `clang`, the linker
12`lld`, and a small assortment of helper binaries) every 2-4 weeks.
13
14This toolchain is used to build Chromium for **7+ platforms** (Android,
15Chromecast, Chrome OS, Fuchsia, iOS, Linux, macOS, Windows) targeting
16**4+ CPUs** (arm, arm64, x86, x64) in **6+ build modes** (debug (component
17non-optimized), release (static build optimized), official build (very
18optimized and on some platforms LTO+CFI), asan+lsan, msan, tsan), resulting
19in **130+** different test binaries.
20
21Every toolchain update needs to make sure that none of these combinations break.
22
23To have any chance that this works, we continuously build and run tests in
24most of these configurations with trunk clang/llvm, to catch regressions and
Andrew Williamse223ab92021-07-16 23:40:2725intentional changes upstream that cause problems for us.
Nico Weber1683eec92020-02-14 12:31:0026
27When we land a toolchain update, we rely on the CQ to make sure all combinations
28work with the new toolchain. We use all default CQ bots, and a long list of
29opt-in trybots.
30
31The toolchain team has established contacts to most platform owners in
32Chromium, so that we can ask for help quickly when needed.
33
34
35Toolchain guarantees
36--------------------
37
38For configurations that have a bot on the [chromium.clang waterfall](
39https://ci.chromium.org/p/chromium/g/chromium.clang/console) (which
40is where all the bots are that test Chromium with trunk clang/llvm)
41and that are either part of the default CQ or that have an opt-in bot
42that's [used on clang rolls](https://cs.chromium.org/chromium/src/tools/clang/scripts/upload_revision.py?q=upload_revi&sq=package:chromium&g=0&l=33),
43we guarantee that we won't land a toolchain update that breaks that
44configuration.
45
46For configurations that don't have a clang tip-of-tree (ToT) bot or that aren't
47covered on the CQ, **we won't revert toolchain updates**. We will do our best
48to fix things quickly (see below for how to file a good bug) and to fix forward
49to get you unblocked.
50
51
52Talk to the toolchain team to make sure your new config is supported
53--------------------------------------------------------------------
54
55If you add a new build config, or a new bot config: You may want to add a
56chromium.clang ToT bot, and you may want to make sure that there's a CQ bot
57covering your config on clang rolls. (It's ok if it's an opt-in bot, as long as
58you make sure it's
59[opted-in](https://cs.chromium.org/chromium/src/tools/clang/scripts/upload_revision.py?q=upload_revi&sq=package:chromium&g=0&l=33)
60for clang rolls. If your opt-in is based on filename patterns, make sure it
61also fires on changes to `tools/clang/scrips/update.py`.)
62
63Do not use `-mllvm` or `-Xclang` flags. These are internal flags that aren't
64ready for production use yet. Once they're ready, they'll become available
65as regular clang flags.
66
67Follow the style guide. In particular, don't use exceptions.
68
69Talk to us if you're adding a new build config or bot config, if you'd like to
70use an internal flag, if you want to use a flag that's obscure, or if you want
71general advice on toolchain questions (clang@chromium.org, or
72google-internally, lexan@google.com).
73
74Filing good toolchain bugs
75--------------------------
76
77If a toolchain update ("clang roll") broke you, here's how you can file a bug
78that we can act on the quickest:
79
80- File the bug in the `Tools>LLVM` component.
81- Link to the CL with the toolchain update that broke you.
82- Link to a specific build showing the breakage, ideally the first instance
83 of the breakage.
84- If reproducing your problem requires more than a regular Chromium checkout
85 and replicating what the bot you linked to does, or if you can't link to a
86 build: Provide commands on how to reproduce your problem, targeted at someone
87 who knows the chromium build well but doesn't know your feature / platform
88 at all.
Mirko Bonadeif7309de2020-02-17 18:54:4489 - Tell us which repo to check out, if needed.
Nico Weber1683eec92020-02-14 12:31:0090 - Tell us which `args.gn` to use.
91 - Tell us which target to build.
92 - Tell us how to run your test.
93
94We'll try to be helpful, but see "Toolchain guarantees" above.
95
96Compiler updates can expose latent existing bugs in your code, for example
97if you have ODR violations, or other undefined behavior. In that case,
98the fix is to change your code. It can be helpful to make a reduced repro
99case of the problem before looping us in, so that you can check if your problem
100is really due to the toolchain update and not due to a bug in your code.