Merge "Ship the build log and trace on the build servers"
This commit is contained in:
@@ -102,7 +102,7 @@ func main() {
|
|||||||
log.Println("Output directory:", *outDir)
|
log.Println("Output directory:", *outDir)
|
||||||
|
|
||||||
build.SetupOutDir(buildCtx, config)
|
build.SetupOutDir(buildCtx, config)
|
||||||
log.SetOutput(filepath.Join(config.OutDir(), "build.log"))
|
log.SetOutput(filepath.Join(config.OutDir(), "soong.log"))
|
||||||
trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))
|
trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))
|
||||||
|
|
||||||
vars, err := build.DumpMakeVars(buildCtx, config, nil, nil, []string{"all_named_products"})
|
vars, err := build.DumpMakeVars(buildCtx, config, nil, nil, []string{"all_named_products"})
|
||||||
@@ -137,7 +137,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
productLog := logger.New(&bytes.Buffer{})
|
productLog := logger.New(&bytes.Buffer{})
|
||||||
productLog.SetOutput(filepath.Join(productOutDir, "build.log"))
|
productLog.SetOutput(filepath.Join(productOutDir, "soong.log"))
|
||||||
|
|
||||||
productCtx := build.Context{&build.ContextImpl{
|
productCtx := build.Context{&build.ContextImpl{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
|
@@ -70,8 +70,15 @@ func main() {
|
|||||||
|
|
||||||
log.SetVerbose(config.IsVerbose())
|
log.SetVerbose(config.IsVerbose())
|
||||||
build.SetupOutDir(buildCtx, config)
|
build.SetupOutDir(buildCtx, config)
|
||||||
log.SetOutput(filepath.Join(config.OutDir(), "build.log"))
|
|
||||||
trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))
|
if config.Dist() {
|
||||||
|
os.MkdirAll(config.DistDir(), 0777)
|
||||||
|
log.SetOutput(filepath.Join(config.DistDir(), "logs", "soong.log"))
|
||||||
|
trace.SetOutput(filepath.Join(config.DistDir(), "logs", "build.trace"))
|
||||||
|
} else {
|
||||||
|
log.SetOutput(filepath.Join(config.OutDir(), "soong.log"))
|
||||||
|
trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))
|
||||||
|
}
|
||||||
|
|
||||||
if start, ok := os.LookupEnv("TRACE_BEGIN_SOONG"); ok {
|
if start, ok := os.LookupEnv("TRACE_BEGIN_SOONG"); ok {
|
||||||
if !strings.HasSuffix(start, "N") {
|
if !strings.HasSuffix(start, "N") {
|
||||||
|
@@ -35,6 +35,7 @@ type configImpl struct {
|
|||||||
parallel int
|
parallel int
|
||||||
keepGoing int
|
keepGoing int
|
||||||
verbose bool
|
verbose bool
|
||||||
|
dist bool
|
||||||
|
|
||||||
// From the product config
|
// From the product config
|
||||||
katiArgs []string
|
katiArgs []string
|
||||||
@@ -90,6 +91,8 @@ func NewConfig(ctx Context, args ...string) Config {
|
|||||||
} else if arg == "showcommands" {
|
} else if arg == "showcommands" {
|
||||||
ret.verbose = true
|
ret.verbose = true
|
||||||
continue
|
continue
|
||||||
|
} else if arg == "dist" {
|
||||||
|
ret.dist = true
|
||||||
}
|
}
|
||||||
if arg[0] == '-' {
|
if arg[0] == '-' {
|
||||||
var err error
|
var err error
|
||||||
@@ -183,6 +186,13 @@ func (c *configImpl) OutDir() string {
|
|||||||
return "out"
|
return "out"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) DistDir() string {
|
||||||
|
if distDir, ok := c.environ.Get("DIST_DIR"); ok {
|
||||||
|
return distDir
|
||||||
|
}
|
||||||
|
return filepath.Join(c.OutDir(), "dist")
|
||||||
|
}
|
||||||
|
|
||||||
func (c *configImpl) NinjaArgs() []string {
|
func (c *configImpl) NinjaArgs() []string {
|
||||||
return c.ninjaArgs
|
return c.ninjaArgs
|
||||||
}
|
}
|
||||||
@@ -198,6 +208,10 @@ func (c *configImpl) KatiSuffix() string {
|
|||||||
panic("SetKatiSuffix has not been called")
|
panic("SetKatiSuffix has not been called")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) Dist() bool {
|
||||||
|
return c.dist
|
||||||
|
}
|
||||||
|
|
||||||
func (c *configImpl) IsVerbose() bool {
|
func (c *configImpl) IsVerbose() bool {
|
||||||
return c.verbose
|
return c.verbose
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user