Skip to content

Commit 5606f65

Browse files
committed
[PackageGraph] Bail out as early as possible when there are errors
<rdar://problem/49527170>
1 parent aba57c5 commit 5606f65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/PackageGraph/DependencyResolver.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,8 @@ public class DependencyResolver {
10411041
subjectTo allConstraints: PackageContainerConstraintSet,
10421042
excluding allExclusions: [PackageReference: Set<Version>]
10431043
) -> AnySequence<VersionAssignmentSet> {
1044+
guard self.error == nil else { return AnySequence([]) }
1045+
10441046
// The key that is used to cache this assignement set.
10451047
let cacheKey = ResolveSubtreeCacheKey(container: container, allConstraints: allConstraints)
10461048

@@ -1067,6 +1069,7 @@ public class DependencyResolver {
10671069
//
10681070
// FIXME: We must detect recursion here.
10691071
func merge(constraints: [PackageContainerConstraint], binding: BoundVersion) -> AnySequence<VersionAssignmentSet> {
1072+
guard self.error == nil else { return AnySequence([]) }
10701073

10711074
// Diagnose if this container depends on itself.
10721075
if constraints.contains(where: { $0.identifier == container.identifier }) {
@@ -1181,6 +1184,8 @@ public class DependencyResolver {
11811184
subjectTo allConstraints: PackageContainerConstraintSet,
11821185
excluding allExclusions: [PackageReference: Set<Version>]
11831186
) -> AnySequence<VersionAssignmentSet> {
1187+
guard self.error == nil else { return AnySequence([]) }
1188+
11841189
var allConstraints = allConstraints
11851190

11861191
// Never prefetch when running in incomplete mode.

0 commit comments

Comments
 (0)