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

[build.d] Print stdout for dmd #11352

Closed
wants to merge 1 commit into from
Closed

Conversation

wilzbach
Copy link
Member

CC @andralex

Downside is that it prints the TLS warning twice now. Maybe only in verbose mode?

>  ./build.d
(TX) DMD_CONF
(DC) BACKEND
(DC) LEXER
[lexer] /usr/include/dlang/dmd/core/exception.d(631): `_store` is thread local
(DC) DMD
[dmd] /usr/include/dlang/dmd/core/exception.d(631): `_store` is thread local
Success

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11352"

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure - that prints stderr not stdout, right?

if (output.length > 0) {
auto ruleName = name.length ? name : "log";
// add [<name>] prefix to all log messages
output.splitter(newline).map!(e => "[" ~ ruleName ~ "] " ~ e).joiner(newline).writeln;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
output.splitter(newline).map!(e => "[" ~ ruleName ~ "] " ~ e).joiner(newline).writeln;
output.splitter(newline).each!(ln => writeln('[', ruleName, "] ", ln));

is simpler I guess

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This risks interleaving with other log messages from other processes (build.d might executes multiple dependencies at the same time).

@wilzbach
Copy link
Member Author

Just making sure - that prints stderr not stdout, right?

It prints both - https://dlang.org/phobos/std_process.html#.execute

@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Jul 2, 2020

Not sure I like this special case, I would rather make the following changes:

  1. Always print the entire output in verbose mode.
  2. Only print stderr in default mode
    This could be achieved by either passing Config.stderrPassThrough to execute(allthough this would prevent a prefix) or using pipeProcess directly.

@wilzbach
Copy link
Member Author

Closing in favor of #11641

@wilzbach wilzbach closed this Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants