From 331b27f511cc4fe525fc873dfb59d6ec2576e1d9 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 28 Feb 2024 15:35:49 -0800 Subject: [PATCH] Remove --multitree-build Multitree has been discontinued. Test: m nothing --no-skip-soong-tests Change-Id: Ie4d96a11279bf0f20a5e1a49837d9df4b24b1662 --- android/config.go | 8 ------- cmd/soong_build/main.go | 1 - ui/build/config.go | 11 ---------- ui/build/config_test.go | 47 ++++++++++++++++++----------------------- ui/build/soong.go | 6 ------ 5 files changed, 20 insertions(+), 53 deletions(-) diff --git a/android/config.go b/android/config.go index e757d504c..636ab5197 100644 --- a/android/config.go +++ b/android/config.go @@ -91,8 +91,6 @@ type CmdArgs struct { ModuleActionsFile string DocFile string - MultitreeBuild bool - BuildFromSourceStub bool EnsureAllowlistIntegrity bool @@ -288,10 +286,6 @@ type config struct { BuildMode SoongBuildMode - // If MultitreeBuild is true then this is one inner tree of a multitree - // build directed by the multitree orchestrator. - MultitreeBuild bool - // If testAllowNonExistentPaths is true then PathForSource and PathForModuleSrc won't error // in tests when a path doesn't exist. TestAllowNonExistentPaths bool @@ -541,8 +535,6 @@ func NewConfig(cmdArgs CmdArgs, availableEnv map[string]string) (Config, error) moduleListFile: cmdArgs.ModuleListFile, fs: pathtools.NewOsFs(absSrcDir), - MultitreeBuild: cmdArgs.MultitreeBuild, - buildFromSourceStub: cmdArgs.BuildFromSourceStub, } diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index 673f3055a..d64010e66 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -76,7 +76,6 @@ func init() { flag.StringVar(&cmdlineArgs.OutFile, "o", "build.ninja", "the Ninja file to output") flag.StringVar(&cmdlineArgs.SoongVariables, "soong_variables", "soong.variables", "the file contains all build variables") flag.BoolVar(&cmdlineArgs.EmptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja file") - flag.BoolVar(&cmdlineArgs.MultitreeBuild, "multitree-build", false, "this is a multitree build") flag.BoolVar(&cmdlineArgs.BuildFromSourceStub, "build-from-source-stub", false, "build Java stubs from source files instead of API text files") flag.BoolVar(&cmdlineArgs.EnsureAllowlistIntegrity, "ensure-allowlist-integrity", false, "verify that allowlisted modules are mixed-built") flag.StringVar(&cmdlineArgs.ModuleDebugFile, "soong_module_debug", "", "soong module debug info file to write") diff --git a/ui/build/config.go b/ui/build/config.go index e29d23929..1a2539793 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -75,7 +75,6 @@ type configImpl struct { queryview bool reportMkMetrics bool // Collect and report mk2bp migration progress metrics. soongDocs bool - multitreeBuild bool // This is a multitree build. skipConfig bool skipKati bool skipKatiNinja bool @@ -424,10 +423,6 @@ func NewConfig(ctx Context, args ...string) Config { // zip files produced by soong_zip. Disable zipbomb detection. ret.environ.Set("UNZIP_DISABLE_ZIPBOMB_DETECTION", "TRUE") - if ret.MultitreeBuild() { - ret.environ.Set("MULTITREE_BUILD", "true") - } - outDir := ret.OutDir() buildDateTimeFile := filepath.Join(outDir, "build_date.txt") if buildDateTime, ok := ret.environ.Get("BUILD_DATETIME"); ok && buildDateTime != "" { @@ -789,8 +784,6 @@ func (c *configImpl) parseArgs(ctx Context, args []string) { c.skipMetricsUpload = true } else if arg == "--mk-metrics" { c.reportMkMetrics = true - } else if arg == "--multitree-build" { - c.multitreeBuild = true } else if arg == "--search-api-dir" { c.searchApiDir = true } else if strings.HasPrefix(arg, "--ninja_weight_source=") { @@ -1095,10 +1088,6 @@ func (c *configImpl) IsVerbose() bool { return c.verbose } -func (c *configImpl) MultitreeBuild() bool { - return c.multitreeBuild -} - func (c *configImpl) NinjaWeightListSource() NinjaWeightListSource { return c.ninjaWeightListSource } diff --git a/ui/build/config_test.go b/ui/build/config_test.go index 5182b1226..b1222fe93 100644 --- a/ui/build/config_test.go +++ b/ui/build/config_test.go @@ -860,23 +860,24 @@ func TestGetConfigArgsBuildModules(t *testing.T) { } func TestGetConfigArgsBuildModulesInDirectory(t *testing.T) { - tests := []buildActionTestCase{{ - description: "normal execution in a directory", - dirsInTrees: []string{"0/1/2"}, - buildFiles: []string{"0/1/2/Android.mk"}, - args: []string{"fake-module"}, - curDir: "0/1/2", - tidyOnly: "", - expectedArgs: []string{"fake-module", "MODULES-IN-0-1-2"}, - }, { - description: "build file in parent directory", - dirsInTrees: []string{"0/1/2"}, - buildFiles: []string{"0/1/Android.mk"}, - args: []string{}, - curDir: "0/1/2", - tidyOnly: "", - expectedArgs: []string{"MODULES-IN-0-1"}, - }, + tests := []buildActionTestCase{ + { + description: "normal execution in a directory", + dirsInTrees: []string{"0/1/2"}, + buildFiles: []string{"0/1/2/Android.mk"}, + args: []string{"fake-module"}, + curDir: "0/1/2", + tidyOnly: "", + expectedArgs: []string{"fake-module", "MODULES-IN-0-1-2"}, + }, { + description: "build file in parent directory", + dirsInTrees: []string{"0/1/2"}, + buildFiles: []string{"0/1/Android.mk"}, + args: []string{}, + curDir: "0/1/2", + tidyOnly: "", + expectedArgs: []string{"MODULES-IN-0-1"}, + }, { description: "build file in parent directory, multiple module names passed in", dirsInTrees: []string{"0/1/2"}, @@ -902,15 +903,6 @@ func TestGetConfigArgsBuildModulesInDirectory(t *testing.T) { curDir: ".", tidyOnly: "", expectedArgs: []string{}, - }, { - description: "multitree build action executed at root directory", - dirsInTrees: []string{}, - buildFiles: []string{}, - rootSymlink: false, - args: []string{"--multitree-build"}, - curDir: ".", - tidyOnly: "", - expectedArgs: []string{"--multitree-build"}, }, { description: "build action executed at root directory in symlink", dirsInTrees: []string{}, @@ -953,7 +945,8 @@ func TestGetConfigArgsBuildModulesInDirectory(t *testing.T) { curDir: "", tidyOnly: "", expectedArgs: []string{"-j", "-k", "fake_module"}, - }} + }, + } for _, tt := range tests { t.Run("build action BUILD_MODULES_IN_DIR, "+tt.description, func(t *testing.T) { testGetConfigArgs(t, tt, BUILD_MODULES_IN_A_DIRECTORY) diff --git a/ui/build/soong.go b/ui/build/soong.go index a201ac5d7..79584c66f 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -197,9 +197,6 @@ func (pb PrimaryBuilderFactory) primaryBuilderInvocation(config Config) bootstra commonArgs = append(commonArgs, "-t") } - if pb.config.multitreeBuild { - commonArgs = append(commonArgs, "--multitree-build") - } if pb.config.buildFromSourceStub { commonArgs = append(commonArgs, "--build-from-source-stub") } @@ -305,9 +302,6 @@ func bootstrapBlueprint(ctx Context, config Config) { if config.EmptyNinjaFile() { mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--empty-ninja-file") } - if config.MultitreeBuild() { - mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--multitree-build") - } if config.buildFromSourceStub { mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--build-from-source-stub") }