summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Parsons <cparsons@google.com> 2023-10-04 21:51:17 +0000
committer Chris Parsons <cparsons@google.com> 2023-10-05 17:54:34 +0000
commit44215bc31d578e87b8b143385e755469f7a8546f (patch)
tree12c13788b2d424ccf10085009805353bf0ff27dc
parent29c559b785e719042fe3c62138454840037819aa (diff)
Skip certain problematic deps
These are hacks to unblock allowlist v2. See attached bugs. Bug: 303307672 Bug: 303310285 Test: Manually tested to unblock `m nothing` with allowlist v2 on AOSP Change-Id: I076a96134118106b44e105db98617ffb9f33bca5
-rw-r--r--android/bazel_paths.go28
1 files changed, 25 insertions, 3 deletions
diff --git a/android/bazel_paths.go b/android/bazel_paths.go
index a554775fb..f25803ccc 100644
--- a/android/bazel_paths.go
+++ b/android/bazel_paths.go
@@ -452,12 +452,34 @@ func getOtherModuleLabel(ctx Bp2buildMutatorContext, dep, tag string,
Label: ":" + dep + "__BP2BUILD__MISSING__DEP",
}
}
- if markAsDep {
+ // Returns true if a dependency from the current module to the target module
+ // should be skipped; doing so is a hack to circumvent certain problematic
+ // scenarios that will be addressed in the future.
+ shouldSkipDep := func(dep string) bool {
// Don't count dependencies of "libc". This is a hack to circumvent the
// fact that, in a variantless build graph, "libc" has a dependency on itself.
- if ctx.ModuleName() != "libc" {
- ctx.AddDependency(ctx.Module(), Bp2buildDepTag, dep)
+ if ctx.ModuleName() == "libc" {
+ return true
}
+
+ // TODO: b/303307672: Dependencies on this module happen to "work" because
+ // there is a source file with the same name as this module in the
+ // same directory. We should remove this hack and enforce the underlying
+ // module of this name is the actual one used.
+ if dep == "mke2fs.conf" {
+ return true
+ }
+
+ // TODO: b/303310285: Remove this special-casing once all dependencies of
+ // crtbegin_dynamic are convertible
+ if ctx.ModuleName() == "crtbegin_dynamic" {
+ return true
+ }
+
+ return false
+ }
+ if markAsDep && !shouldSkipDep(dep) {
+ ctx.AddDependency(ctx.Module(), Bp2buildDepTag, dep)
}
if !convertedToBazel(ctx, m) {
ctx.AddUnconvertedBp2buildDep(dep)