From dedda2e60a5ed78d6c2131cc67f1d8f85da12803 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Fri, 7 Mar 2025 10:58:49 -0800 Subject: [PATCH] Add support for looking up spec resources in a toolchain install --- Package.swift | 4 ++-- Sources/SWBAndroidPlatform/Plugin.swift | 4 ++-- Sources/SWBApplePlatform/Plugin.swift | 4 ++-- Sources/SWBBuildService/BuildService.swift | 4 ++-- Sources/SWBBuildService/Messages.swift | 1 + Sources/SWBCore/Core.swift | 12 ++++++++---- .../Extensions/SpecificationsExtension.swift | 19 +++++++++++++++---- Sources/SWBCore/Settings/Settings.swift | 4 ++-- .../SpecImplementations/RegisterSpecs.swift | 4 ++-- Sources/SWBGenericUnixPlatform/Plugin.swift | 4 ++-- Sources/SWBProtocol/Message.swift | 9 ++++++++- Sources/SWBQNXPlatform/Plugin.swift | 4 ++-- Sources/SWBTestSupport/CoreTestSupport.swift | 2 +- Sources/SWBUniversalPlatform/Plugin.swift | 8 ++++---- Sources/SWBWebAssemblyPlatform/Plugin.swift | 4 ++-- Sources/SWBWindowsPlatform/Plugin.swift | 4 ++-- Sources/SwiftBuild/SWBBuildService.swift | 9 +++++++-- .../TaskConstructionTests.swift | 2 +- 18 files changed, 65 insertions(+), 37 deletions(-) diff --git a/Package.swift b/Package.swift index 5e3e933f..ae6846a8 100644 --- a/Package.swift +++ b/Package.swift @@ -45,7 +45,7 @@ func swiftSettings(languageMode: SwiftLanguageMode) -> [SwiftSetting] { .swiftLanguageMode(.v5), - .define("USE_STATIC_PLUGIN_INITIALIZATION") + .define("USE_STATIC_PLUGIN_INITIALIZATION"), ] case .v6: return [ @@ -55,7 +55,7 @@ func swiftSettings(languageMode: SwiftLanguageMode) -> [SwiftSetting] { .swiftLanguageMode(.v6), - .define("USE_STATIC_PLUGIN_INITIALIZATION") + .define("USE_STATIC_PLUGIN_INITIALIZATION"), ] default: fatalError("unexpected language mode") diff --git a/Sources/SWBAndroidPlatform/Plugin.swift b/Sources/SWBAndroidPlatform/Plugin.swift index 9784fcb5..a902e098 100644 --- a/Sources/SWBAndroidPlatform/Plugin.swift +++ b/Sources/SWBAndroidPlatform/Plugin.swift @@ -24,8 +24,8 @@ import Foundation } struct AndroidPlatformSpecsExtension: SpecificationsExtension { - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBAndroidPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } func specificationDomains() -> [String : [String]] { diff --git a/Sources/SWBApplePlatform/Plugin.swift b/Sources/SWBApplePlatform/Plugin.swift index 5058e964..b7689eca 100644 --- a/Sources/SWBApplePlatform/Plugin.swift +++ b/Sources/SWBApplePlatform/Plugin.swift @@ -98,8 +98,8 @@ struct ApplePlatformSpecsExtension: SpecificationsExtension { ] } - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBApplePlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } func specificationDomains() -> [String : [String]] { diff --git a/Sources/SWBBuildService/BuildService.swift b/Sources/SWBBuildService/BuildService.swift index 3d2de2b8..99a4928e 100644 --- a/Sources/SWBBuildService/BuildService.swift +++ b/Sources/SWBBuildService/BuildService.swift @@ -157,7 +157,7 @@ package class BuildService: Service, @unchecked Sendable { /// Get a shared core instance. /// /// We use an explicit cache so that we can minimize the number of cores we load while still keeping a flexible public interface that doesn't require all clients to provide all possible required parameters for core initialization (which is useful for testing and debug purposes). - func sharedCore(developerPath: Path?, inferiorProducts: Path? = nil, environment: [String: String] = [:]) async -> (Core?, [Diagnostic]) { + func sharedCore(developerPath: Path?, resourceSearchPaths: [Path] = [], inferiorProducts: Path? = nil, environment: [String: String] = [:]) async -> (Core?, [Diagnostic]) { let key = CoreCacheKey(developerPath: developerPath, inferiorProducts: inferiorProducts, environment: environment) return await sharedCoreCacheLock.withLock { if let existing = sharedCoreCache[key] { @@ -191,7 +191,7 @@ package class BuildService: Service, @unchecked Sendable { } } let delegate = Delegate() - let (core, diagnostics) = await (Core.getInitializedCore(delegate, pluginManager: pluginManager, developerPath: developerPath, inferiorProductsPath: inferiorProducts, environment: environment, buildServiceModTime: buildServiceModTime, connectionMode: connectionMode), delegate.diagnostics) + let (core, diagnostics) = await (Core.getInitializedCore(delegate, pluginManager: pluginManager, developerPath: developerPath, resourceSearchPaths: resourceSearchPaths, inferiorProductsPath: inferiorProducts, environment: environment, buildServiceModTime: buildServiceModTime, connectionMode: connectionMode), delegate.diagnostics) delegate.freeze() sharedCoreCache[key] = (core, diagnostics) return (core, diagnostics) diff --git a/Sources/SWBBuildService/Messages.swift b/Sources/SWBBuildService/Messages.swift index 16fe37b2..0cdcdd81 100644 --- a/Sources/SWBBuildService/Messages.swift +++ b/Sources/SWBBuildService/Messages.swift @@ -124,6 +124,7 @@ private struct CreateSessionHandler: MessageHandler { let service = request.buildService let (core, diagnostics) = await service.sharedCore( developerPath: message.effectiveDeveloperPath, + resourceSearchPaths: message.resourceSearchPaths ?? [], inferiorProducts: message.inferiorProductsPath, environment: message.environment ?? [:] ) diff --git a/Sources/SWBCore/Core.swift b/Sources/SWBCore/Core.swift index d0a5898a..8aa2f8b8 100644 --- a/Sources/SWBCore/Core.swift +++ b/Sources/SWBCore/Core.swift @@ -40,7 +40,7 @@ public final class Core: Sendable { /// Get a configured instance of the core. /// /// - returns: An initialized Core instance on which all discovery and loading will have been completed. If there are errors during that process, they will be logged to `stderr` and no instance will be returned. Otherwise, the initialized object is returned. - public static func getInitializedCore(_ delegate: any CoreDelegate, pluginManager: PluginManager, developerPath: Path? = nil, inferiorProductsPath: Path? = nil, extraPluginRegistration: @PluginExtensionSystemActor (_ pluginPaths: [Path]) -> Void = { _ in }, additionalContentPaths: [Path] = [], environment: [String:String] = [:], buildServiceModTime: Date, connectionMode: ServiceHostConnectionMode) async -> Core? { + public static func getInitializedCore(_ delegate: any CoreDelegate, pluginManager: PluginManager, developerPath: Path? = nil, resourceSearchPaths: [Path] = [], inferiorProductsPath: Path? = nil, extraPluginRegistration: @PluginExtensionSystemActor (_ pluginPaths: [Path]) -> Void = { _ in }, additionalContentPaths: [Path] = [], environment: [String:String] = [:], buildServiceModTime: Date, connectionMode: ServiceHostConnectionMode) async -> Core? { // Enable macro expression interning during loading. return await MacroNamespace.withExpressionInterningEnabled { let hostOperatingSystem: OperatingSystem @@ -73,7 +73,7 @@ public final class Core: Sendable { let core: Core do { - core = try await Core(delegate: delegate, hostOperatingSystem: hostOperatingSystem, pluginManager: pluginManager, developerPath: resolvedDeveloperPath, inferiorProductsPath: inferiorProductsPath, additionalContentPaths: additionalContentPaths, environment: environment, buildServiceModTime: buildServiceModTime, connectionMode: connectionMode) + core = try await Core(delegate: delegate, hostOperatingSystem: hostOperatingSystem, pluginManager: pluginManager, developerPath: resolvedDeveloperPath, resourceSearchPaths: resourceSearchPaths, inferiorProductsPath: inferiorProductsPath, additionalContentPaths: additionalContentPaths, environment: environment, buildServiceModTime: buildServiceModTime, connectionMode: connectionMode) } catch { delegate.error("\(error)") return nil @@ -147,6 +147,9 @@ public final class Core: Sendable { /// The path to the "Developer" directory. public let developerPath: Path + /// Additional search paths to be used when looking up resource bundles. + public let resourceSearchPaths: [Path] + /// The path to the inferior Xcode build directory, if used. public let inferiorProductsPath: Path? @@ -177,11 +180,12 @@ public final class Core: Sendable { public let connectionMode: ServiceHostConnectionMode - @_spi(Testing) public init(delegate: any CoreDelegate, hostOperatingSystem: OperatingSystem, pluginManager: PluginManager, developerPath: String, inferiorProductsPath: Path?, additionalContentPaths: [Path], environment: [String:String], buildServiceModTime: Date, connectionMode: ServiceHostConnectionMode) async throws { + @_spi(Testing) public init(delegate: any CoreDelegate, hostOperatingSystem: OperatingSystem, pluginManager: PluginManager, developerPath: String, resourceSearchPaths: [Path], inferiorProductsPath: Path?, additionalContentPaths: [Path], environment: [String:String], buildServiceModTime: Date, connectionMode: ServiceHostConnectionMode) async throws { self.delegate = delegate self.hostOperatingSystem = hostOperatingSystem self.pluginManager = pluginManager self.developerPath = Path(developerPath) + self.resourceSearchPaths = resourceSearchPaths self.inferiorProductsPath = inferiorProductsPath self.additionalContentPaths = additionalContentPaths self.buildServiceModTime = buildServiceModTime @@ -402,7 +406,7 @@ public final class Core: Sendable { // Find all plugin provided specs. for ext in await self.pluginManager.extensions(of: SpecificationsExtensionPoint.self) { - if let bundle = ext.specificationFiles() { + if let bundle = ext.specificationFiles(resourceSearchPaths: resourceSearchPaths) { for url in bundle.urls(forResourcesWithExtension: "xcspec", subdirectory: nil) ?? [] { do { try searchPaths.append(((url as URL).filePath, "")) diff --git a/Sources/SWBCore/Extensions/SpecificationsExtension.swift b/Sources/SWBCore/Extensions/SpecificationsExtension.swift index b23c8672..827da3d6 100644 --- a/Sources/SWBCore/Extensions/SpecificationsExtension.swift +++ b/Sources/SWBCore/Extensions/SpecificationsExtension.swift @@ -50,7 +50,7 @@ public struct SpecificationsExtensionPoint: ExtensionPoint { public protocol SpecificationsExtension: Sendable { /// Returns the bundle containing the `.xcspec` files. - func specificationFiles() -> Bundle? + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? func specificationDomains() -> [String: [String]] func specificationTypes() -> [any SpecType.Type] func specificationClasses() -> [any SpecIdentifierType.Type] @@ -58,15 +58,26 @@ public protocol SpecificationsExtension: Sendable { func specificationImplementations() -> [any SpecImplementationType.Type] /// Returns the search paths for two use cases: finding the sole remaining `.xcbuildrules` file, and finding executable scripts next to `.xcspec` files. - func specificationSearchPaths() -> [URL] + func specificationSearchPaths(resourceSearchPaths: [Path]) -> [URL] } extension SpecificationsExtension { - public func specificationFiles() -> Bundle? { nil } + public func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { nil } public func specificationDomains() -> [String: [String]] { [:] } public func specificationTypes() -> [any SpecType.Type] { [] } public func specificationClasses() -> [any SpecIdentifierType.Type] { [] } public func specificationClassesClassic() -> [any SpecClassType.Type] { [] } public func specificationImplementations() -> [any SpecImplementationType.Type] { [] } - public func specificationSearchPaths() -> [URL] { [] } + public func specificationSearchPaths(resourceSearchPaths: [Path]) -> [URL] { [] } + + public func findResourceBundle(nameWhenInstalledInToolchain: String, resourceSearchPaths: [Path], defaultBundle: @autoclosure () -> Bundle?) -> Bundle? { + for searchPath in resourceSearchPaths { + for bundleBasename in ["\(nameWhenInstalledInToolchain).bundle", "\(nameWhenInstalledInToolchain).resources"] { + if let bundle = Bundle(path: searchPath.join(bundleBasename).str) { + return bundle + } + } + } + return defaultBundle() + } } diff --git a/Sources/SWBCore/Settings/Settings.swift b/Sources/SWBCore/Settings/Settings.swift index 96878e5f..ce78eadf 100644 --- a/Sources/SWBCore/Settings/Settings.swift +++ b/Sources/SWBCore/Settings/Settings.swift @@ -348,7 +348,7 @@ fileprivate struct PreOverridesSettings { @preconcurrency @PluginExtensionSystemActor func searchPaths() -> [Path] { core.pluginManager.extensions(of: SpecificationsExtensionPoint.self).flatMap { ext in - ext.specificationSearchPaths().compactMap { try? $0.filePath } + ext.specificationSearchPaths(resourceSearchPaths: core.resourceSearchPaths).compactMap { try? $0.filePath } }.sorted() } @@ -999,7 +999,7 @@ extension WorkspaceContext { @preconcurrency @PluginExtensionSystemActor func searchPaths() -> [Path] { core.pluginManager.extensions(of: SpecificationsExtensionPoint.self).flatMap { ext in - ext.specificationSearchPaths().compactMap { try? $0.filePath } + ext.specificationSearchPaths(resourceSearchPaths: core.resourceSearchPaths).compactMap { try? $0.filePath } }.sorted() } diff --git a/Sources/SWBCore/SpecImplementations/RegisterSpecs.swift b/Sources/SWBCore/SpecImplementations/RegisterSpecs.swift index c2ec1c19..3d1ad6b5 100644 --- a/Sources/SWBCore/SpecImplementations/RegisterSpecs.swift +++ b/Sources/SWBCore/SpecImplementations/RegisterSpecs.swift @@ -143,7 +143,7 @@ public struct BuiltinSpecsExtension: SpecificationsExtension { ] } - public func specificationFiles() -> Bundle? { - .module + public func specificationFiles(resourceSearchPaths: [SWBUtil.Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBCore", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } } diff --git a/Sources/SWBGenericUnixPlatform/Plugin.swift b/Sources/SWBGenericUnixPlatform/Plugin.swift index c09d87aa..981b8098 100644 --- a/Sources/SWBGenericUnixPlatform/Plugin.swift +++ b/Sources/SWBGenericUnixPlatform/Plugin.swift @@ -19,8 +19,8 @@ import Foundation } struct GenericUnixPlatformSpecsExtension: SpecificationsExtension { - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBGenericUnixPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } func specificationDomains() -> [String: [String]] { diff --git a/Sources/SWBProtocol/Message.swift b/Sources/SWBProtocol/Message.swift index b03a4910..0b7a406f 100644 --- a/Sources/SWBProtocol/Message.swift +++ b/Sources/SWBProtocol/Message.swift @@ -423,6 +423,7 @@ public struct CreateSessionRequest: RequestMessage, Equatable, SerializableCodab public let name: String public let developerPath: Path? + public let resourceSearchPaths: [Path]? public let appPath: Path? public let cachePath: Path? public let inferiorProductsPath: Path? @@ -432,9 +433,14 @@ public struct CreateSessionRequest: RequestMessage, Equatable, SerializableCodab self.init(name: name, developerPath: developerPath, cachePath: cachePath, inferiorProductsPath: inferiorProductsPath, environment: nil) } - public init(name: String, developerPath: Path?, cachePath: Path?, inferiorProductsPath: Path?, environment: [String:String]?) { + public init(name: String, developerPath: Path?, cachePath: Path?, inferiorProductsPath: Path?, environment: [String:String]?) { // ABI Compatibility + self.init(name: name, developerPath: developerPath, resourceSearchPaths: [], cachePath: cachePath, inferiorProductsPath: inferiorProductsPath, environment: environment) + } + + public init(name: String, developerPath: Path?, resourceSearchPaths: [Path], cachePath: Path?, inferiorProductsPath: Path?, environment: [String:String]?) { self.name = name self.developerPath = developerPath + self.resourceSearchPaths = resourceSearchPaths self.appPath = developerPath?.dirname.dirname self.cachePath = cachePath self.inferiorProductsPath = inferiorProductsPath @@ -446,6 +452,7 @@ public struct CreateSessionRequest: RequestMessage, Equatable, SerializableCodab self.name = try deserializer.deserialize() self.appPath = try deserializer.deserialize() self.developerPath = count >= 5 ? try deserializer.deserialize() : appPath?.join("Contents").join("Developer") + self.resourceSearchPaths = [] self.cachePath = try deserializer.deserialize() self.inferiorProductsPath = try deserializer.deserialize() self.environment = nil diff --git a/Sources/SWBQNXPlatform/Plugin.swift b/Sources/SWBQNXPlatform/Plugin.swift index 665fa798..d8355d4c 100644 --- a/Sources/SWBQNXPlatform/Plugin.swift +++ b/Sources/SWBQNXPlatform/Plugin.swift @@ -24,8 +24,8 @@ import Foundation } struct QNXPlatformSpecsExtension: SpecificationsExtension { - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBQNXPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } } diff --git a/Sources/SWBTestSupport/CoreTestSupport.swift b/Sources/SWBTestSupport/CoreTestSupport.swift index 59865b2b..f1366987 100644 --- a/Sources/SWBTestSupport/CoreTestSupport.swift +++ b/Sources/SWBTestSupport/CoreTestSupport.swift @@ -40,7 +40,7 @@ extension Core { developerPath = "/" } let delegate = TestingCoreDelegate() - return await (try Core(delegate: delegate, hostOperatingSystem: hostOperatingSystem, pluginManager: PluginManager(skipLoadingPluginIdentifiers: []), developerPath: developerPath, inferiorProductsPath: nil, additionalContentPaths: [], environment: [:], buildServiceModTime: Date(), connectionMode: .inProcess), delegate.diagnostics) + return await (try Core(delegate: delegate, hostOperatingSystem: hostOperatingSystem, pluginManager: PluginManager(skipLoadingPluginIdentifiers: []), developerPath: developerPath, resourceSearchPaths: [], inferiorProductsPath: nil, additionalContentPaths: [], environment: [:], buildServiceModTime: Date(), connectionMode: .inProcess), delegate.diagnostics) } /// Get an initialized Core suitable for testing. diff --git a/Sources/SWBUniversalPlatform/Plugin.swift b/Sources/SWBUniversalPlatform/Plugin.swift index 8895d069..bd278de3 100644 --- a/Sources/SWBUniversalPlatform/Plugin.swift +++ b/Sources/SWBUniversalPlatform/Plugin.swift @@ -35,12 +35,12 @@ struct UniversalPlatformSpecsExtension: SpecificationsExtension { ] } - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBUniversalPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } // Allow locating the sole remaining `.xcbuildrules` file. - func specificationSearchPaths() -> [URL] { - Bundle.module.resourceURL.map { [$0] } ?? [] + func specificationSearchPaths(resourceSearchPaths: [Path]) -> [URL] { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBUniversalPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module)?.resourceURL.map { [$0] } ?? [] } } diff --git a/Sources/SWBWebAssemblyPlatform/Plugin.swift b/Sources/SWBWebAssemblyPlatform/Plugin.swift index d2f17a28..4a7561b9 100644 --- a/Sources/SWBWebAssemblyPlatform/Plugin.swift +++ b/Sources/SWBWebAssemblyPlatform/Plugin.swift @@ -22,8 +22,8 @@ import Foundation } struct WebAssemblyPlatformSpecsExtension: SpecificationsExtension { - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBWebAssemblyPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } } diff --git a/Sources/SWBWindowsPlatform/Plugin.swift b/Sources/SWBWindowsPlatform/Plugin.swift index 59a31d8f..741faf86 100644 --- a/Sources/SWBWindowsPlatform/Plugin.swift +++ b/Sources/SWBWindowsPlatform/Plugin.swift @@ -20,8 +20,8 @@ import Foundation } struct WindowsPlatformSpecsExtension: SpecificationsExtension { - func specificationFiles() -> Bundle? { - .module + func specificationFiles(resourceSearchPaths: [Path]) -> Bundle? { + findResourceBundle(nameWhenInstalledInToolchain: "SwiftBuild_SWBWindowsPlatform", resourceSearchPaths: resourceSearchPaths, defaultBundle: Bundle.module) } } diff --git a/Sources/SwiftBuild/SWBBuildService.swift b/Sources/SwiftBuild/SWBBuildService.swift index 33c96721..5bc217ce 100644 --- a/Sources/SwiftBuild/SWBBuildService.swift +++ b/Sources/SwiftBuild/SWBBuildService.swift @@ -194,6 +194,11 @@ public final class SWBBuildService: Sendable { await createSession(name: name, developerPath: developerPath, cachePath: cachePath, inferiorProductsPath: inferiorProductsPath, environment: nil) } + // ABI compatibility + public func createSession(name: String, developerPath: String? = nil, cachePath: String?, inferiorProductsPath: String?, environment: [String:String]?) async -> (Result, [SwiftBuildMessage.DiagnosticInfo]) { + await createSession(name: name, resourceSearchPaths: [], cachePath: cachePath, inferiorProductsPath: inferiorProductsPath, environment: environment) + } + /// Create a new service session. /// /// - Parameters: @@ -202,9 +207,9 @@ public final class SWBBuildService: Sendable { /// - inferiorProductsPath: If provided, the path to where inferior Xcode build data is located. /// - environment: If provided, a set of environment variables that are relevant to the build session's context /// - returns: The new session. - public func createSession(name: String, developerPath: String? = nil, cachePath: String?, inferiorProductsPath: String?, environment: [String:String]?) async -> (Result, [SwiftBuildMessage.DiagnosticInfo]) { + public func createSession(name: String, developerPath: String? = nil, resourceSearchPaths: [String], cachePath: String?, inferiorProductsPath: String?, environment: [String:String]?) async -> (Result, [SwiftBuildMessage.DiagnosticInfo]) { do { - let response = try await send(request: CreateSessionRequest(name: name, developerPath: developerPath.map(Path.init), cachePath: cachePath.map(Path.init), inferiorProductsPath: inferiorProductsPath.map(Path.init), environment: environment)) + let response = try await send(request: CreateSessionRequest(name: name, developerPath: developerPath.map(Path.init), resourceSearchPaths: resourceSearchPaths.map(Path.init), cachePath: cachePath.map(Path.init), inferiorProductsPath: inferiorProductsPath.map(Path.init), environment: environment)) let diagnostics = response.diagnostics.map { SwiftBuildMessage.DiagnosticInfo(.init($0, .global)) } if let sessionID = response.sessionID { return (.success(SWBBuildServiceSession(name: name, uid: sessionID, service: self)), diagnostics) diff --git a/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift index 334d02d7..b56966bb 100644 --- a/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift @@ -2302,7 +2302,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { @PluginExtensionSystemActor func pluginSearchPaths() -> [Path] { core.pluginManager.extensions(of: SpecificationsExtensionPoint.self).flatMap { ext in - ext.specificationSearchPaths().compactMap { try? $0.filePath } + ext.specificationSearchPaths(resourceSearchPaths: core.resourceSearchPaths).compactMap { try? $0.filePath } }.sorted() }