Clean up some bp2build technical debt
Previously we ran mutators in bp2build mode to add dependencies, now we
look up modules by name directly. Remove workarounds to allow bp2build
mode to not fail when adding/handling dependencies.
Test: m bp2build
Change-Id: Ibf6fd905150cac306e5c395902ef28f609f4df2a
diff --git a/cc/binary.go b/cc/binary.go
index c5017c1..3e52fbc 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -182,7 +182,7 @@
}
}
- if !binary.static() && inList("libc", deps.StaticLibs) && !ctx.BazelConversionMode() {
+ if !binary.static() && inList("libc", deps.StaticLibs) {
ctx.ModuleErrorf("statically linking libc to dynamic executable, please remove libc\n" +
"from static libs or set static_executable: true")
}
diff --git a/cc/cc.go b/cc/cc.go
index 8606920..f1a1983 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2031,12 +2031,6 @@
deps.HeaderLibs = android.LastUniqueStrings(deps.HeaderLibs)
deps.RuntimeLibs = android.LastUniqueStrings(deps.RuntimeLibs)
- // In Bazel conversion mode, we dependency and build validations will occur in Bazel, so there is
- // no need to do so in Soong.
- if ctx.BazelConversionMode() {
- return deps
- }
-
for _, lib := range deps.ReexportSharedLibHeaders {
if !inList(lib, deps.SharedLibs) {
ctx.PropertyErrorf("export_shared_lib_headers", "Shared library not in shared_libs: '%s'", lib)
diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go
index 7175fdc..253bb06 100644
--- a/cc/config/toolchain.go
+++ b/cc/config/toolchain.go
@@ -36,19 +36,10 @@
Arch() android.Arch
}
-type conversionContext interface {
- BazelConversionMode() bool
-}
-
func FindToolchainWithContext(ctx toolchainContext) Toolchain {
t, err := findToolchain(ctx.Os(), ctx.Arch())
if err != nil {
- if c, ok := ctx.(conversionContext); ok && c.BazelConversionMode() {
- // TODO(b/179123288): determine conversion for toolchain
- return &toolchainX86_64{}
- } else {
- panic(err)
- }
+ panic(err)
}
return t
}
diff --git a/cc/linker.go b/cc/linker.go
index f346584..4e9404c 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -389,9 +389,7 @@
}
deps.SystemSharedLibs = linker.Properties.System_shared_libs
- // In Bazel conversion mode, variations have not been specified, so SystemSharedLibs may
- // inaccuarately appear unset, which can cause issues with circular dependencies.
- if deps.SystemSharedLibs == nil && !ctx.BazelConversionMode() {
+ if deps.SystemSharedLibs == nil {
// Provide a default system_shared_libs if it is unspecified. Note: If an
// empty list [] is specified, it implies that the module declines the
// default system_shared_libs.