From e268210ea54995dbd3d2fe58702992595189aee9 Mon Sep 17 00:00:00 2001 From: Channing Conger Date: Sat, 14 Mar 2026 08:15:19 +0000 Subject: [PATCH] Fix rusty_v8 runtime archive staging in CI --- .github/scripts/rusty_v8_bazel.py | 32 ++++++++++++---------- .github/workflows/rusty-v8-bazel-build.yml | 6 ++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/scripts/rusty_v8_bazel.py b/.github/scripts/rusty_v8_bazel.py index 59ee54d76d..2653c17193 100644 --- a/.github/scripts/rusty_v8_bazel.py +++ b/.github/scripts/rusty_v8_bazel.py @@ -23,6 +23,11 @@ RUNTIME_LIB_FILENAMES = { "libcxxabi": "liblibcxxabi.static.a", "libunwind": "liblibunwind.static.a", } +RUNTIME_LIB_LABELS = { + "libcxx": "@llvm//runtimes/libcxx:libcxx.static", + "libcxxabi": "@llvm//runtimes/libcxx:libcxxabi.static", + "libunwind": "@llvm//runtimes/libunwind:libunwind.static", +} V8_CACHE_KEY_INPUT_PATTERNS = [ ".bazelrc", ".bazelversion", @@ -120,13 +125,6 @@ def platform_bin_dir(platform: str) -> Path: return bazel_execroot() / "bazel-out" / f"{platform}-fastbuild" / "bin" -def platform_st_bin_dir(platform: str) -> Path: - matches = sorted((bazel_execroot() / "bazel-out").glob(f"{platform}-fastbuild-ST-*/bin")) - if not matches: - raise SystemExit(f"could not find ST bin dir for {platform}") - return matches[-1] - - def toolchain_dir() -> Path: return find_single_path( "external/llvm++http_archive+llvm-toolchain-minimal-*", @@ -153,14 +151,20 @@ def musl_generated_include_dir(platform: str, target: str) -> Path: def static_runtime_libs(platform: str) -> tuple[Path, Path, Path]: - st_bin = platform_st_bin_dir(platform) - libcxx = st_bin / f"external/llvm++llvm_source+libcxx/libcxx.static_/{RUNTIME_LIB_FILENAMES['libcxx']}" - libcxxabi = st_bin / f"external/llvm++llvm_source+libcxxabi/libcxxabi.static_/{RUNTIME_LIB_FILENAMES['libcxxabi']}" - libunwind = st_bin / f"external/llvm++llvm_source+libunwind/libunwind.static_/{RUNTIME_LIB_FILENAMES['libunwind']}" + outputs = bazel_output_files(platform, list(RUNTIME_LIB_LABELS.values())) return ( - first_existing_path([libcxx], "libcxx static archive"), - first_existing_path([libcxxabi], "libcxxabi static archive"), - first_existing_path([libunwind], "libunwind static archive"), + first_existing_path( + [path for path in outputs if path.name == RUNTIME_LIB_FILENAMES["libcxx"]], + "libcxx static archive", + ), + first_existing_path( + [path for path in outputs if path.name == RUNTIME_LIB_FILENAMES["libcxxabi"]], + "libcxxabi static archive", + ), + first_existing_path( + [path for path in outputs if path.name == RUNTIME_LIB_FILENAMES["libunwind"]], + "libunwind static archive", + ), ) diff --git a/.github/workflows/rusty-v8-bazel-build.yml b/.github/workflows/rusty-v8-bazel-build.yml index 43d55019da..3d7bc1da32 100644 --- a/.github/workflows/rusty-v8-bazel-build.yml +++ b/.github/workflows/rusty-v8-bazel-build.yml @@ -99,12 +99,18 @@ jobs: target_suffix="${TARGET//-/_}" lib_target="//third_party/v8:v8_${version_suffix}_${target_suffix}" binding_target="//third_party/v8:src_binding_release_${target_suffix}" + runtime_targets=( + '@llvm//runtimes/libcxx:libcxx.static' + '@llvm//runtimes/libcxx:libcxxabi.static' + '@llvm//runtimes/libunwind:libunwind.static' + ) bazel_args=( build "--platforms=@llvm//platforms:${PLATFORM}" "${lib_target}" "${binding_target}" + "${runtime_targets[@]}" '--remote_download_regex=.*third_party/v8/libv8_.*\.a$' '--remote_download_regex=.*third_party/v8/src_binding_release_.*\.rs$' '--remote_download_regex=.*liblibcxx\.static\.a$'