Skip to content

Allow SwiftCompilerMessages with no outputs #2854

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

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Sources/Build/SwiftCompilerOutputParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public struct SwiftCompilerMessage {
public struct BeganInfo {
public let pid: Int
public let inputs: [String]
public let outputs: [Output]
public let outputs: [Output]?
public let commandExecutable: String
public let commandArguments: [String]

public init(
pid: Int,
inputs: [String],
outputs: [Output],
outputs: [Output]?,
commandExecutable: String,
commandArguments: [String]
) {
Expand All @@ -49,7 +49,7 @@ public struct SwiftCompilerMessage {

public struct SkippedInfo {
public let inputs: [String]
public let outputs: [Output]
public let outputs: [Output]?

public init(inputs: [String], outputs: [SwiftCompilerMessage.Kind.Output]) {
self.inputs = inputs
Expand Down
19 changes: 19 additions & 0 deletions Tests/BuildTests/SwiftCompilerOutputParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ class SwiftCompilerOutputParserTests: XCTestCase {
],
"pid": 58776
}
250
{
"kind": "began",
"name": "verify-module-interface",
"inputs": [
"main.swiftinterface"
],
"pid": 31337,
"command_executable": "swift",
"command_arguments" : ["-frontend", "-typecheck-module-from-interface", "main.swiftinterface"]
}
299
{
"kind": "began",
Expand Down Expand Up @@ -108,6 +119,14 @@ class SwiftCompilerOutputParserTests: XCTestCase {
outputs: [.init(
type: "object",
path: "/var/folders/yc/rgflx8m11p5d71k1ydy0l_pr0000gn/T/test2-77d991.o")]))),
SwiftCompilerMessage(
name: "verify-module-interface",
kind: .began(.init(
pid: 31337,
inputs: ["main.swiftinterface"],
outputs: nil,
commandExecutable: "swift",
commandArguments: ["-frontend", "-typecheck-module-from-interface", "main.swiftinterface"]))),
SwiftCompilerMessage(
name: "link",
kind: .began(.init(
Expand Down