Repository navigation
[bazel-bot] Include LLVM-libc fullbuild in built configurations - #989
Conversation
7e93139 to
b6eb6ca
Compare
`BazelBuildResult` currently has `stdout`/`stderr` that are only during a build failure. This PR replaces the class with a tagged union of `Success` and `Failure` variants that only carry the fields they need. This PR also removes the `time_taken` field as it's unused. Why refactor this? A followup #989 will need to add another field to the output of `run_bazel_build()`. This field will only be only relevant for the failure case, and I didn't want to add an optional field to `BazelBuildResult`. Assisted-by: LLM written, human reviewed
This PR updates the bazel bot to run `bazel build` in multiple configurations in order to match the Bazel CI [in llvm-project](https://github.com/llvm/llvm-project/blob/edca741aee5041c7d8e346656eba8307972d29aa/.github/workflows/bazel-checks.yml#L61). Specifically, this PR: - Updates `run_bazel_build()` to run Bazel in multiple configs. - Updates the LLM prompt to reflect that it should consider all configs. - Updates build scripts to also pass `--output_base` so that the Bazel analysis cache doesn't get discarded between runs. Passing this to the build scripts is a little bit awkward, since the scripts have no real argument parsing at the moment. The argument needs to be passed to Bazel before the `build` command, so this PR passes the output base via an environment variable. This is ugly, but avoids more complex argument parsing in the build scripts. Assisted-by: LLM written, human reviewed
b6eb6ca to
c08e566
Compare
| for config in configs: | ||
| result = self._run_bazel_build_with_config(config) | ||
| if not result.success: | ||
| return result |
There was a problem hiding this comment.
one downside i see here is that run_bazel_build is only returning stderr for first failing build. The stderr is used to parse targets that to repair the build with bant. It's also used by the agent to figure out what's going on. So this is going to break bant as we don't do multiple tries there but AI case should still work for simple cases (without running out of limit) as there are multiple rounds.
This is not the end of the world but we should at least specify a TODO here with this.
There was a problem hiding this comment.
Thanks, added the TODO. I figured most of the time the bazel bot won't be fixing llvm-libc fullbuild specific changes, so bailing early seemed fine. If we want to fix, we could update the rest of the code to accept multiple failing builds.
c08e566 to
b90ed25
Compare
This PR updates the bazel bot to run
bazel buildin multiple configurations in order to match the Bazel CI in llvm-project.Specifically, this PR:
run_bazel_build()to run Bazel in multiple configs.--output_baseso that the Bazel analysis cache doesn't get discarded between runs. Passing this to the build scripts is a little bit awkward, since the scripts have no real argument parsing at the moment. The argument needs to be passed to Bazel before thebuildcommand, so I've passed it via environment variables to avoid adding more complex arg parsing.Assisted-by: LLM written, human reviewed