Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Side by Side Diff: tools/mb/docs/user_guide.md

Issue 2160353003: Implement multi-phase build support in MB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # The MB (Meta-Build wrapper) user guide 1 # The MB (Meta-Build wrapper) user guide
2 2
3 [TOC] 3 [TOC]
4 4
5 ## Introduction 5 ## Introduction
6 6
7 `mb` is a simple python wrapper around the GYP and GN meta-build tools to 7 `mb` is a simple python wrapper around the GYP and GN meta-build tools to
8 be used as part of the GYP->GN migration. 8 be used as part of the GYP->GN migration.
9 9
10 It is intended to be used by bots to make it easier to manage the configuration 10 It is intended to be used by bots to make it easier to manage the configuration
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 `mb gen` is responsible for generating the Ninja files by invoking either GYP 105 `mb gen` is responsible for generating the Ninja files by invoking either GYP
106 or GN as appropriate. It takes arguments to specify a build config and 106 or GN as appropriate. It takes arguments to specify a build config and
107 a directory, then runs GYP or GN as appropriate: 107 a directory, then runs GYP or GN as appropriate:
108 108
109 ``` 109 ```
110 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release 110 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release
111 % mb gen -c linux_rel_trybot //out/Release 111 % mb gen -c linux_rel_trybot //out/Release
112 ``` 112 ```
113 113
114 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags 114 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags
115 must be specified so that `mb` can figure out which config to use. 115 must be specified so that `mb` can figure out which config to use. The
116 `--phase` flag must also be used with builders that have multiple
117 build/compile steps (and only with those builders).
116 118
117 By default, MB will look for a bot config file under `//ios/build/bots` (see 119 By default, MB will look for a bot config file under `//ios/build/bots` (see
118 [design_spec.md](the design spec) for details of how the bot config files 120 [design_spec.md](the design spec) for details of how the bot config files
119 work). If no matching one is found, will then look in 121 work). If no matching one is found, will then look in
120 `//tools/mb/mb_config.pyl` to look up the config information, but you can 122 `//tools/mb/mb_config.pyl` to look up the config information, but you can
121 specify a custom config file using the `-f/--config-file` flag. 123 specify a custom config file using the `-f/--config-file` flag.
122 124
123 The path must be a GN-style "source-absolute" path (as above). 125 The path must be a GN-style "source-absolute" path (as above).
124 126
125 You can pass the `-n/--dryrun` flag to mb gen to see what will happen without 127 You can pass the `-n/--dryrun` flag to mb gen to see what will happen without
(...skipping 15 matching lines...) Expand all
141 ### `mb help` 143 ### `mb help`
142 144
143 Produces help output on the other subcommands 145 Produces help output on the other subcommands
144 146
145 ### `mb lookup` 147 ### `mb lookup`
146 148
147 Prints what command will be run by `mb gen` (like `mb gen -n` but does 149 Prints what command will be run by `mb gen` (like `mb gen -n` but does
148 not require you to specify a path). 150 not require you to specify a path).
149 151
150 The `-b/--builder`, `-c/--config`, `-f/--config-file`, `-m/--master`, 152 The `-b/--builder`, `-c/--config`, `-f/--config-file`, `-m/--master`,
151 `-q/--quiet`, and `-v/--verbose` flags work as documented for `mb gen`. 153 `--phase`, `-q/--quiet`, and `-v/--verbose` flags work as documented for
154 `mb gen`.
152 155
153 ### `mb validate` 156 ### `mb validate`
154 157
155 Does internal checking to make sure the config file is syntactically 158 Does internal checking to make sure the config file is syntactically
156 valid and that all of the entries are used properly. It does not validate 159 valid and that all of the entries are used properly. It does not validate
157 that the flags make sense, or that the builder names are legal or 160 that the flags make sense, or that the builder names are legal or
158 comprehensive, but it does complain about configs and mixins that aren't 161 comprehensive, but it does complain about configs and mixins that aren't
159 used. 162 used.
160 163
161 The `-f/--config-file` and `-q/--quiet` flags work as documented for 164 The `-f/--config-file` and `-q/--quiet` flags work as documented for
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 should never need to (or want to) build a configuration that isn't 196 should never need to (or want to) build a configuration that isn't
194 listed here, and so by using the configs in this file you can avoid 197 listed here, and so by using the configs in this file you can avoid
195 having to juggle long lists of GYP_DEFINES and gn args by hand. 198 having to juggle long lists of GYP_DEFINES and gn args by hand.
196 199
197 `mb_config.pyl` is structured as a file containing a single PYthon Literal 200 `mb_config.pyl` is structured as a file containing a single PYthon Literal
198 expression: a dictionary with three main keys, `masters`, `configs` and 201 expression: a dictionary with three main keys, `masters`, `configs` and
199 `mixins`. 202 `mixins`.
200 203
201 The `masters` key contains a nested series of dicts containing mappings 204 The `masters` key contains a nested series of dicts containing mappings
202 of master -> builder -> config . This allows us to isolate the buildbot 205 of master -> builder -> config . This allows us to isolate the buildbot
203 recipes from the actual details of the configs. 206 recipes from the actual details of the configs. The config should either
207 be a single string value representing a key in the `configs` dictionary,
208 or a list of strings, each of which is a key in the `configs` dictionary;
209 the latter case is for builders that do multiple compiles with different
210 arguments in a single build, and must *only* be used for such builders
211 (where a --phase argument must be supplied in each lookup or gen call).
204 212
205 The `configs` key points to a dictionary of named build 213 The `configs` key points to a dictionary of named build configurations.
206 configurations.
207 214
208 There should be an key in this dict for every supported configuration 215 There should be an key in this dict for every supported configuration
209 of Chromium, meaning every configuration we have a bot for, and every 216 of Chromium, meaning every configuration we have a bot for, and every
210 configuration commonly used by develpers but that we may not have a bot 217 configuration commonly used by develpers but that we may not have a bot
211 for. 218 for.
212 219
213 The value of each key is a list of "mixins" that will define what that 220 The value of each key is a list of "mixins" that will define what that
214 build_config does. Each item in the list must be an entry in the dictionary 221 build_config does. Each item in the list must be an entry in the dictionary
215 value of the `mixins` key. 222 value of the `mixins` key.
216 223
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 run than you expect; running `'mb -v'` will print what it's doing and 288 run than you expect; running `'mb -v'` will print what it's doing and
282 run the commands; `'mb -n'` will print what it will do but *not* run 289 run the commands; `'mb -n'` will print what it will do but *not* run
283 the commands. 290 the commands.
284 291
285 If you hit weirder things than that, add some print statements to the 292 If you hit weirder things than that, add some print statements to the
286 python script, send a question to gn-dev@chromium.org, or 293 python script, send a question to gn-dev@chromium.org, or
287 [file a bug](https://crbug.com/new) with the label 294 [file a bug](https://crbug.com/new) with the label
288 'mb' and cc: dpranke@chromium.org. 295 'mb' and cc: dpranke@chromium.org.
289 296
290 297
OLDNEW
« no previous file with comments | « tools/mb/docs/design_spec.md ('k') | tools/mb/mb.py » ('j') | tools/mb/mb_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698