@@ -2364,8 +2364,6 @@ extension Workspace {
2364
2364
explicitProduct: String ? = nil ,
2365
2365
forceResolution: Bool ,
2366
2366
constraints: [ PackageContainerConstraint ] ,
2367
- retryOnPackagePathMismatch: Bool = true ,
2368
- resetPinsStoreOnFailure: Bool = true ,
2369
2367
observabilityScope: ObservabilityScope
2370
2368
) throws -> DependencyManifests {
2371
2369
// Ensure the cache path exists and validate that edited dependencies.
@@ -2452,51 +2450,12 @@ extension Workspace {
2452
2450
2453
2451
// Update the pinsStore.
2454
2452
let updatedDependencyManifests = try self . loadDependencyManifests ( root: graphRoot, observabilityScope: observabilityScope)
2455
-
2456
- // If we still have required URLs, we probably cloned a wrong URL for
2457
- // some package dependency.
2458
- //
2459
- // This would usually happen when we're resolving from scratch and the
2460
- // resolved file has an outdated entry for a transitive dependency whose
2461
- // URL was changed. For e.g., the resolved file could refer to a dependency
2462
- // through a ssh url but its new reference is now changed to http.
2453
+ // If we still have missing packages, something is fundamentally wrong with the resolution of the graph
2463
2454
let stillMissingPackages = updatedDependencyManifests. computePackages ( ) . missing
2464
- if !stillMissingPackages. isEmpty {
2465
- if retryOnPackagePathMismatch {
2466
- // Retry resolution which will most likely resolve correctly now since
2467
- // we have the manifest files of all the dependencies.
2468
- return try self . resolve (
2469
- root: root,
2470
- explicitProduct: explicitProduct,
2471
- forceResolution: forceResolution,
2472
- constraints: constraints,
2473
- retryOnPackagePathMismatch: false ,
2474
- resetPinsStoreOnFailure: resetPinsStoreOnFailure,
2475
- observabilityScope: observabilityScope
2476
- )
2477
- } else if resetPinsStoreOnFailure, !pinsStore. pinsMap. isEmpty {
2478
- // If we weren't able to resolve properly even after a retry, it
2479
- // could mean that the dependency at fault has a different
2480
- // version of the manifest file which contains dependencies that
2481
- // have also changed their package references.
2482
- pinsStore. unpinAll ( )
2483
- try pinsStore. saveState ( toolsVersion: rootManifestsMinimumToolsVersion)
2484
- // try again with pins reset
2485
- return try self . resolve (
2486
- root: root,
2487
- explicitProduct: explicitProduct,
2488
- forceResolution: forceResolution,
2489
- constraints: constraints,
2490
- retryOnPackagePathMismatch: false ,
2491
- resetPinsStoreOnFailure: false ,
2492
- observabilityScope: observabilityScope
2493
- )
2494
- } else {
2495
- // give up
2496
- let missing = stillMissingPackages. map { $0. description }
2497
- observabilityScope. emit ( error: " exhausted attempts to resolve the dependencies graph, with ' \( missing. joined ( separator: " ', ' " ) ) ' unresolved. " )
2498
- return updatedDependencyManifests
2499
- }
2455
+ guard stillMissingPackages. isEmpty else {
2456
+ let missing = stillMissingPackages. map { $0. description }
2457
+ observabilityScope. emit ( error: " exhausted attempts to resolve the dependencies graph, with ' \( missing. joined ( separator: " ', ' " ) ) ' unresolved. " )
2458
+ return updatedDependencyManifests
2500
2459
}
2501
2460
2502
2461
self . pinAll (
0 commit comments