Revert "Use hashed subdir for soong_config modules"
This reverts commit 81b00a8db73491a4cac326853853be743000a2ac.
Reason for revert:
* select() will supersede Soong config modules.
* A tiny change can make hundreds of gigabytes rebuilt.
* Hashed out/ directories are not cleaned.
* Even without this trace, AB build time is fast enough, thanks to
product-specific ninja files and so on.
Bug: 348548855
Test: m --no-skip-soong-tests
Change-Id: If9a97df1e161a9ef0fb1b801f9e129b71b11d1ac
diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go
index 38db929..e0b1d7c 100644
--- a/android/soong_config_modules.go
+++ b/android/soong_config_modules.go
@@ -463,57 +463,6 @@
}).(map[string]blueprint.ModuleFactory)
}
-// tracingConfig is a wrapper to soongconfig.SoongConfig which records all accesses to SoongConfig.
-type tracingConfig struct {
- config soongconfig.SoongConfig
- boolSet map[string]bool
- stringSet map[string]string
- isSetSet map[string]bool
-}
-
-func (c *tracingConfig) Bool(name string) bool {
- c.boolSet[name] = c.config.Bool(name)
- return c.boolSet[name]
-}
-
-func (c *tracingConfig) String(name string) string {
- c.stringSet[name] = c.config.String(name)
- return c.stringSet[name]
-}
-
-func (c *tracingConfig) IsSet(name string) bool {
- c.isSetSet[name] = c.config.IsSet(name)
- return c.isSetSet[name]
-}
-
-func (c *tracingConfig) getTrace() soongConfigTrace {
- ret := soongConfigTrace{}
-
- for k, v := range c.boolSet {
- ret.Bools = append(ret.Bools, fmt.Sprintf("%q:%t", k, v))
- }
- for k, v := range c.stringSet {
- ret.Strings = append(ret.Strings, fmt.Sprintf("%q:%q", k, v))
- }
- for k, v := range c.isSetSet {
- ret.IsSets = append(ret.IsSets, fmt.Sprintf("%q:%t", k, v))
- }
-
- return ret
-}
-
-func newTracingConfig(config soongconfig.SoongConfig) *tracingConfig {
- c := tracingConfig{
- config: config,
- boolSet: make(map[string]bool),
- stringSet: make(map[string]string),
- isSetSet: make(map[string]bool),
- }
- return &c
-}
-
-var _ soongconfig.SoongConfig = (*tracingConfig)(nil)
-
// configModuleFactory takes an existing soongConfigModuleFactory and a
// ModuleType to create a new ModuleFactory that uses a custom loadhook.
func configModuleFactory(factory blueprint.ModuleFactory, moduleType *soongconfig.ModuleType) blueprint.ModuleFactory {
@@ -561,8 +510,8 @@
// conditional on Soong config variables by reading the product
// config variables from Make.
AddLoadHook(module, func(ctx LoadHookContext) {
- tracingConfig := newTracingConfig(ctx.Config().VendorConfig(moduleType.ConfigNamespace))
- newProps, err := soongconfig.PropertiesToApply(moduleType, conditionalProps, tracingConfig)
+ config := ctx.Config().VendorConfig(moduleType.ConfigNamespace)
+ newProps, err := soongconfig.PropertiesToApply(moduleType, conditionalProps, config)
if err != nil {
ctx.ModuleErrorf("%s", err)
return
@@ -570,8 +519,6 @@
for _, ps := range newProps {
ctx.AppendProperties(ps)
}
-
- module.(Module).base().commonProperties.SoongConfigTrace = tracingConfig.getTrace()
})
return module, props
}