diff options
| author | 2024-05-02 22:50:28 +0000 | |
|---|---|---|
| committer | 2024-05-02 22:50:28 +0000 | |
| commit | 814e80038b4131b79cf362cc5cd0d9cf32467afc (patch) | |
| tree | 095fa6d1ada2fbdeef890466ca06e062e02e05d1 | |
| parent | 01bd5b1ddf0706ecb683f1fc70bf1d11028e7591 (diff) | |
| parent | 888046f053653ad3dd8e50d5d0478d1991b11691 (diff) | |
Merge changes from topic "replace_dependencies" into main
* changes:
Only update DebugMutator and DebugVariation for non-empty transition variations
Update docs for ReplaceDependencies[If]
Raise test timeout when running soong tests with race detector
| -rw-r--r-- | android/mutator.go | 24 | ||||
| -rwxr-xr-x | scripts/run-soong-tests-with-go-tools.sh | 2 |
2 files changed, 15 insertions, 11 deletions
diff --git a/android/mutator.go b/android/mutator.go index 75ba65048..9cfdb60dc 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -293,15 +293,14 @@ type BottomUpMutatorContext interface { // WalkDeps, etc. AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) - // ReplaceDependencies replaces all dependencies on the identical variant of the module with the - // specified name with the current variant of this module. Replacements don't take effect until - // after the mutator pass is finished. + // ReplaceDependencies finds all the variants of the module with the specified name, then + // replaces all dependencies onto those variants with the current variant of this module. + // Replacements don't take effect until after the mutator pass is finished. ReplaceDependencies(string) - // ReplaceDependencies replaces all dependencies on the identical variant of the module with the - // specified name with the current variant of this module as long as the supplied predicate returns - // true. - // + // ReplaceDependenciesIf finds all the variants of the module with the specified name, then + // replaces all dependencies onto those variants with the current variant of this module + // as long as the supplied predicate returns true. // Replacements don't take effect until after the mutator pass is finished. ReplaceDependenciesIf(string, blueprint.ReplaceDependencyPredicate) @@ -595,11 +594,16 @@ func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTr func (a *androidTransitionMutator) Mutate(ctx blueprint.BottomUpMutatorContext, variation string) { if am, ok := ctx.Module().(Module); ok { + if variation != "" { + // TODO: this should really be checking whether the TransitionMutator affected this module, not + // the empty variant, but TransitionMutator has no concept of skipping a module. + base := am.base() + base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, a.name) + base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variation) + } + mctx := bottomUpMutatorContextFactory(ctx, am, a.finalPhase) defer bottomUpMutatorContextPool.Put(mctx) - base := am.base() - base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, a.name) - base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variation) a.mutator.Mutate(mctx, variation) } } diff --git a/scripts/run-soong-tests-with-go-tools.sh b/scripts/run-soong-tests-with-go-tools.sh index 93c622ea4..1fbb1fc77 100755 --- a/scripts/run-soong-tests-with-go-tools.sh +++ b/scripts/run-soong-tests-with-go-tools.sh @@ -74,6 +74,6 @@ for dir in "${go_modules[@]}"; do (cd "$dir"; eval ${network_jail} -- ${GOROOT}/bin/go build ./... eval ${network_jail} -- ${GOROOT}/bin/go test ./... - eval ${network_jail} -- ${GOROOT}/bin/go test -race -short ./... + eval ${network_jail} -- ${GOROOT}/bin/go test -race -timeout 20m -short ./... ) done |