Skip to content

Parse compiler messages properly on Windows #118

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 27, 2020

Conversation

egorzhdan
Copy link
Contributor

Currently SwiftPM dumps raw JSON data while compiling on Windows instead of the actual build status. This happens because JSONMessageStreamingParser splits the output lines by \n without taking \r into account on Windows.
After this change the compiler messages are parsed and displayed properly.

Currently SwiftPM dumps raw JSON data while compiling on Windows instead of the actual build status. After this change the compiler messages are parsed and displayed properly.
@egorzhdan
Copy link
Contributor Author

cc @compnerd

@compnerd
Copy link
Member

Thanks for identifying the issue!

What happens if it wants a raw carriage return? I suppose it will be escaped in the JSON right?

@egorzhdan
Copy link
Contributor Author

Yeap, it gets escaped the same way as \n.

@compnerd
Copy link
Member

Hmm, I wonder if there is a way to sink this lower so that when the processing is done, it splits on \r\n and \n.

@compnerd
Copy link
Member

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

It's certainly possible, that would just be a bit more complex. This fix is simple and just works.
I can move the \r handling logic to the parsing stage though, if you think this is hacky.

@neonichu neonichu merged commit 8b60325 into swiftlang:master Aug 27, 2020
@compnerd
Copy link
Member

It definitely would be interesting to know how more complicated it is. If its not very complicated, that definitely would be nicer I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants