Merge "improve error handling for SourceRootDirs" am: b72610665c
am: dad03f387c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2516015 Change-Id: Ic7fdeefd50a9e482b12a65d7ba78d2cd03a032c1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -245,6 +245,10 @@ func (r *NameResolver) AllModules() []blueprint.ModuleGroup {
|
|||||||
return allModules
|
return allModules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *NameResolver) SkippedModuleFromName(moduleName string, namespace blueprint.Namespace) (skipInfos []blueprint.SkippedModuleInfo, skipped bool) {
|
||||||
|
return r.rootNamespace.moduleContainer.SkippedModuleFromName(moduleName, namespace)
|
||||||
|
}
|
||||||
|
|
||||||
// parses a fully-qualified path (like "//namespace_path:module_name") into a namespace name and a
|
// parses a fully-qualified path (like "//namespace_path:module_name") into a namespace name and a
|
||||||
// module name
|
// module name
|
||||||
func (r *NameResolver) parseFullyQualifiedName(name string) (namespaceName string, moduleName string, ok bool) {
|
func (r *NameResolver) parseFullyQualifiedName(name string) (namespaceName string, moduleName string, ok bool) {
|
||||||
@@ -333,11 +337,16 @@ func (r *NameResolver) MissingDependencyError(depender string, dependerNamespace
|
|||||||
|
|
||||||
// determine which namespaces the module can be found in
|
// determine which namespaces the module can be found in
|
||||||
foundInNamespaces := []string{}
|
foundInNamespaces := []string{}
|
||||||
|
skippedDepErrors := []error{}
|
||||||
for _, namespace := range r.sortedNamespaces.sortedItems() {
|
for _, namespace := range r.sortedNamespaces.sortedItems() {
|
||||||
_, found := namespace.moduleContainer.ModuleFromName(depName, nil)
|
_, found := namespace.moduleContainer.ModuleFromName(depName, nil)
|
||||||
if found {
|
if found {
|
||||||
foundInNamespaces = append(foundInNamespaces, namespace.Path)
|
foundInNamespaces = append(foundInNamespaces, namespace.Path)
|
||||||
}
|
}
|
||||||
|
_, skipped := namespace.moduleContainer.SkippedModuleFromName(depName, nil)
|
||||||
|
if skipped {
|
||||||
|
skippedDepErrors = append(skippedDepErrors, namespace.moduleContainer.MissingDependencyError(depender, dependerNamespace, depName))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(foundInNamespaces) > 0 {
|
if len(foundInNamespaces) > 0 {
|
||||||
// determine which namespaces are visible to dependerNamespace
|
// determine which namespaces are visible to dependerNamespace
|
||||||
@@ -350,6 +359,9 @@ func (r *NameResolver) MissingDependencyError(depender string, dependerNamespace
|
|||||||
text += fmt.Sprintf("\nModule %q is defined in namespace %q which can read these %v namespaces: %q", depender, dependerNs.Path, len(importedNames), importedNames)
|
text += fmt.Sprintf("\nModule %q is defined in namespace %q which can read these %v namespaces: %q", depender, dependerNs.Path, len(importedNames), importedNames)
|
||||||
text += fmt.Sprintf("\nModule %q can be found in these namespaces: %q", depName, foundInNamespaces)
|
text += fmt.Sprintf("\nModule %q can be found in these namespaces: %q", depName, foundInNamespaces)
|
||||||
}
|
}
|
||||||
|
for _, err := range skippedDepErrors {
|
||||||
|
text += fmt.Sprintf("\n%s", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Errorf(text)
|
return fmt.Errorf(text)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user