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

[5.8] SwiftPM outputs raw diagnostics from SwiftDriver without trailing newlines #5996

Conversation

abertelrud
Copy link
Contributor

This is the 5.8 nomination of #5987.
rdar://103608636
(cherry picked from commit 14d05cc)

…ng newlines (swiftlang#5987)

SwiftPM uses the Swift Driver's `-parseable-output` flag to get a sequence of length-prefixed JSON-encoded messages that it can read.  Unfortunately the Swift Driver doesn't JSON-encode its own diagnostics, leading to things like swiftlang#5968.

I filed swiftlang/swift-driver#1241 on the Swift Driver to get it to encode its JSON messages, but meanwhile, it turns out that we can fairly easily fix the fallback logic that SwiftPM uses when it emits raw output.  It was simply missing a newline.  It's safe to always add one, since the logic that parses JSON splits by newlines, so we won't find any terminating newlines.

rdar://103608636
(cherry picked from commit 14d05cc)
@abertelrud abertelrud added the swift 5.8 This PR targets the 5.8 branch label Dec 22, 2022
@abertelrud abertelrud self-assigned this Dec 22, 2022
@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud abertelrud enabled auto-merge (squash) December 22, 2022 18:41
@abertelrud
Copy link
Contributor Author

<unknown>:0: note: IO failure on output stream: No space left on device
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud abertelrud merged commit 596ec3f into swiftlang:release/5.8 Jan 3, 2023
@abertelrud abertelrud deleted the eng/5.8-missing-newline-from-swift-driver-output branch January 3, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 5.8 This PR targets the 5.8 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants