@@ -62,13 +62,12 @@ func withService(
6262func withSession(
6363 service: SWBBuildService ,
6464 name: String ,
65- packageManagerResourcesDirectory: Basics . AbsolutePath ? ,
6665 body: @escaping (
6766 _ session: SWBBuildServiceSession ,
6867 _ diagnostics: [ SwiftBuild . SwiftBuildMessage . DiagnosticInfo ]
6968 ) async throws -> Void
7069) async throws {
71- switch await service. createSession ( name: name, resourceSearchPaths : packageManagerResourcesDirectory . map { [ $0 . pathString ] } ?? [ ] , cachePath: nil , inferiorProductsPath: nil , environment: nil ) {
70+ switch await service. createSession ( name: name, cachePath: nil , inferiorProductsPath: nil , environment: nil ) {
7271 case ( . success( let session) , let diagnostics) :
7372 do {
7473 try await body ( session, diagnostics)
@@ -160,7 +159,6 @@ private final class PlanningOperationDelegate: SWBPlanningOperationDelegate, Sen
160159public final class SwiftBuildSystem : SPMBuildCore . BuildSystem {
161160 private let buildParameters : BuildParameters
162161 private let packageGraphLoader : ( ) async throws -> ModulesGraph
163- private let packageManagerResourcesDirectory : Basics . AbsolutePath ?
164162 private let logLevel : Basics . Diagnostic . Severity
165163 private var packageGraph : AsyncThrowingValueMemoizer < ModulesGraph > = . init( )
166164 private var pifBuilder : AsyncThrowingValueMemoizer < PIFBuilder > = . init( )
@@ -211,15 +209,13 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
211209 public init (
212210 buildParameters: BuildParameters ,
213211 packageGraphLoader: @escaping ( ) async throws -> ModulesGraph ,
214- packageManagerResourcesDirectory: Basics . AbsolutePath ? ,
215212 outputStream: OutputByteStream ,
216213 logLevel: Basics . Diagnostic . Severity ,
217214 fileSystem: FileSystem ,
218215 observabilityScope: ObservabilityScope
219216 ) throws {
220217 self . buildParameters = buildParameters
221218 self . packageGraphLoader = packageGraphLoader
222- self . packageManagerResourcesDirectory = packageManagerResourcesDirectory
223219 self . outputStream = outputStream
224220 self . logLevel = logLevel
225221 self . fileSystem = fileSystem
@@ -260,16 +256,16 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
260256 header: " "
261257 )
262258
263- do {
264- try await withSession ( service: service, name: self . buildParameters. pifManifest. pathString, packageManagerResourcesDirectory : self . packageManagerResourcesDirectory ) { session, _ in
265- // Load the workspace, and set the system information to the default
266- do {
267- try await session. loadWorkspace ( containerPath: self . buildParameters. pifManifest. pathString)
268- try await session. setSystemInfo ( . default( ) )
269- } catch {
270- self . observabilityScope. emit ( error: error. localizedDescription)
271- throw error
272- }
259+ do {
260+ try await withSession ( service: service, name: buildParameters. pifManifest. pathString) { session, _ in
261+ // Load the workspace, and set the system information to the default
262+ do {
263+ try await session. loadWorkspace ( containerPath: self . buildParameters. pifManifest. pathString)
264+ try await session. setSystemInfo ( . default( ) )
265+ } catch {
266+ self . observabilityScope. emit ( error: error. localizedDescription)
267+ throw error
268+ }
273269
274270 // Find the targets to build.
275271 let configuredTargets : [ SWBConfiguredTarget ]
0 commit comments