Merge "Generate .build-id directory tree after every build." into main

This commit is contained in:
Treehugger Robot
2024-07-17 23:13:24 +00:00
committed by Gerrit Code Review
4 changed files with 186 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ bootstrap_go_package {
"blueprint-bootstrap",
"blueprint-microfactory",
"soong-android",
"soong-elf",
"soong-finder",
"soong-remoteexec",
"soong-shared",

View File

@@ -22,6 +22,7 @@ import (
"sync"
"text/template"
"android/soong/elf"
"android/soong/ui/metrics"
)
@@ -344,6 +345,7 @@ func Build(ctx Context, config Config) {
installCleanIfNecessary(ctx, config)
}
runNinjaForBuild(ctx, config)
updateBuildIdDir(ctx, config)
}
if what&RunDistActions != 0 {
@@ -351,6 +353,16 @@ func Build(ctx Context, config Config) {
}
}
func updateBuildIdDir(ctx Context, config Config) {
ctx.BeginTrace(metrics.RunShutdownTool, "update_build_id_dir")
defer ctx.EndTrace()
symbolsDir := filepath.Join(config.ProductOut(), "symbols")
if err := elf.UpdateBuildIdDir(symbolsDir); err != nil {
ctx.Printf("failed to update %s/.build-id: %v", symbolsDir, err)
}
}
func evaluateWhatToRun(config Config, verboseln func(v ...interface{})) int {
//evaluate what to run
what := 0