fix(v8): materialize staged Bazel outputs

This commit is contained in:
Channing Conger
2026-05-09 23:26:36 -07:00
parent 4b238bb0a6
commit 090d9cb93d
2 changed files with 11 additions and 1 deletions

View File

@@ -97,8 +97,10 @@ def bazel_build(
labels: list[str],
compilation_mode: str = "fastbuild",
bazel_configs: list[str] | None = None,
download_toplevel: bool = False,
) -> None:
bazel_configs = bazel_configs or []
download_args = ["--remote_download_toplevel"] if download_toplevel else []
subprocess.run(
[
"bazel",
@@ -108,6 +110,7 @@ def bazel_build(
f"--platforms=@llvm//platforms:{platform}",
*[f"--config={config}" for config in bazel_configs],
*bazel_remote_args(),
*download_args,
*labels,
],
cwd=ROOT,
@@ -123,7 +126,13 @@ def ensure_bazel_output_files(
) -> list[Path]:
# Bazel output paths can be reused across config flips, so existence alone
# does not prove the files match the requested flags.
bazel_build(platform, labels, compilation_mode, bazel_configs)
bazel_build(
platform,
labels,
compilation_mode,
bazel_configs,
download_toplevel=True,
)
outputs = bazel_output_files(platform, labels, compilation_mode, bazel_configs)
missing = [str(path) for path in outputs if not path.exists()]
if missing:

View File

@@ -255,6 +255,7 @@ class RustyV8BazelTest(unittest.TestCase):
["//third_party/v8:pair"],
"opt",
["rusty-v8-upstream-libcxx"],
download_toplevel=True,
)
bazel_output_files.assert_called_once_with(
"macos_arm64",