From 42330b4dff18931e29865b4e7a5eb957b6058829 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Thu, 18 Feb 2021 12:54:59 -0800 Subject: [PATCH] Defaulting to swift-frontend for querying supported swift-frontend flags. This library is unavailable in some contexts and on some architectures. For now, let's have the swift-frontend flow be the default. --- .../Jobs/EmitSupportedFeaturesJob.swift | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift b/Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift index b48fe3197..eb7d5e55e 100644 --- a/Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift +++ b/Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift @@ -57,19 +57,20 @@ extension Driver { fileSystem: FileSystem, executor: DriverExecutor, env: [String: String]) throws -> Set { - // If libSwiftScan library is present, use it to query - let swiftScanLibPath = try Self.getScanLibPath(of: toolchain, - hostTriple: hostTriple, - env: env) - - if fileSystem.exists(swiftScanLibPath) { - let libSwiftScanInstance = try SwiftScan(dylib: swiftScanLibPath) - if libSwiftScanInstance.canQuerySupportedArguments() { - return try libSwiftScanInstance.querySupportedArguments() - } - } + // TODO: Once we are sure libSwiftScan is deployed across supported platforms and architectures + // we should deploy it here. +// let swiftScanLibPath = try Self.getScanLibPath(of: toolchain, +// hostTriple: hostTriple, +// env: env) +// +// if fileSystem.exists(swiftScanLibPath) { +// let libSwiftScanInstance = try SwiftScan(dylib: swiftScanLibPath) +// if libSwiftScanInstance.canQuerySupportedArguments() { +// return try libSwiftScanInstance.querySupportedArguments() +// } +// } - // Fallback to invoking `swift-frontend -emit-supported-features` + // Invoke `swift-frontend -emit-supported-features` let frontendOverride = try FrontendOverride(&parsedOptions, diagnosticsEngine) frontendOverride.setUpForTargetInfo(toolchain) defer { frontendOverride.setUpForCompilation(toolchain) }