Skip to content

Build: adjust the BuildSystemDelegate hander #4192

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 3 commits into from
Mar 4, 2022

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Mar 3, 2022

llbuild does not make guarantees that the output from subcommands are
emitted in complete buffers. This shows up particularly well on
Windows. clang will emit diagnostics which get read in different
chunks. By emitting these eagerly we would print partial messages which
would leave the terminal in the improper state due to the message not
being complete. With multiple parallel threads writing the messages
partially, we would get splits in the message that would yield
unreadable messages.

Switch to a buffering approach, buffering the entire content until the
command exits. At that time we can emit the complete message in a
"single" write (which is locked). This ensures that the output is no
longer partially emitted and corrects the rendering with the animated
emission on Windows.

[One line description of your change]

Motivation:

[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]

Modifications:

[Describe the modifications you've done.]

Result:

[After your change, what will change.]

@compnerd compnerd marked this pull request as draft March 3, 2022 18:02
llbuild does not make guarantees that the output from subcommands are
emitted in complete buffers.  This shows up particularly well on
Windows.  clang will emit diagnostics which get read in different
chunks.  By emitting these eagerly we would print partial messages which
would leave the terminal in the improper state due to the message not
being complete.  With multiple parallel threads writing the messages
partially, we would get splits in the message that would yield
unreadable messages.

Switch to a buffering approach, buffering the entire content until the
command exits.  At that time we can emit the complete message in a
"single" write (which is locked).  This ensures that the output is no
longer partially emitted and corrects the rendering with the animated
emission on Windows.
@compnerd compnerd marked this pull request as ready for review March 3, 2022 18:18
@compnerd
Copy link
Member Author

compnerd commented Mar 3, 2022

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Mar 4, 2022

@swift-ci please smoke test

@tomerd
Copy link
Contributor

tomerd commented Mar 4, 2022

this seems fine to me. @abertelrud ?

@abertelrud
Copy link
Contributor

this seems fine to me. @abertelrud ?

Absolutely, makes sense to me as well. We should probably audit some of the other callbacks but that can be done as follow-on tasks. Thanks for this fix @compnerd!

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