Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignored symbol graph extraction exit code #7159

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/Commands/Utilities/PluginDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SPMBuildCore

import class TSCBasic.BufferedOutputByteStream
import class TSCBasic.Process
import struct TSCBasic.ProcessResult

final class PluginDelegate: PluginInvocationDelegate {
let swiftTool: SwiftTool
Expand Down Expand Up @@ -376,14 +377,18 @@ final class PluginDelegate: PluginInvocationDelegate {
try swiftTool.fileSystem.removeFileTree(outputDir)

// Run the symbol graph extractor on the target.
try symbolGraphExtractor.extractSymbolGraph(
let result = try symbolGraphExtractor.extractSymbolGraph(
target: target,
buildPlan: try buildSystem.buildPlan,
outputRedirection: .collect,
outputDirectory: outputDir,
verboseOutput: self.swiftTool.logLevel <= .info
)

guard result.exitStatus == .terminated(code: 0) else {
throw ProcessResult.Error.nonZeroExit(result)
}

// Return the results to the plugin.
return PluginInvocationSymbolGraphResult(directoryPath: outputDir.pathString)
}
Expand Down