Merge "Fix propagating EMPTY_NINJA_FILE from multiproduct_kati to minibp"
This commit is contained in:
@@ -433,7 +433,7 @@ func buildProduct(mpctx *mpContext, product string) {
|
|||||||
config := build.NewConfig(ctx, args...)
|
config := build.NewConfig(ctx, args...)
|
||||||
config.Environment().Set("OUT_DIR", outDir)
|
config.Environment().Set("OUT_DIR", outDir)
|
||||||
if !*keepArtifacts {
|
if !*keepArtifacts {
|
||||||
config.Environment().Set("EMPTY_NINJA_FILE", "true")
|
config.SetEmptyNinjaFile(true)
|
||||||
}
|
}
|
||||||
build.FindSources(ctx, config, mpctx.Finder)
|
build.FindSources(ctx, config, mpctx.Finder)
|
||||||
config.Lunch(ctx, product, *buildVariant)
|
config.Lunch(ctx, product, *buildVariant)
|
||||||
|
@@ -72,6 +72,9 @@ type configImpl struct {
|
|||||||
// During Bazel execution, Bazel cannot write outside OUT_DIR.
|
// During Bazel execution, Bazel cannot write outside OUT_DIR.
|
||||||
// So if DIST_DIR is set to an external dir (outside of OUT_DIR), we need to rig it temporarily and then migrate files at the end of the build.
|
// So if DIST_DIR is set to an external dir (outside of OUT_DIR), we need to rig it temporarily and then migrate files at the end of the build.
|
||||||
riggedDistDirForBazel string
|
riggedDistDirForBazel string
|
||||||
|
|
||||||
|
// Set by multiproduct_kati
|
||||||
|
emptyNinjaFile bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const srcDirFileCheck = "build/soong/root.bp"
|
const srcDirFileCheck = "build/soong/root.bp"
|
||||||
@@ -203,9 +206,6 @@ func NewConfig(ctx Context, args ...string) Config {
|
|||||||
"ANDROID_DEV_SCRIPTS",
|
"ANDROID_DEV_SCRIPTS",
|
||||||
"ANDROID_EMULATOR_PREBUILTS",
|
"ANDROID_EMULATOR_PREBUILTS",
|
||||||
"ANDROID_PRE_BUILD_PATHS",
|
"ANDROID_PRE_BUILD_PATHS",
|
||||||
|
|
||||||
// Only set in multiproduct_kati after config generation
|
|
||||||
"EMPTY_NINJA_FILE",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if ret.UseGoma() || ret.ForceUseGoma() {
|
if ret.UseGoma() || ret.ForceUseGoma() {
|
||||||
@@ -1189,3 +1189,11 @@ func (c *configImpl) LogsDir() string {
|
|||||||
func (c *configImpl) BazelMetricsDir() string {
|
func (c *configImpl) BazelMetricsDir() string {
|
||||||
return filepath.Join(c.LogsDir(), "bazel_metrics")
|
return filepath.Join(c.LogsDir(), "bazel_metrics")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) SetEmptyNinjaFile(v bool) {
|
||||||
|
c.emptyNinjaFile = v
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) EmptyNinjaFile() bool {
|
||||||
|
return c.emptyNinjaFile
|
||||||
|
}
|
||||||
|
@@ -136,7 +136,7 @@ func runKati(ctx Context, config Config, extraSuffix string, args []string, envF
|
|||||||
// information out with --empty_ninja_file.
|
// information out with --empty_ninja_file.
|
||||||
//
|
//
|
||||||
// From https://github.com/google/kati/commit/87b8da7af2c8bea28b1d8ab17679453d859f96e5
|
// From https://github.com/google/kati/commit/87b8da7af2c8bea28b1d8ab17679453d859f96e5
|
||||||
if config.Environment().IsEnvTrue("EMPTY_NINJA_FILE") {
|
if config.EmptyNinjaFile() {
|
||||||
args = append(args, "--empty_ninja_file")
|
args = append(args, "--empty_ninja_file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -119,6 +119,7 @@ func bootstrapBlueprint(ctx Context, config Config, integratedBp2Build bool) {
|
|||||||
args.OutFile = shared.JoinPath(config.SoongOutDir(), ".bootstrap/build.ninja")
|
args.OutFile = shared.JoinPath(config.SoongOutDir(), ".bootstrap/build.ninja")
|
||||||
args.GlobFile = globFile
|
args.GlobFile = globFile
|
||||||
args.GeneratingPrimaryBuilder = true
|
args.GeneratingPrimaryBuilder = true
|
||||||
|
args.EmptyNinjaFile = config.EmptyNinjaFile()
|
||||||
|
|
||||||
args.DelveListen = os.Getenv("SOONG_DELVE")
|
args.DelveListen = os.Getenv("SOONG_DELVE")
|
||||||
if args.DelveListen != "" {
|
if args.DelveListen != "" {
|
||||||
|
Reference in New Issue
Block a user