[4.2] [BatchMode] <rdar://39981525> Emit parseable output for each job, using quasi-PIDs. #16546
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.
Cherry-pick of #16492 to swift-4.2-branch. Original description follows:
Due to a variety of suboptimal UI in Xcode it's better to emit parseable output from a batch mode job that pretends to be the sequence of constituent jobs in the batch, rather than a single message for the entire batch. In order to do this without breaking things, the "pid" field in messages needs to get its semantics very slightly bent to accept negative made-up values (I'm calling them "quasi-PIDs" here) in place of real PIDs.
I've tested this on Xcode and it behaves a fair bit better than before, in terms of relating diagnostics to the correct file and displaying meaningful output and so forth. Not exactly thrilled with it but the alternatives seem worse.
rdar://40166873