Skip to content

Commit a63f9c8

Browse files
authored
Revert "dump-symbol-graph: add support for -emit-extension-block-symbols and -omit-extension-block-symbols flags (#5892)"
This reverts commit 5e7063a.
1 parent 5e7063a commit a63f9c8

File tree

6 files changed

+2
-33
lines changed

6 files changed

+2
-33
lines changed

Sources/Commands/PackageTools/DumpCommands.swift

-10
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ struct DumpSymbolGraph: SwiftCommand {
3939

4040
@Flag(help: "Add symbols with SPI information to the symbol graph.")
4141
var includeSPISymbols = false
42-
43-
@Flag(help: "Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.")
44-
var extensionBlockSymbolBehavior: ExtensionBlockSymbolBehavior = .omitExtensionBlockSymbols
4542

4643
func run(_ swiftTool: SwiftTool) throws {
4744
// Build the current package.
@@ -54,12 +51,10 @@ struct DumpSymbolGraph: SwiftCommand {
5451
let symbolGraphExtractor = try SymbolGraphExtract(
5552
fileSystem: swiftTool.fileSystem,
5653
tool: swiftTool.getDestinationToolchain().getSymbolGraphExtract(),
57-
observabilityScope: swiftTool.observabilityScope,
5854
skipSynthesizedMembers: skipSynthesizedMembers,
5955
minimumAccessLevel: minimumAccessLevel,
6056
skipInheritedDocs: skipInheritedDocs,
6157
includeSPISymbols: includeSPISymbols,
62-
emitExtensionBlockSymbols: extensionBlockSymbolBehavior == .emitExtensionBlockSymbols,
6358
outputFormat: .json(pretty: prettyPrint)
6459
)
6560

@@ -81,11 +76,6 @@ struct DumpSymbolGraph: SwiftCommand {
8176
}
8277
}
8378

84-
enum ExtensionBlockSymbolBehavior: String, EnumerableFlag {
85-
case emitExtensionBlockSymbols
86-
case omitExtensionBlockSymbols
87-
}
88-
8979
struct DumpPackage: SwiftCommand {
9080
static let configuration = CommandConfiguration(
9181
abstract: "Print parsed Package.swift as JSON")

Sources/Commands/Utilities/PluginDelegate.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ final class PluginDelegate: PluginInvocationDelegate {
338338
// Configure the symbol graph extractor.
339339
var symbolGraphExtractor = try SymbolGraphExtract(
340340
fileSystem: swiftTool.fileSystem,
341-
tool: swiftTool.getDestinationToolchain().getSymbolGraphExtract(),
342-
observabilityScope: swiftTool.observabilityScope
341+
tool: swiftTool.getDestinationToolchain().getSymbolGraphExtract()
343342
)
344343
symbolGraphExtractor.skipSynthesizedMembers = !options.includeSynthesized
345344
switch options.minimumAccessLevel {
@@ -356,7 +355,6 @@ final class PluginDelegate: PluginInvocationDelegate {
356355
}
357356
symbolGraphExtractor.skipInheritedDocs = true
358357
symbolGraphExtractor.includeSPISymbols = options.includeSPI
359-
symbolGraphExtractor.emitExtensionBlockSymbols = options.emitExtensionBlocks
360358

361359
// Determine the output directory, and remove any old version if it already exists.
362360
guard let package = packageGraph.package(for: target) else {

Sources/Commands/Utilities/SymbolGraphExtract.swift

-11
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@ import PackageGraph
1616
import PackageModel
1717
import SPMBuildCore
1818
import TSCBasic
19-
import DriverSupport
2019

2120
/// A wrapper for swift-symbolgraph-extract tool.
2221
public struct SymbolGraphExtract {
2322
let fileSystem: FileSystem
2423
let tool: AbsolutePath
25-
let observabilityScope: ObservabilityScope
2624

2725
var skipSynthesizedMembers = false
2826
var minimumAccessLevel = AccessLevel.public
2927
var skipInheritedDocs = false
3028
var includeSPISymbols = false
31-
var emitExtensionBlockSymbols = false
3229
var outputFormat = OutputFormat.json(pretty: false)
3330

3431
/// Access control levels.
@@ -73,14 +70,6 @@ public struct SymbolGraphExtract {
7370
if includeSPISymbols {
7471
commandLine += ["-include-spi-symbols"]
7572
}
76-
77-
let extensionBlockSymbolsFlag = emitExtensionBlockSymbols ? "-emit-extension-block-symbols" : "-omit-extension-block-symbols"
78-
if DriverSupport.checkSupportedFrontendFlags(flags: [extensionBlockSymbolsFlag.trimmingCharacters(in: ["-"])], fileSystem: fileSystem) {
79-
commandLine += [extensionBlockSymbolsFlag]
80-
} else {
81-
observabilityScope.emit(warning: "dropped \(extensionBlockSymbolsFlag) flag because it is not supported by this compiler version")
82-
}
83-
8473
switch outputFormat {
8574
case .json(let pretty):
8675
if pretty {

Sources/PackagePlugin/PackageManagerProxy.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,11 @@ public struct PackageManager {
229229

230230
/// Whether to include symbols marked as SPI.
231231
public var includeSPI: Bool
232-
233-
/// Whether to emit symbols for extensions to external types.
234-
public var emitExtensionBlocks: Bool
235232

236-
public init(minimumAccessLevel: AccessLevel = .public, includeSynthesized: Bool = false, includeSPI: Bool = false, emitExtensionBlocks: Bool = false) {
233+
public init(minimumAccessLevel: AccessLevel = .public, includeSynthesized: Bool = false, includeSPI: Bool = false) {
237234
self.minimumAccessLevel = minimumAccessLevel
238235
self.includeSynthesized = includeSynthesized
239236
self.includeSPI = includeSPI
240-
self.emitExtensionBlocks = emitExtensionBlocks
241237
}
242238
}
243239

@@ -414,7 +410,6 @@ fileprivate extension PluginToHostMessage.SymbolGraphOptions {
414410
self.minimumAccessLevel = .init(options.minimumAccessLevel)
415411
self.includeSynthesized = options.includeSynthesized
416412
self.includeSPI = options.includeSPI
417-
self.emitExtensionBlocks = options.emitExtensionBlocks
418413
}
419414
}
420415

Sources/PackagePlugin/PluginMessages.swift

-1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,5 @@ enum PluginToHostMessage: Codable {
316316
}
317317
var includeSynthesized: Bool
318318
var includeSPI: Bool
319-
var emitExtensionBlocks: Bool
320319
}
321320
}

Sources/SPMBuildCore/PluginInvocation.swift

-2
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@ public struct PluginInvocationSymbolGraphOptions {
697697
}
698698
public var includeSynthesized: Bool
699699
public var includeSPI: Bool
700-
public var emitExtensionBlocks: Bool
701700
}
702701

703702
public struct PluginInvocationSymbolGraphResult {
@@ -958,7 +957,6 @@ fileprivate extension PluginInvocationSymbolGraphOptions {
958957
self.minimumAccessLevel = .init(options.minimumAccessLevel)
959958
self.includeSynthesized = options.includeSynthesized
960959
self.includeSPI = options.includeSPI
961-
self.emitExtensionBlocks = options.emitExtensionBlocks
962960
}
963961
}
964962

0 commit comments

Comments
 (0)