Revert "Add support for PRODUCT_RELEASE_CONFIG_MAPS"

Revert submission 2815850-product-flags

Reason for revert: b/309477343

Reverted changes: /q/submissionid:2815850-product-flags

Bug: 302593603
Bug: 309477343
Change-Id: I5b5a5ade1d85195c43377ed7639deba6eef86e23
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index df8101c..18cba77 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -59,9 +59,6 @@
 
 	// run the command
 	run func(ctx build.Context, config build.Config, args []string)
-
-	// whether to do common setup before calling run.
-	doSetup bool
 }
 
 // list of supported commands (flags) supported by soong ui
@@ -72,7 +69,6 @@
 		config:      build.NewConfig,
 		stdio:       stdio,
 		run:         runMake,
-		doSetup:     true,
 	}, {
 		flag:         "--dumpvar-mode",
 		description:  "print the value of the legacy make variable VAR to stdout",
@@ -81,7 +77,6 @@
 		config:       dumpVarConfig,
 		stdio:        customStdio,
 		run:          dumpVar,
-		doSetup:      true,
 	}, {
 		flag:         "--dumpvars-mode",
 		description:  "dump the values of one or more legacy make variables, in shell syntax",
@@ -90,7 +85,6 @@
 		config:       dumpVarConfig,
 		stdio:        customStdio,
 		run:          dumpVars,
-		doSetup:      true,
 	}, {
 		flag:        "--build-mode",
 		description: "build modules based on the specified build action",
@@ -188,12 +182,8 @@
 		CriticalPath: criticalPath,
 	}}
 
-	freshConfig := func() build.Config {
-		config := c.config(buildCtx, args...)
-		config.SetLogsPrefix(c.logsPrefix)
-		return config
-	}
-	config := freshConfig()
+	config := c.config(buildCtx, args...)
+	config.SetLogsPrefix(c.logsPrefix)
 	logsDir := config.LogsDir()
 	buildStarted = config.BuildStartedTimeOrDefault(buildStarted)
 
@@ -223,16 +213,6 @@
 		log.Verbosef("  [%d] %s", i, arg)
 	}
 
-	if c.doSetup {
-		// We need to call logAndSymlinkSetup before we can do product
-		// config, which is how we get PRODUCT_CONFIG_RELEASE_MAPS set
-		// for the final product config for the build.
-		logAndSymlinkSetup(buildCtx, config)
-		if build.SetProductReleaseConfigMaps(buildCtx, config) {
-			config = freshConfig()
-		}
-
-	}
 	defer func() {
 		stat.Finish()
 		criticalPath.WriteToMetrics(met)
@@ -331,6 +311,7 @@
 }
 
 func dumpVar(ctx build.Context, config build.Config, args []string) {
+	logAndSymlinkSetup(ctx, config)
 	flags := flag.NewFlagSet("dumpvar", flag.ExitOnError)
 	flags.SetOutput(ctx.Writer)
 
@@ -383,6 +364,7 @@
 }
 
 func dumpVars(ctx build.Context, config build.Config, args []string) {
+	logAndSymlinkSetup(ctx, config)
 
 	flags := flag.NewFlagSet("dumpvars", flag.ExitOnError)
 	flags.SetOutput(ctx.Writer)
@@ -562,6 +544,7 @@
 }
 
 func runMake(ctx build.Context, config build.Config, _ []string) {
+	logAndSymlinkSetup(ctx, config)
 	logsDir := config.LogsDir()
 	if config.IsVerbose() {
 		writer := ctx.Writer