@@ -1333,14 +1333,7 @@ extension Workspace {
1333
1333
}
1334
1334
1335
1335
// optimization: preload in parallel
1336
- let rootDependencyManifestsURLs = root. dependencies. map { dependency -> String in
1337
- switch dependency {
1338
- case . local( let data) :
1339
- return data. path. pathString
1340
- case . git( let data) :
1341
- return data. location
1342
- }
1343
- }
1336
+ let rootDependencyManifestsURLs = root. dependencies. map { $0. location }
1344
1337
let rootDependencyManifests = try temp_await { self . loadManifests ( forURLs: rootDependencyManifestsURLs, diagnostics: diagnostics, completion: $0) }
1345
1338
1346
1339
let inputManifests = root. manifests + rootDependencyManifests
@@ -1353,34 +1346,15 @@ extension Workspace {
1353
1346
let productFilter : ProductFilter
1354
1347
}
1355
1348
1356
-
1357
1349
// optimization: preload manifest we know about in parallel
1358
- let inputDependenciesURLs = inputManifests. map { manifest in
1359
- //$0.dependencies.map{ config.mirrors.effectiveURL(forURL: $0.location) }
1360
- manifest. dependencies. map { dependency -> String in
1361
- switch dependency {
1362
- case . local( let data) :
1363
- return data. path. pathString
1364
- case . git( let data) :
1365
- return data. location
1366
- }
1367
- }
1368
-
1369
- } . flatMap { $0 }
1350
+ let inputDependenciesURLs = inputManifests. map { $0. dependencies. map { $0. location } } . flatMap { $0 }
1370
1351
// FIXME: this should not block
1371
1352
var loadedManifests = try temp_await { self . loadManifests ( forURLs: inputDependenciesURLs, diagnostics: diagnostics, completion: $0) } . spm_createDictionary { ( $0. packageLocation, $0) }
1372
1353
1373
1354
// continue to load the rest of the manifest for this graph
1374
1355
let allManifestsWithPossibleDuplicates = try topologicalSort ( inputManifests. map { KeyedPair ( $0, key: URLAndFilter ( url: $0. packageLocation, productFilter: . everything) ) } ) { node in
1375
1356
return node. item. dependenciesRequired ( for: node. key. productFilter) . compactMap { dependency in
1376
- //let url = config.mirrors.effectiveURL(forURL: dependency.location)
1377
- let location : String
1378
- switch dependency {
1379
- case . local( let data) :
1380
- location = data. path. pathString
1381
- case . git( let data) :
1382
- location = data. location
1383
- }
1357
+ let location = dependency. location
1384
1358
// FIXME: this should not block
1385
1359
// note: loadManifest emits diagnostics in case it fails
1386
1360
let manifest = loadedManifests [ location] ?? temp_await { self . loadManifest ( forURL: location, diagnostics: diagnostics, completion: $0) }
@@ -2635,3 +2609,16 @@ public final class LoadableResult<Value> {
2635
2609
return try loadResult ( ) . get ( )
2636
2610
}
2637
2611
}
2612
+
2613
+ // FIXME: the manifest loading logic should be changed to use identity instead of location once identity is unique
2614
+ // at that time we should remove this
2615
+ extension PackageDependencyDescription {
2616
+ var location : String {
2617
+ switch self {
2618
+ case . local( let data) :
2619
+ return data. path. pathString
2620
+ case . git( let data) :
2621
+ return data. location
2622
+ }
2623
+ }
2624
+ }
0 commit comments