Use localPool consistently for UseGoma() == true

Remove the distinction between pctx.StaticRule and
pctx.AndroidStaticRule so that all of the local rules correctly
get assigned to the localPool.  Also put Module and Singleton
rules into the localPool.

Test: compare out/soong/build.ninja
Change-Id: Id2bb38eff3c7209340fe55bc9006f00bd3661d81
This commit is contained in:
Colin Cross
2019-09-25 13:31:46 -07:00
parent 852116a061
commit 2e2dbc250a
4 changed files with 29 additions and 18 deletions

View File

@@ -127,6 +127,11 @@ func (s *singletonContextAdaptor) Variable(pctx PackageContext, name, value stri
}
func (s *singletonContextAdaptor) Rule(pctx PackageContext, name string, params blueprint.RuleParams, argNames ...string) blueprint.Rule {
if s.Config().UseGoma() && params.Pool == nil {
// When USE_GOMA=true is set and the rule is not supported by goma, restrict jobs to the
// local parallelism value
params.Pool = localPool
}
rule := s.SingletonContext.Rule(pctx.PackageContext, name, params, argNames...)
if s.Config().captureBuild {
s.ruleParams[rule] = params