Disable bazel for riscv_64

This product is experimental and unsupported for Bazel at this time

Test: lunch aosp_riscv64-userdebug && m nothing
Test: lunch aosp_arm64-userdebug && m nothing
Change-Id: I761afb9524f1008f9d5472d2de19bb84342e9e29
This commit is contained in:
Chris Parsons
2022-11-29 14:14:52 -05:00
parent 6463871fd9
commit 428c30f89a
3 changed files with 15 additions and 1 deletions

View File

@@ -383,6 +383,9 @@ func MixedBuildsEnabled(ctx BaseModuleContext) bool {
// mixedBuildPossible returns true if a module is ready to be replaced by a
// converted or handcrafted Bazel target.
func mixedBuildPossible(ctx BaseModuleContext) bool {
if !ctx.Config().IsMixedBuildsEnabled() {
return false
}
if ctx.Os() == Windows {
// Windows toolchains are not currently supported.
return false

View File

@@ -536,7 +536,17 @@ func (c *config) mockFileSystem(bp string, fs map[string][]byte) {
// Returns true if "Bazel builds" is enabled. In this mode, part of build
// analysis is handled by Bazel.
func (c *config) IsMixedBuildsEnabled() bool {
return c.BuildMode == BazelProdMode || c.BuildMode == BazelDevMode || c.BuildMode == BazelStagingMode
globalMixedBuildsSupport := c.Once(OnceKey{"globalMixedBuildsSupport"}, func() interface{} {
if c.productVariables.DeviceArch != nil && *c.productVariables.DeviceArch == "riscv64" {
fmt.Fprintln(os.Stderr, "unsupported device arch 'riscv64' for Bazel: falling back to non-mixed build")
return false
}
// TODO(b/253664931): Add other fallback criteria below.
return true
}).(bool)
bazelModeEnabled := c.BuildMode == BazelProdMode || c.BuildMode == BazelDevMode || c.BuildMode == BazelStagingMode
return globalMixedBuildsSupport && bazelModeEnabled
}
func (c *config) SetAllowMissingDependencies() {

View File

@@ -62,6 +62,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
TestAllowNonExistentPaths: true,
BazelContext: noopBazelContext{},
BuildMode: BazelProdMode,
mixedBuildDisabledModules: make(map[string]struct{}),
mixedBuildEnabledModules: make(map[string]struct{}),
}