@@ -160,20 +160,7 @@ public struct PubGrubDependencyResolver {
160
160
}
161
161
162
162
do {
163
- // Strip packages that have prebuilt libraries only if they match library version.
164
- //
165
- // FIXME: This is built on assumption that libraries are part of the SDK and are
166
- // always available in include/library paths, but what happens if they are
167
- // part of a toolchain instead? Builder needs an indicator that certain path
168
- // has to be included when building packages that depend on prebuilt libraries.
169
- let bindings = try self . solve ( root: root, constraints: constraints) . bindings. filter {
170
- if case let . version( version) = $0. boundVersion {
171
- if let library = $0. package . matchingPrebuiltLibrary ( in: self . availableLibraries) {
172
- return . init( stringLiteral: library. version) != version
173
- }
174
- }
175
- return true
176
- }
163
+ let bindings = try self . solve ( root: root, constraints: constraints) . bindings
177
164
return . success( bindings)
178
165
} catch {
179
166
// If version solving failing, build the user-facing diagnostic.
@@ -238,6 +225,8 @@ public struct PubGrubDependencyResolver {
238
225
continue
239
226
}
240
227
228
+ let package = assignment. term. node. package
229
+
241
230
let boundVersion : BoundVersion
242
231
switch assignment. term. requirement {
243
232
case . exact( let version) :
@@ -246,10 +235,22 @@ public struct PubGrubDependencyResolver {
246
235
throw InternalError ( " unexpected requirement value for assignment \( assignment. term) " )
247
236
}
248
237
238
+ // Strip packages that have prebuilt libraries only if they match library version.
239
+ //
240
+ // FIXME: This is built on assumption that libraries are part of the SDK and are
241
+ // always available in include/library paths, but what happens if they are
242
+ // part of a toolchain instead? Builder needs an indicator that certain path
243
+ // has to be included when building packages that depend on prebuilt libraries.
244
+ if let library = package . matchingPrebuiltLibrary ( in: availableLibraries) ,
245
+ boundVersion == . version( . init( stringLiteral: library. version) )
246
+ {
247
+ continue
248
+ }
249
+
249
250
let products = assignment. term. node. productFilter
250
251
251
252
// TODO: replace with async/await when available
252
- let container = try temp_await { provider. getContainer ( for: assignment . term . node . package , completion: $0) }
253
+ let container = try temp_await { provider. getContainer ( for: package , completion: $0) }
253
254
let updatePackage = try container. underlying. loadPackageReference ( at: boundVersion)
254
255
255
256
if var existing = flattenedAssignments [ updatePackage] {
0 commit comments