From f131b34888e00718ac92ad9b4b81dd5a4f6db70d Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 10 Sep 2026 18:15:22 -0700 Subject: [PATCH] Convert `@avb` into a proper bazel module with full isolation This is a trial for converting the crosvm build, which has isolation issues. Assisted-by: Jetski:GeminiNext Bug: b/559825860 --- base/cvd/MODULE.bazel | 1 + base/cvd/build_external/avb/BUILD.avb.bazel | 2 +- base/cvd/build_external/avb/avb.MODULE.bazel | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/base/cvd/MODULE.bazel b/base/cvd/MODULE.bazel index 831568ad3e3..5797e1c9330 100644 --- a/base/cvd/MODULE.bazel +++ b/base/cvd/MODULE.bazel @@ -8,6 +8,7 @@ bazel_dep(name = "hedron_compile_commands", dev_dependency = True) bazel_dep(name = "abseil-cpp", version = "20260107.0") bazel_dep(name = "aspect_bazel_lib", version = "2.22.0") +bazel_dep(name = "avb") bazel_dep(name = "boringssl", version = "0.20260813.0") bazel_dep(name = "brotli") bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.2") diff --git a/base/cvd/build_external/avb/BUILD.avb.bazel b/base/cvd/build_external/avb/BUILD.avb.bazel index de856087417..9b3379f610c 100644 --- a/base/cvd/build_external/avb/BUILD.avb.bazel +++ b/base/cvd/build_external/avb/BUILD.avb.bazel @@ -1,7 +1,7 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library") package( - default_visibility = ["@//:android_cuttlefish"], + default_visibility = ["//visibility:public"], ) cc_library( diff --git a/base/cvd/build_external/avb/avb.MODULE.bazel b/base/cvd/build_external/avb/avb.MODULE.bazel index d9eeb88a1f2..ad4631979c9 100644 --- a/base/cvd/build_external/avb/avb.MODULE.bazel +++ b/base/cvd/build_external/avb/avb.MODULE.bazel @@ -1,8 +1,18 @@ -git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "avb", +git_override( + module_name = "avb", build_file = "@//build_external/avb:BUILD.avb.bazel", commit = "761178607206f4cb2af79ed9eec52d8cbd814adb", + patch_cmds = [ + """cat << 'EOF' > MODULE.bazel +module( + name = "avb", + version = "0.1", +) + +bazel_dep(name = "boringssl", version = "0.20260813.0") +bazel_dep(name = "rules_cc", version = "0.2.19") +EOF +""", + ], remote = "https://android.googlesource.com/platform/external/avb", )