| 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 10 matching lines...) Expand all Loading... |
| 21 a directory, then runs GYP or GN as appropriate: | 21 a directory, then runs GYP or GN as appropriate: |
| 22 | 22 |
| 23 ``` | 23 ``` |
| 24 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release | 24 % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release |
| 25 % mb gen -c linux_rel_trybot //out/Release | 25 % mb gen -c linux_rel_trybot //out/Release |
| 26 ``` | 26 ``` |
| 27 | 27 |
| 28 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags | 28 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags |
| 29 must be specified so that `mb` can figure out which config to use. | 29 must be specified so that `mb` can figure out which config to use. |
| 30 | 30 |
| 31 The path must be a GN-style path relative to the checkout root (as above). | 31 The path must be a GN-style "source-absolute" path (as above). |
| 32 | 32 |
| 33 If gen ends up using GYP, the path must have a valid GYP configuration as the | 33 If gen ends up using GYP, the path must have a valid GYP configuration as the |
| 34 last component of the path (i.e., specify `//out/Release_x64`, not `//out`). | 34 last component of the path (i.e., specify `//out/Release_x64`, not `//out`). |
| 35 | 35 |
| 36 ## `mb analyze` | 36 ## `mb analyze` |
| 37 | 37 |
| 38 `mb analyze` is reponsible for determining what targets are affected by | 38 `mb analyze` is reponsible for determining what targets are affected by |
| 39 a list of files (e.g., the list of files in a patch on a trybot): | 39 a list of files (e.g., the list of files in a patch on a trybot): |
| 40 | 40 |
| 41 ``` | 41 ``` |
| 42 mb analyze -c chromium_linux_rel //out/Release input.json output.json | 42 mb analyze -c chromium_linux_rel //out/Release input.json output.json |
| 43 ``` | 43 ``` |
| 44 | 44 |
| 45 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags | 45 Either the `-c/--config` flag or the `-m/--master` and `-b/--builder` flags |
| 46 must be specified so that `mb` can figure out which config to use. | 46 must be specified so that `mb` can figure out which config to use. |
| 47 | 47 |
| 48 | 48 |
| 49 The first positional argument is the path to the build directory. | 49 The first positional argument must be a GN-style "source-absolute" path |
| 50 to the build directory. |
| 50 | 51 |
| 51 The second positional argument is a path to a JSON file containing a single | 52 The second positional argument is a (normal) path to a JSON file containing |
| 52 object with two fields: | 53 a single object with two fields: |
| 53 | 54 |
| 54 * `files`: an array of the modified filenames to check (as | 55 * `files`: an array of the modified filenames to check (as |
| 55 paths relative to the checkout root). | 56 paths relative to the checkout root). |
| 56 * `targets`: an array of the unqualified target names to check. | 57 * `targets`: an array of the unqualified target names to check. |
| 57 | 58 |
| 58 The third positional argument is a path where the mb will write the result, | 59 The third positional argument is a (normal) path to where mb will write |
| 59 also as a JSON object. This object may contain the following fields: | 60 the result, also as a JSON object. This object may contain the following |
| 61 fields: |
| 60 | 62 |
| 61 * `error`: this should only be present if something failed. | 63 * `error`: this should only be present if something failed. |
| 62 * `targets`: the subset of the input `targets` that depend on the | 64 * `targets`: the subset of the input `targets` that depend on the |
| 63 input `files`. | 65 input `files`. |
| 64 * `build_targets`: the minimal subset of targets needed to build all | 66 * `build_targets`: the minimal subset of targets needed to build all |
| 65 of `targets` that were affected. | 67 of `targets` that were affected. |
| 66 * `status`: one of three strings: | 68 * `status`: one of three strings: |
| 67 * `"Found dependency"` (build the `build_targets`) | 69 * `"Found dependency"` (build the `build_targets`) |
| 68 * `"No dependency"` (i.e., no build needed) | 70 * `"No dependency"` (i.e., no build needed) |
| 69 * `"Found dependency (all)"` (build everything, in which case | 71 * `"Found dependency (all)"` (build everything, in which case |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 run than you expect; running `'mb -v'` will print what it's doing and | 186 run than you expect; running `'mb -v'` will print what it's doing and |
| 185 run the commands; `'mb -n'` will print what it will do but *not* run | 187 run the commands; `'mb -n'` will print what it will do but *not* run |
| 186 the commands. | 188 the commands. |
| 187 | 189 |
| 188 If you hit weirder things than that, add some print statements to the | 190 If you hit weirder things than that, add some print statements to the |
| 189 python script, send a question to gn-dev@chromium.org, or | 191 python script, send a question to gn-dev@chromium.org, or |
| 190 [file a bug](https://crbug.com/new) with the label | 192 [file a bug](https://crbug.com/new) with the label |
| 191 'mb' and cc: dpranke@chromium.org. | 193 'mb' and cc: dpranke@chromium.org. |
| 192 | 194 |
| 193 | 195 |
| OLD | NEW |