bp2build: avoid adding deps on system_shared_libs temporarily.

At least until libc and libm builds, which are the common values in
system_shared_libs. We don't have a way to break the cycle of:

libstdc++.so (system_shared_libs) -> libc.so -> ...(whole_static_libs) -> libstdc++.a (system_shared_libs) -> []

because bp2build just sees it as:

libstdc++ (system_shared_libs) -> libc -> (whole_static_libs) -> libstdc++ (system_shared_libs) -> libc -> ...

therefore creating a cycle.

This CL punts the problem for now by ignoring system_shared_libs in the cc deps mutator, with a TODO.

Test: TH

Bug: b/186024507
Bug: b/186489250
Change-Id: Id4744593af39b7eb3b31418c8afaeeac99a0ab5f
This commit is contained in:
Jingwen Chen
2021-05-19 10:30:29 +00:00
parent 4ca2ca5413
commit 45dec1072b

View File

@@ -91,12 +91,15 @@ func depsBp2BuildMutator(ctx android.BottomUpMutatorContext) {
allDeps = append(allDeps, lib.SharedProperties.Shared.Static_libs...)
allDeps = append(allDeps, lib.SharedProperties.Shared.Whole_static_libs...)
allDeps = append(allDeps, lib.SharedProperties.Shared.Shared_libs...)
allDeps = append(allDeps, lib.SharedProperties.Shared.System_shared_libs...)
allDeps = append(allDeps, lib.StaticProperties.Static.Static_libs...)
allDeps = append(allDeps, lib.StaticProperties.Static.Whole_static_libs...)
allDeps = append(allDeps, lib.StaticProperties.Static.Shared_libs...)
allDeps = append(allDeps, lib.StaticProperties.Static.System_shared_libs...)
// TODO(b/186024507, b/186489250): Temporarily exclude adding
// system_shared_libs deps until libc and libm builds.
// allDeps = append(allDeps, lib.SharedProperties.Shared.System_shared_libs...)
// allDeps = append(allDeps, lib.StaticProperties.Static.System_shared_libs...)
}
ctx.AddDependency(module, nil, android.SortedUniqueStrings(allDeps)...)