-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
SwiftPM outputs raw diagnostics from SwiftDriver without trailing newlines [5968] #5987
Merged
abertelrud
merged 1 commit into
swiftlang:main
from
abertelrud:eng/103608636-missing-newline-after-swift-driver-diagnostics
Dec 22, 2022
Merged
SwiftPM outputs raw diagnostics from SwiftDriver without trailing newlines [5968] #5987
abertelrud
merged 1 commit into
swiftlang:main
from
abertelrud:eng/103608636-missing-newline-after-swift-driver-diagnostics
Dec 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please smoke test |
tomerd
approved these changes
Dec 21, 2022
neonichu
approved these changes
Dec 21, 2022
abertelrud
force-pushed
the
eng/103608636-missing-newline-after-swift-driver-diagnostics
branch
from
December 21, 2022 23:08
c93d9a0
to
886c299
Compare
@swift-ci please smoke test |
abertelrud
force-pushed
the
eng/103608636-missing-newline-after-swift-driver-diagnostics
branch
from
December 21, 2022 23:09
886c299
to
642ea4e
Compare
@swift-ci please smoke test |
…lines 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#5968 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 a newline to the raw driver output, since the logic that parses JSON splits by newlines, so we won't find any terminating newlines that shouldn't be on the string. Note that we do not add newlines to the output coming from messages from the compiler frontend, since that output already has trailing newlines. So in essence this change makes the `.unparsableOutput()` case the same as the cases of regular output, from a newline perspective. rdar://103608636
abertelrud
force-pushed
the
eng/103608636-missing-newline-after-swift-driver-diagnostics
branch
from
December 22, 2022 01:43
642ea4e
to
d265d90
Compare
@swift-ci please smoke test |
abertelrud
added a commit
to abertelrud/swift-package-manager
that referenced
this pull request
Dec 22, 2022
…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)
This was referenced Dec 22, 2022
abertelrud
deleted the
eng/103608636-missing-newline-after-swift-driver-diagnostics
branch
December 22, 2022 18:59
abertelrud
added a commit
that referenced
this pull request
Jan 3, 2023
…ng newlines (#5987) (#5996) 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 #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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #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.
Modifications:
Result:
Raw output from the Swift Driver has trailing newlines.
rdar://103608636