OLD | NEW |
---|---|
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 16 matching lines...) Expand all Loading... | |
27 mb analyze -c chromium_linux_rel //out/Release input.json output.json | 27 mb analyze -c chromium_linux_rel //out/Release input.json output.json |
28 ``` | 28 ``` |
29 | 29 |
30 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags | 30 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags |
31 must be specified so that `mb` can figure out which config to use. | 31 must be specified so that `mb` can figure out which config to use. |
32 | 32 |
33 The first positional argument must be a GN-style "source-absolute" path | 33 The first positional argument must be a GN-style "source-absolute" path |
34 to the build directory. | 34 to the build directory. |
35 | 35 |
36 The second positional argument is a (normal) path to a JSON file containing | 36 The second positional argument is a (normal) path to a JSON file containing |
37 a single object with two fields: | 37 a single object with the following fields: |
38 | 38 |
39 * `files`: an array of the modified filenames to check (as | 39 * `files`: an array of the modified filenames to check (as paths relative to |
40 paths relative to the checkout root). | 40 the checkout root). |
41 * `targets`: an array of the unqualified target names to check. | 41 * `compile_targets`: an array of (ninja) build targets that reflect the stuff |
42 we might want to rebuild if affected by the patch. The targets may contain | |
43 *meta* (GN: group, GYP: none) targets like 'blink_tests' or | |
44 'chromium_builder_tests', or even the ninja-specific 'all' target. Any | |
45 empty list will be treated as equivalent to ["all"] (build everything). | |
46 * `test_targets`: an array of (ninja) build targets that, if affected, will | |
47 affect which tests we want to run. This is usually a *subset* of | |
48 `compile_targets`. An empty list is treated as if there are no tests | |
49 to run. | |
50 * `targets`: a legacy field that resembled a union of `compile_targets` | |
51 and `test_targets`. Support for this field will be removed once the | |
52 bots have been updated to use compile_targets and test_targets instead. | |
42 | 53 |
43 The third positional argument is a (normal) path to where mb will write | 54 The third positional argument is a (normal) path to where mb will write |
44 the result, also as a JSON object. This object may contain the following | 55 the result, also as a JSON object. This object may contain the following |
45 fields: | 56 fields: |
46 | 57 |
47 * `error`: this should only be present if something failed. | 58 * `error`: this should only be present if something failed. |
48 * `targets`: the subset of the input `targets` that depend on the | 59 * `compile_targets`: the list of ninja targets that should be passed |
49 input `files`. | 60 directly to the corresponding ninja / compile.py invocation. This |
50 * `build_targets`: the minimal subset of targets needed to build all | 61 list may contain entries that are *not* listed in the input (see |
51 of `targets` that were affected. | 62 [design_spec.md](the design spec) for how this works). |
52 * `status`: one of three strings: | 63 * `test_targets`: the subset of the input `test_targets` that are |
64 potentially out of date, indicating that the matching test steps | |
65 should be re-run. | |
66 * `targets`: a legacy field that indicates the subset of the input `targets` | |
67 that depend on the input `files`. | |
68 * `build_targets`: a legacy field that indicates the minimal subset of | |
69 targets needed to build all of `targets` that were affected. | |
70 * `status`: a legacy field containing one of three strings: | |
71 | |
53 * `"Found dependency"` (build the `build_targets`) | 72 * `"Found dependency"` (build the `build_targets`) |
54 * `"No dependency"` (i.e., no build needed) | 73 * `"No dependency"` (i.e., no build needed) |
55 * `"Found dependency (all)"` (build everything, in which case | 74 * `"Found dependency (all)"` (build everything, in which case |
56 `targets` and `build_targets` are not returned). | 75 `targets` and `build_targets` are not returned). |
76 | |
77 This field is no longer needed with the newer compile_targets and | |
78 test_targets outputs, and will be removed along with `targets` and | |
79 `build_targets` once all the bots have been updated. | |
Dirk Pranke
2015/11/06 04:34:19
NB: this might surprise you.
Dirk Pranke
2015/11/06 05:08:47
Actually, having thought about this some more, I t
| |
80 | |
81 The differences between `compile_targets` and `test_targets` and between | |
82 how they are treated as input and output is subtle and complicated; see | |
83 [design_spec.md](the design spec) for details. We won't even go into how | |
84 the `targets` and `build_targets` differ from each other or from | |
85 `compile_targets` and `test_targets`. | |
57 | 86 |
58 The `-b/--builder`, `-c/--config`, `-f/--config-file`, `-m/--master`, | 87 The `-b/--builder`, `-c/--config`, `-f/--config-file`, `-m/--master`, |
59 `-q/--quiet`, and `-v/--verbose` flags work as documented for `mb gen`. | 88 `-q/--quiet`, and `-v/--verbose` flags work as documented for `mb gen`. |
60 | 89 |
61 | |
62 ### `mb gen` | 90 ### `mb gen` |
63 | 91 |
64 `mb gen` is responsible for generating the Ninja files by invoking either GYP | 92 `mb gen` is responsible for generating the Ninja files by invoking either GYP |
65 or GN as appropriate. It takes arguments to specify a build config and | 93 or GN as appropriate. It takes arguments to specify a build config and |
66 a directory, then runs GYP or GN as appropriate: | 94 a directory, then runs GYP or GN as appropriate: |
67 | 95 |
68 ``` | 96 ``` |
69 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release | 97 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release |
70 % mb gen -c linux_rel_trybot //out/Release | 98 % mb gen -c linux_rel_trybot //out/Release |
71 ``` | 99 ``` |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 run than you expect; running `'mb -v'` will print what it's doing and | 264 run than you expect; running `'mb -v'` will print what it's doing and |
237 run the commands; `'mb -n'` will print what it will do but *not* run | 265 run the commands; `'mb -n'` will print what it will do but *not* run |
238 the commands. | 266 the commands. |
239 | 267 |
240 If you hit weirder things than that, add some print statements to the | 268 If you hit weirder things than that, add some print statements to the |
241 python script, send a question to gn-dev@chromium.org, or | 269 python script, send a question to gn-dev@chromium.org, or |
242 [file a bug](https://crbug.com/new) with the label | 270 [file a bug](https://crbug.com/new) with the label |
243 'mb' and cc: dpranke@chromium.org. | 271 'mb' and cc: dpranke@chromium.org. |
244 | 272 |
245 | 273 |
OLD | NEW |