Prevent bots/analyze.dart crashing on circular dependencies (#123802)
Prevent bots/analyze.dart crashing on circular dependencies
This commit is contained in:
@@ -1772,7 +1772,14 @@ Future<void> _checkConsumerDependencies() async {
|
||||
|
||||
final List<String> currentDependencies = (currentPackage['dependencies']! as List<Object?>).cast<String>();
|
||||
for (final String dependency in currentDependencies) {
|
||||
workset.add(dependencyTree[dependency]!);
|
||||
// Don't add dependencies we've already seen or we will get stuck
|
||||
// forever if there are any circular references.
|
||||
// TODO(dantup): Consider failing gracefully with the names of the
|
||||
// packages once the cycle between test_api and matcher is resolved.
|
||||
// https://github.com/dart-lang/test/issues/1979
|
||||
if (!dependencies.contains(dependency)) {
|
||||
workset.add(dependencyTree[dependency]!);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user