Skip to content

Commit d163620

Browse files
authored
Prevent bots/analyze.dart crashing on circular dependencies (#123802)
Prevent bots/analyze.dart crashing on circular dependencies
1 parent 587b9fc commit d163620

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dev/bots/analyze.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,14 @@ Future<void> _checkConsumerDependencies() async {
17721772

17731773
final List<String> currentDependencies = (currentPackage['dependencies']! as List<Object?>).cast<String>();
17741774
for (final String dependency in currentDependencies) {
1775-
workset.add(dependencyTree[dependency]!);
1775+
// Don't add dependencies we've already seen or we will get stuck
1776+
// forever if there are any circular references.
1777+
// TODO(dantup): Consider failing gracefully with the names of the
1778+
// packages once the cycle between test_api and matcher is resolved.
1779+
// https://github.com/dart-lang/test/issues/1979
1780+
if (!dependencies.contains(dependency)) {
1781+
workset.add(dependencyTree[dependency]!);
1782+
}
17761783
}
17771784
}
17781785
}

0 commit comments

Comments
 (0)