Merge "Implement cleanups requested in aosp/1818245:"
This commit is contained in:
@@ -79,10 +79,6 @@ func (c Config) RunGoTests() bool {
|
|||||||
return c.runGoTests
|
return c.runGoTests
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Config) UseValidationsForGoTests() bool {
|
|
||||||
return c.useValidationsForGoTests
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c Config) DebugCompilation() bool {
|
func (c Config) DebugCompilation() bool {
|
||||||
return false // Never compile Go code in the main build for debugging
|
return false // Never compile Go code in the main build for debugging
|
||||||
}
|
}
|
||||||
@@ -142,8 +138,7 @@ type config struct {
|
|||||||
soongOutDir string
|
soongOutDir string
|
||||||
moduleListFile string // the path to the file which lists blueprint files to parse.
|
moduleListFile string // the path to the file which lists blueprint files to parse.
|
||||||
|
|
||||||
runGoTests bool
|
runGoTests bool
|
||||||
useValidationsForGoTests bool
|
|
||||||
|
|
||||||
env map[string]string
|
env map[string]string
|
||||||
envLock sync.Mutex
|
envLock sync.Mutex
|
||||||
@@ -437,11 +432,10 @@ func NewConfig(moduleListFile string, runGoTests bool, outDir, soongOutDir strin
|
|||||||
|
|
||||||
env: availableEnv,
|
env: availableEnv,
|
||||||
|
|
||||||
outDir: outDir,
|
outDir: outDir,
|
||||||
soongOutDir: soongOutDir,
|
soongOutDir: soongOutDir,
|
||||||
runGoTests: runGoTests,
|
runGoTests: runGoTests,
|
||||||
useValidationsForGoTests: runGoTests,
|
multilibConflicts: make(map[ArchType]bool),
|
||||||
multilibConflicts: make(map[ArchType]bool),
|
|
||||||
|
|
||||||
moduleListFile: moduleListFile,
|
moduleListFile: moduleListFile,
|
||||||
fs: pathtools.NewOsFs(absSrcDir),
|
fs: pathtools.NewOsFs(absSrcDir),
|
||||||
|
@@ -784,6 +784,10 @@ func (c *configImpl) NamedGlobFile(name string) string {
|
|||||||
return shared.JoinPath(c.SoongOutDir(), ".bootstrap/build-globs."+name+".ninja")
|
return shared.JoinPath(c.SoongOutDir(), ".bootstrap/build-globs."+name+".ninja")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) UsedEnvFile(tag string) string {
|
||||||
|
return shared.JoinPath(c.SoongOutDir(), usedEnvFile+"."+tag)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *configImpl) MainNinjaFile() string {
|
func (c *configImpl) MainNinjaFile() string {
|
||||||
return shared.JoinPath(c.SoongOutDir(), "build.ninja")
|
return shared.JoinPath(c.SoongOutDir(), "build.ninja")
|
||||||
}
|
}
|
||||||
|
@@ -81,7 +81,6 @@ type BlueprintConfig struct {
|
|||||||
soongOutDir string
|
soongOutDir string
|
||||||
outDir string
|
outDir string
|
||||||
runGoTests bool
|
runGoTests bool
|
||||||
useValidations bool
|
|
||||||
debugCompilation bool
|
debugCompilation bool
|
||||||
subninjas []string
|
subninjas []string
|
||||||
primaryBuilderInvocations []bootstrap.PrimaryBuilderInvocation
|
primaryBuilderInvocations []bootstrap.PrimaryBuilderInvocation
|
||||||
@@ -103,10 +102,6 @@ func (c BlueprintConfig) RunGoTests() bool {
|
|||||||
return c.runGoTests
|
return c.runGoTests
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c BlueprintConfig) UseValidationsForGoTests() bool {
|
|
||||||
return c.useValidations
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c BlueprintConfig) DebugCompilation() bool {
|
func (c BlueprintConfig) DebugCompilation() bool {
|
||||||
return c.debugCompilation
|
return c.debugCompilation
|
||||||
}
|
}
|
||||||
@@ -119,10 +114,10 @@ func (c BlueprintConfig) PrimaryBuilderInvocations() []bootstrap.PrimaryBuilderI
|
|||||||
return c.primaryBuilderInvocations
|
return c.primaryBuilderInvocations
|
||||||
}
|
}
|
||||||
|
|
||||||
func environmentArgs(config Config, suffix string) []string {
|
func environmentArgs(config Config, tag string) []string {
|
||||||
return []string{
|
return []string{
|
||||||
"--available_env", shared.JoinPath(config.SoongOutDir(), availableEnvFile),
|
"--available_env", shared.JoinPath(config.SoongOutDir(), availableEnvFile),
|
||||||
"--used_env", shared.JoinPath(config.SoongOutDir(), usedEnvFile+"."+suffix),
|
"--used_env", config.UsedEnvFile(tag),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,11 +245,10 @@ func bootstrapBlueprint(ctx Context, config Config) {
|
|||||||
blueprintCtx := blueprint.NewContext()
|
blueprintCtx := blueprint.NewContext()
|
||||||
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
|
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
|
||||||
blueprintConfig := BlueprintConfig{
|
blueprintConfig := BlueprintConfig{
|
||||||
soongOutDir: config.SoongOutDir(),
|
soongOutDir: config.SoongOutDir(),
|
||||||
toolDir: config.HostToolDir(),
|
toolDir: config.HostToolDir(),
|
||||||
outDir: config.OutDir(),
|
outDir: config.OutDir(),
|
||||||
runGoTests: !config.skipSoongTests,
|
runGoTests: !config.skipSoongTests,
|
||||||
useValidations: !config.skipSoongTests,
|
|
||||||
// If we want to debug soong_build, we need to compile it for debugging
|
// If we want to debug soong_build, we need to compile it for debugging
|
||||||
debugCompilation: os.Getenv("SOONG_DELVE") != "",
|
debugCompilation: os.Getenv("SOONG_DELVE") != "",
|
||||||
subninjas: globFiles,
|
subninjas: globFiles,
|
||||||
@@ -279,6 +273,7 @@ func checkEnvironmentFile(currentEnv *Environment, envFile string) {
|
|||||||
v, _ := currentEnv.Get(k)
|
v, _ := currentEnv.Get(k)
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
if stale, _ := shared.StaleEnvFile(envFile, getenv); stale {
|
if stale, _ := shared.StaleEnvFile(envFile, getenv); stale {
|
||||||
os.Remove(envFile)
|
os.Remove(envFile)
|
||||||
}
|
}
|
||||||
@@ -328,22 +323,22 @@ func runSoong(ctx Context, config Config) {
|
|||||||
ctx.BeginTrace(metrics.RunSoong, "environment check")
|
ctx.BeginTrace(metrics.RunSoong, "environment check")
|
||||||
defer ctx.EndTrace()
|
defer ctx.EndTrace()
|
||||||
|
|
||||||
checkEnvironmentFile(soongBuildEnv, filepath.Join(config.SoongOutDir(), usedEnvFile+".build"))
|
checkEnvironmentFile(soongBuildEnv, config.UsedEnvFile(soongBuildTag))
|
||||||
|
|
||||||
if integratedBp2Build || config.Bp2Build() {
|
if integratedBp2Build || config.Bp2Build() {
|
||||||
checkEnvironmentFile(soongBuildEnv, filepath.Join(config.SoongOutDir(), usedEnvFile+".bp2build"))
|
checkEnvironmentFile(soongBuildEnv, config.UsedEnvFile(bp2buildTag))
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.JsonModuleGraph() {
|
if config.JsonModuleGraph() {
|
||||||
checkEnvironmentFile(soongBuildEnv, filepath.Join(config.SoongOutDir(), usedEnvFile+".modulegraph"))
|
checkEnvironmentFile(soongBuildEnv, config.UsedEnvFile(jsonModuleGraphTag))
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Queryview() {
|
if config.Queryview() {
|
||||||
checkEnvironmentFile(soongBuildEnv, filepath.Join(config.SoongOutDir(), usedEnvFile+".queryview"))
|
checkEnvironmentFile(soongBuildEnv, config.UsedEnvFile(queryviewTag))
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.SoongDocs() {
|
if config.SoongDocs() {
|
||||||
checkEnvironmentFile(soongBuildEnv, filepath.Join(config.SoongOutDir(), usedEnvFile+".soong_docs"))
|
checkEnvironmentFile(soongBuildEnv, config.UsedEnvFile(soongDocsTag))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user