[llvm] [bazel] Mark llvm_configure reproducible (PR #202229)
David Zbarsky via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 7 12:38:12 PDT 2026
https://github.com/dzbarsky created https://github.com/llvm/llvm-project/pull/202229
Author: zbarsky-bot
## Summary
Make `llvm_configure` return `repo_metadata(reproducible = True)` and remove `local = True` and `configure = True` from the repository rule declaration.
## Why
`llvm_configure` originally searched `PATH` for Python and executed `overlay_directories.py` with the host Python interpreter. Those host dependencies justified `local = True` and `configure = True` when the rule was introduced in `4aeb2e60df98`.
Commit `744480a2a6b8` rewrote overlay creation in Starlark and removed the host Python lookup and process execution. The current implementation reads `@llvm-raw` and its checked-in Bazel overlay, reads checked-in CMake files, and creates repository output files and symlinks. It does not read environment variables, inspect `PATH`, or execute host tools.
Returning reproducible repository metadata lets Bazel cache and reuse the repository output according to the repository inputs. The `local` and `configure` classifications are no longer accurate.
## Validation
- `buildifier -mode=check utils/bazel/configure.bzl`
- `git diff --check`
- applied the same patch through hermetic-llvm and ran `bazel mod deps` with Bazel 9.1.0
>From b3d91600bbfb3907b5a8c3d0b2fd0dd32bb64ff8 Mon Sep 17 00:00:00 2001
From: David Zbarsky <dzbarsky at gmail.com>
Date: Sun, 7 Jun 2026 15:37:09 -0400
Subject: [PATCH] [bazel] Mark llvm_configure reproducible
llvm_configure originally used local = True and configure = True because
its implementation searched PATH for Python and executed the overlay
script with the host Python interpreter.
The Starlark overlay rewrite removed that host dependency. The current
implementation only reads @llvm-raw and its checked-in Bazel overlay,
then creates the configured repository's files and symlinks. It does not
read environment variables, inspect PATH, or execute host tools.
Return repo_metadata(reproducible = True) and remove the stale local and
configure classifications. This allows Bazel to cache and reuse the
repository output according to the repository inputs.
---
utils/bazel/configure.bzl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/bazel/configure.bzl b/utils/bazel/configure.bzl
index 2aacb3359fa27..485bd4c9c8854 100644
--- a/utils/bazel/configure.bzl
+++ b/utils/bazel/configure.bzl
@@ -198,10 +198,10 @@ def _llvm_configure_impl(repository_ctx):
executable = False,
)
+ return repository_ctx.repo_metadata(reproducible = True)
+
llvm_configure = repository_rule(
implementation = _llvm_configure_impl,
- local = True,
- configure = True,
attrs = {
"targets": attr.string_list(default = DEFAULT_TARGETS),
},
More information about the llvm-commits
mailing list