diff --git a/android/bazel.go b/android/bazel.go index 3bc104d1d..42cb42744 100644 --- a/android/bazel.go +++ b/android/bazel.go @@ -188,6 +188,7 @@ var ( "packages/apps/QuickSearchBox":/* recursive = */ true, "packages/apps/WallpaperPicker":/* recursive = */ false, + "prebuilts/gcc":/* recursive = */ true, "prebuilts/sdk":/* recursive = */ false, "prebuilts/sdk/current/extras/app-toolkit":/* recursive = */ false, "prebuilts/sdk/current/support":/* recursive = */ false, @@ -250,6 +251,8 @@ var ( // Per-module denylist to always opt modules out of both bp2build and mixed builds. bp2buildModuleDoNotConvertList = []string{ + "libprotobuf-cpp-full", "libprotobuf-cpp-lite", // Unsupported product&vendor suffix. b/204811222 and b/204810610. + "libc_malloc_debug", // depends on libunwindstack, which depends on unsupported module art_cc_library_statics "libbase_ndk", // http://b/186826477, fails to link libctscamera2_jni for device (required for CtsCameraTestCases) @@ -381,7 +384,11 @@ func ShouldKeepExistingBuildFileForDir(dir string) bool { // MixedBuildsEnabled checks that a module is ready to be replaced by a // converted or handcrafted Bazel target. -func (b *BazelModuleBase) MixedBuildsEnabled(ctx BazelConversionPathContext) bool { +func (b *BazelModuleBase) MixedBuildsEnabled(ctx ModuleContext) bool { + if ctx.Os() == Windows { + // Windows toolchains are not currently supported. + return false + } if !ctx.Config().BazelContext.BazelEnabled() { return false } diff --git a/android/bazel_handler.go b/android/bazel_handler.go index 3c6212e0c..0052551f4 100644 --- a/android/bazel_handler.go +++ b/android/bazel_handler.go @@ -602,8 +602,6 @@ def get_arch(target): platform_name = build_options(target)["//command_line_option:platforms"][0].name if platform_name == "host": return "HOST" - elif platform_name.startswith("linux_glibc_"): - return platform_name[len("linux_glibc_"):] + "|" + platform_name[:len("linux_glibc_")-1] elif platform_name.startswith("android_"): return platform_name[len("android_"):] + "|" + platform_name[:len("android_")-1] elif platform_name.startswith("linux_"): @@ -865,7 +863,7 @@ func getConfigString(key cqueryKey) string { arch = "x86_64" } os := key.configKey.osType.Name - if len(os) == 0 || os == "common_os" { + if len(os) == 0 || os == "common_os" || os == "linux_glibc" { // Use host OS, which is currently hardcoded to be linux. os = "linux" } diff --git a/cc/cc.go b/cc/cc.go index 8915d6faa..113620cc1 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1717,7 +1717,7 @@ func (c *Module) maybeGenerateBazelActions(actx android.ModuleContext) bool { bazelActionsUsed := false // Mixed builds mode is disabled for modules outside of device OS. // TODO(b/200841190): Support non-device OS in mixed builds. - if c.MixedBuildsEnabled(actx) && c.bazelHandler != nil && actx.Os().Class == android.Device { + if c.MixedBuildsEnabled(actx) && c.bazelHandler != nil { bazelActionsUsed = c.bazelHandler.GenerateBazelBuildActions(actx, bazelModuleLabel) } return bazelActionsUsed