| 438 | self.clean |= clean |
| 439 | |
| 440 | def update_build_distribution_args(self): |
| 441 | args_gn = self.path / "args.gn" |
| 442 | assert args_gn.exists(), f"args.gn does not exist: {args_gn}" |
| 443 | gn_args = args_gn.read_text() |
| 444 | # Remove custom reclient config path (it will be added again as part of |
| 445 | # the config line below if needed). |
| 446 | new_gn_args = DEPRECATED_RBE_CFG_RE.sub("", gn_args) |
| 447 | new_gn_args = RECLIENT_CFG_RE.sub("", new_gn_args) |
| 448 | new_gn_args = BUILD_DISTRIBUTION_RE.sub(BUILD_DISTRIBUTION_LINE, |
| 449 | new_gn_args) |
| 450 | # Remove stale goma_dir to silence GN warnings about unused options. |
| 451 | new_gn_args = GOMA_DIR_LINE.sub("", new_gn_args) |
| 452 | if gn_args != new_gn_args: |
| 453 | print(f"# Updated gn args:{BUILD_DISTRIBUTION_LINE}") |
| 454 | _write(args_gn, new_gn_args, log=False) |
| 455 | |
| 456 | def build(self): |
| 457 | self.update_build_distribution_args() |