Use hashed subdir for soong_config modules

This is to differentiate soong intermediate directories for soong config
modules. This will help incremental build across different
devices.

Test result of building panther, building cheetah, and building panther
again:

Before this change
- build time: 02:57
- # of tasks: 31044

After this change
- build time: 01:48
- # of tasks: 1694

Build time includes build.ninja generating time (which is more than 1
minute), so the overriden artifacts become far fewer.

And "NINJA_ARGS='-n -d explain' m" only gave 4 "command line changed"
nodes.

Bug: 279362051
Test: see above
Change-Id: I4891cbe823ae21628465e5c6eb26a4837ccdd202
This commit is contained in:
Inseob Kim
2023-05-15 18:06:31 +09:00
parent 1a608b0b0a
commit 81b00a8db7
5 changed files with 355 additions and 5 deletions

View File

@@ -1475,7 +1475,11 @@ type ModuleOutPathContext interface {
}
func pathForModuleOut(ctx ModuleOutPathContext) OutputPath {
return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir())
soongConfigHash := ""
if i, ok := ctx.(interface{ ModuleSoongConfigHash() string }); ok {
soongConfigHash = i.ModuleSoongConfigHash()
}
return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir(), soongConfigHash)
}
// PathForModuleOut returns a Path representing the paths... under the module's