Handle missing dependencies in mixed builds
Bazel will fail on queries with missing dependencies. Instead, we check
for missing dependencies in mixed builds and we fall back to Soong when
we are aware of missing dependencies in a module.
Test: go test soong tests
Change-Id: I4f83752704970d8b43650d5b55ff35799c7bc625
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index 5291eca..a3c51c2 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -29,6 +29,7 @@
"android/soong/bazel/cquery"
"android/soong/shared"
"android/soong/starlark_fmt"
+
"github.com/google/blueprint"
"github.com/google/blueprint/metrics"
@@ -73,14 +74,12 @@
}
)
-func init() {
- RegisterMixedBuildsMutator(InitRegistrationContext)
+func registerMixedBuildsMutator(ctx RegisterMutatorsContext) {
+ ctx.BottomUp("mixed_builds_prep", mixedBuildsPrepareMutator).Parallel()
}
func RegisterMixedBuildsMutator(ctx RegistrationContext) {
- ctx.FinalDepsMutators(func(ctx RegisterMutatorsContext) {
- ctx.BottomUp("mixed_builds_prep", mixedBuildsPrepareMutator).Parallel()
- })
+ ctx.FinalDepsMutators(registerMixedBuildsMutator)
}
func mixedBuildsPrepareMutator(ctx BottomUpMutatorContext) {