Skip to content

Commit 6d0dd36

Browse files
authored
Use only enabled traits when loading package (#8970)
Both `loadPackage` and `loadRootPackage` specified all traits as enabled when loading a package. Narrow this to only the enabled traits so that the returned `Package` accurately reflects the enabled traits.
1 parent 3fbec0b commit 6d0dd36

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/Workspace/Workspace.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,8 +1262,7 @@ extension Workspace {
12621262
prebuilts: [:],
12631263
fileSystem: self.fileSystem,
12641264
observabilityScope: observabilityScope,
1265-
// For now we enable all traits
1266-
enabledTraits: Set(manifest.traits.map(\.name))
1265+
enabledTraits: try manifest.enabledTraits(using: .default)
12671266
)
12681267
return try builder.construct()
12691268
}
@@ -1330,8 +1329,7 @@ extension Workspace {
13301329
createREPLProduct: self.configuration.createREPLProduct,
13311330
fileSystem: self.fileSystem,
13321331
observabilityScope: observabilityScope,
1333-
// For now we enable all traits
1334-
enabledTraits: Set(manifest.traits.map(\.name))
1332+
enabledTraits: try manifest.enabledTraits(using: .default)
13351333
)
13361334
return try builder.construct()
13371335
}

0 commit comments

Comments
 (0)