Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2428d412 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Remove bazel dev mode"

parents b8f50fde 21f80277
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -229,8 +229,6 @@ type mixedBuildBazelContext struct {
	bazelEnabledModules map[string]bool
	// DCLA modules are enabled when used in apex.
	bazelDclaEnabledModules map[string]bool
	// If true, modules are bazel-enabled by default, unless present in bazelDisabledModules.
	modulesDefaultToBazel bool

	targetProduct      string
	targetBuildVariant string
@@ -497,10 +495,8 @@ func GetBazelEnabledAndDisabledModules(buildMode SoongBuildMode, forceEnabled ma
		for enabledAdHocModule := range forceEnabled {
			enabledModules[enabledAdHocModule] = true
		}
	case BazelDevMode:
		AddToStringSet(disabledModules, allowlists.MixedBuildsDisabledList)
	default:
		panic("Expected BazelProdMode, BazelStagingMode, or BazelDevMode")
		panic("Expected BazelProdMode or BazelStagingMode")
	}
	return enabledModules, disabledModules
}
@@ -518,7 +514,7 @@ func GetBazelEnabledModules(buildMode SoongBuildMode) []string {
}

func NewBazelContext(c *config) (BazelContext, error) {
	if c.BuildMode != BazelProdMode && c.BuildMode != BazelStagingMode && c.BuildMode != BazelDevMode {
	if c.BuildMode != BazelProdMode && c.BuildMode != BazelStagingMode {
		return noopBazelContext{}, nil
	}

@@ -582,7 +578,6 @@ func NewBazelContext(c *config) (BazelContext, error) {
	return &mixedBuildBazelContext{
		bazelRunner:             &builtinBazelRunner{c.UseBazelProxy, absolutePath(c.outDir)},
		paths:                   &paths,
		modulesDefaultToBazel:   c.BuildMode == BazelDevMode,
		bazelEnabledModules:     enabledModules,
		bazelDisabledModules:    disabledModules,
		bazelDclaEnabledModules: dclaEnabledModules,
@@ -606,7 +601,7 @@ func (context *mixedBuildBazelContext) IsModuleNameAllowed(moduleName string, wi
		return true
	}

	return context.modulesDefaultToBazel
	return false
}

func (context *mixedBuildBazelContext) IsModuleDclaAllowed(moduleName string) bool {
+0 −1
Original line number Diff line number Diff line
@@ -263,7 +263,6 @@ func TestIsModuleNameAllowed(t *testing.T) {
	}

	bazelContext := &mixedBuildBazelContext{
		modulesDefaultToBazel:   false,
		bazelEnabledModules:     enabledModules,
		bazelDisabledModules:    disabledModules,
		bazelDclaEnabledModules: dclaEnabledModules,
+1 −8
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@ type CmdArgs struct {
	MultitreeBuild bool

	BazelMode                bool
	BazelModeDev             bool
	BazelModeStaging         bool
	BazelForceEnabledModules string

@@ -132,11 +131,6 @@ const (
	// Generate a documentation file for module type definitions and exit.
	GenerateDocFile

	// Use bazel during analysis of many allowlisted build modules. The allowlist
	// is considered a "developer mode" allowlist, as some modules may be
	// allowlisted on an experimental basis.
	BazelDevMode

	// Use bazel during analysis of a few allowlisted build modules. The allowlist
	// is considered "staging, as these are modules being prepared to be released
	// into prod mode shortly after.
@@ -622,7 +616,6 @@ func NewConfig(cmdArgs CmdArgs, availableEnv map[string]string) (Config, error)
	setBuildMode(cmdArgs.BazelApiBp2buildDir, ApiBp2build)
	setBuildMode(cmdArgs.ModuleGraphFile, GenerateModuleGraph)
	setBuildMode(cmdArgs.DocFile, GenerateDocFile)
	setBazelMode(cmdArgs.BazelModeDev, "--bazel-mode-dev", BazelDevMode)
	setBazelMode(cmdArgs.BazelMode, "--bazel-mode", BazelProdMode)
	setBazelMode(cmdArgs.BazelModeStaging, "--bazel-mode-staging", BazelStagingMode)

@@ -726,7 +719,7 @@ func (c *config) IsMixedBuildsEnabled() bool {
		return true
	}).(bool)

	bazelModeEnabled := c.BuildMode == BazelProdMode || c.BuildMode == BazelDevMode || c.BuildMode == BazelStagingMode
	bazelModeEnabled := c.BuildMode == BazelProdMode || c.BuildMode == BazelStagingMode
	return globalMixedBuildsSupport && bazelModeEnabled
}

+0 −5
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ var alternateResultDir = flag.Bool("dist", false, "write select results to $DIST

var bazelMode = flag.Bool("bazel-mode", false, "use bazel for analysis of certain modules")
var bazelModeStaging = flag.Bool("bazel-mode-staging", false, "use bazel for analysis of certain near-ready modules")
var bazelModeDev = flag.Bool("bazel-mode-dev", false, "use bazel for analysis of a large number of modules (less stable)")

var onlyConfig = flag.Bool("only-config", false, "Only run product config (not Soong or Kati)")
var onlySoong = flag.Bool("only-soong", false, "Only run product config and Soong (not Kati)")
@@ -229,10 +228,6 @@ func getBazelArg() string {
		count++
		str = "--bazel-mode-staging"
	}
	if *bazelModeDev {
		count++
		str = "--bazel-mode-dev"
	}

	if count > 1 {
		// Can't set more than one
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ func init() {
	flag.BoolVar(&cmdlineArgs.MultitreeBuild, "multitree-build", false, "this is a multitree build")
	flag.BoolVar(&cmdlineArgs.BazelMode, "bazel-mode", false, "use bazel for analysis of certain modules")
	flag.BoolVar(&cmdlineArgs.BazelModeStaging, "bazel-mode-staging", false, "use bazel for analysis of certain near-ready modules")
	flag.BoolVar(&cmdlineArgs.BazelModeDev, "bazel-mode-dev", false, "use bazel for analysis of a large number of modules (less stable)")
	flag.BoolVar(&cmdlineArgs.UseBazelProxy, "use-bazel-proxy", false, "communicate with bazel using unix socket proxy instead of spawning subprocesses")
	flag.BoolVar(&cmdlineArgs.BuildFromTextStub, "build-from-text-stub", false, "build Java stubs from API text files instead of source files")
	flag.BoolVar(&cmdlineArgs.EnsureAllowlistIntegrity, "ensure-allowlist-integrity", false, "verify that allowlisted modules are mixed-built")
Loading