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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 value of the `mixins` key. | 170 value of the `mixins` key. |
171 | 171 |
172 Each mixin value is itself a dictionary that contains one or more of the | 172 Each mixin value is itself a dictionary that contains one or more of the |
173 following keys: | 173 following keys: |
174 | 174 |
175 * `gyp_crosscompile`: a boolean; if true, GYP_CROSSCOMPILE=1 is set in | 175 * `gyp_crosscompile`: a boolean; if true, GYP_CROSSCOMPILE=1 is set in |
176 the environment and passed to GYP. | 176 the environment and passed to GYP. |
177 * `gyp_defines`: a string containing a list of GYP_DEFINES. | 177 * `gyp_defines`: a string containing a list of GYP_DEFINES. |
178 * `gn_args`: a string containing a list of values passed to gn --args. | 178 * `gn_args`: a string containing a list of values passed to gn --args. |
179 * `mixins`: a list of other mixins that should be included. | 179 * `mixins`: a list of other mixins that should be included. |
180 * `type`: a string with either the value `gyp` or `gn`; | 180 * `type`: a string with either the value `gn`, `gyp`, or `passthrough`; |
181 setting this indicates which meta-build tool to use. | 181 setting this indicates which meta-build tool to use. |
182 | 182 |
183 When `mb gen` or `mb analyze` executes, it takes a config name, looks it | 183 When `mb gen` or `mb analyze` executes, it takes a config name, looks it |
184 up in the 'configs' dict, and then does a left-to-right expansion of the | 184 up in the 'configs' dict, and then does a left-to-right expansion of the |
185 mixins; gyp_defines and gn_args values are concatenated, and the type values | 185 mixins; gyp_defines and gn_args values are concatenated, and the type values |
186 override each other. | 186 override each other. |
187 | 187 |
188 For example, if you had: | 188 For example, if you had: |
189 | 189 |
190 ``` | 190 ``` |
(...skipping 30 matching lines...) Expand all Loading... |
221 } | 221 } |
222 ``` | 222 ``` |
223 | 223 |
224 and you ran `mb gen -c linux_release_trybot //out/Release`, it would | 224 and you ran `mb gen -c linux_release_trybot //out/Release`, it would |
225 translate into a call to `gyp_chromium -G Release` with `GYP_DEFINES` set to | 225 translate into a call to `gyp_chromium -G Release` with `GYP_DEFINES` set to |
226 `"use_goma=true dcheck_always_on=false dcheck_always_on=true"`. | 226 `"use_goma=true dcheck_always_on=false dcheck_always_on=true"`. |
227 | 227 |
228 (From that you can see that mb is intentionally dumb and does not | 228 (From that you can see that mb is intentionally dumb and does not |
229 attempt to de-dup the flags, it lets gyp do that). | 229 attempt to de-dup the flags, it lets gyp do that). |
230 | 230 |
| 231 If `type` is set to `passthrough`, then MB will look for the variable |
| 232 `MB_TYPE` in the environment, which should be set to either `gyp` or |
| 233 `gn`. If it is set to `gyp`, MB will also look for the GYP_DEFINES |
| 234 and GYP_CROSSCOMPILE variables in the environment. If it is set to `gn`, |
| 235 MB will look for the `GN_ARGS` variable in the environment. MB will |
| 236 throw away whatever values were set by the mixins and replace them |
| 237 with the values from the environment variables. This functionality exists |
| 238 in order to make bots that are otherwise already configured by src-side |
| 239 files happy. It is an error if GYP_DEFINES or GN_ARGS is expected to |
| 240 be set and isn't; GYP_CROSSCOMPILE is optional. |
| 241 |
231 ## Debugging MB | 242 ## Debugging MB |
232 | 243 |
233 By design, MB should be simple enough that very little can go wrong. | 244 By design, MB should be simple enough that very little can go wrong. |
234 | 245 |
235 The most obvious issue is that you might see different commands being | 246 The most obvious issue is that you might see different commands being |
236 run than you expect; running `'mb -v'` will print what it's doing and | 247 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 | 248 run the commands; `'mb -n'` will print what it will do but *not* run |
238 the commands. | 249 the commands. |
239 | 250 |
240 If you hit weirder things than that, add some print statements to the | 251 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 | 252 python script, send a question to gn-dev@chromium.org, or |
242 [file a bug](https://crbug.com/new) with the label | 253 [file a bug](https://crbug.com/new) with the label |
243 'mb' and cc: dpranke@chromium.org. | 254 'mb' and cc: dpranke@chromium.org. |
244 | 255 |
245 | 256 |
OLD | NEW |