From b67b061baa73450a316e82498f260764300aca5b Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 31 Oct 2023 10:02:45 -0700 Subject: [PATCH] Use correct path for soong_build_metrics.pb when dist is enabled When dist is enabled soong_build_metrics.pb is written to $DIST_DIR/logs, not $OUT_DIR. Test: m dist nothing, examine out/dist/logs/bulid.trace.gz Change-Id: Ia41de6c838ecbcf0acca1e7ec7e68ba24dce2b32 --- ui/build/config.go | 2 +- ui/build/soong.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/build/config.go b/ui/build/config.go index 5cf6ea838..b228bb493 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -1530,7 +1530,7 @@ func (c *configImpl) SoongMakeVarsMk() string { } func (c *configImpl) SoongBuildMetrics() string { - return filepath.Join(c.OutDir(), "soong_build_metrics.pb") + return filepath.Join(c.LogsDir(), "soong_build_metrics.pb") } func (c *configImpl) ProductOut() string { diff --git a/ui/build/soong.go b/ui/build/soong.go index abdfedae7..90f1798f3 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -759,7 +759,7 @@ func loadSoongBuildMetrics(ctx Context, config Config, oldTimestamp time.Time) { return } - metricsData, err := os.ReadFile(config.SoongBuildMetrics()) + metricsData, err := os.ReadFile(soongBuildMetricsFile) if err != nil { ctx.Verbosef("Failed to read %s: %s", soongBuildMetricsFile, err) return