Merge "Skip certain problematic deps" into main am: 9eb4efa094 am: 8bf242d437 am: 729b855d52

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2773564

Change-Id: I3c4165ee39fcf4aa7c2f5e9648b71d847eb9226c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Christopher Parsons 2023-10-05 22:04:06 +00:00 committed by Automerger Merge Worker
commit 29bca3bdc8

View file

@ -452,12 +452,34 @@ func getOtherModuleLabel(ctx Bp2buildMutatorContext, dep, tag string,
Label: ":" + dep + "__BP2BUILD__MISSING__DEP", 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 // 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. // fact that, in a variantless build graph, "libc" has a dependency on itself.
if ctx.ModuleName() != "libc" { if ctx.ModuleName() == "libc" {
ctx.AddDependency(ctx.Module(), Bp2buildDepTag, dep) 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) { if !convertedToBazel(ctx, m) {
ctx.AddUnconvertedBp2buildDep(dep) ctx.AddUnconvertedBp2buildDep(dep)