Skip to content

[bazel-bot] Include LLVM-libc fullbuild in built configurations - #989

Merged
jtstogel merged 4 commits into
llvm:mainfrom
jtstogel:bazel-multi-config
Oct 19, 2026
Merged

jtstogel merged 4 commits into
llvm:mainfrom
jtstogel:bazel-multi-config

Conversation

@jtstogel

@jtstogel jtstogel commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR updates the bazel bot to run bazel build in multiple configurations in order to match the Bazel CI in llvm-project.

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 I've passed it via environment variables to avoid adding more complex arg parsing.

Assisted-by: LLM written, human reviewed

@jtstogel
jtstogel requested a review from pranavk October 14, 2026 22:12
@jtstogel
jtstogel force-pushed the bazel-multi-config branch 3 times, most recently from 7e93139 to b6eb6ca Compare October 14, 2026 23:43
jtstogel added a commit that referenced this pull request Oct 14, 2026
`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
for config in configs:
result = self._run_bazel_build_with_config(config)
if not result.success:
return result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jtstogel
jtstogel merged commit 6eaa6a7 into llvm:main Oct 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants