summaryrefslogtreecommitdiff
path: root/android/paths.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-27 14:17:53 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-27 14:17:53 -0800
commit433dcb4e7f8a93c93dd20361c55056a24e4f786e (patch)
tree0bd86ad4426e5a965d3775c4bb907fe0db2f0596 /android/paths.go
parentcef5a0630d5500f4bc5b1d11b7b3b4985f943246 (diff)
parent92ac46d1fe04a94d94025554bcecc5f8cb2416ae (diff)
Merge "Build Go tools for arm" into main
Diffstat (limited to 'android/paths.go')
-rw-r--r--android/paths.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/android/paths.go b/android/paths.go
index a944c48db..9c0c9a273 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -209,6 +209,10 @@ type ModuleErrorfContext interface {
var _ ModuleErrorfContext = blueprint.ModuleContext(nil)
+type AddMissingDependenciesContext interface {
+ AddMissingDependencies([]string)
+}
+
// reportPathError will register an error with the attached context. It
// attempts ctx.ModuleErrorf for a better error message first, then falls
// back to ctx.Errorf.
@@ -220,7 +224,9 @@ func reportPathError(ctx PathContext, err error) {
// attempts ctx.ModuleErrorf for a better error message first, then falls
// back to ctx.Errorf.
func ReportPathErrorf(ctx PathContext, format string, args ...interface{}) {
- if mctx, ok := ctx.(ModuleErrorfContext); ok {
+ if mctx, ok := ctx.(AddMissingDependenciesContext); ok && ctx.Config().AllowMissingDependencies() {
+ mctx.AddMissingDependencies([]string{fmt.Sprintf(format, args...)})
+ } else if mctx, ok := ctx.(ModuleErrorfContext); ok {
mctx.ModuleErrorf(format, args...)
} else if ectx, ok := ctx.(errorfContext); ok {
ectx.Errorf(format, args...)