-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
rdmd.d: Capture stderr when calculating dependencies #469
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @the-horo! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour 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 locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + tools#469" |
rdmd.d
Outdated
File stderrFile; | ||
if (captureStderr) | ||
stderrFile = outputFile; | ||
else | ||
stderrFile = stderr; | ||
auto process = spawnProcess(args, stdin, outputFile, stderrFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto process = spawnProcess(args, stdin, outputFile, captureStderr ? outputFile : stderr);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that having both stdout and stderr be the same file breaks something, see the ubuntu-latest test failure.
As for my tests, when they fail, because they only sometimes fail, they always fail at
Lines 205 to 207 in 1a8c1a9
res = execute(rdmdArgs ~ ["--force", forceSrc]); | |
enforce(res.status == 0, res.output); | |
enforce(res.output.canFind("compile_force_src")); // force will re-compile |
The output has, so far, been
""
. One more reason to postpone this PR.
|
When invoking the compiler to calculate dependencies capture both stdout and stderr since gdc's verbose output goes to stderr. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
CC @ibuclaw |
The tests fail with gdc so I guess not.
Yes, they do, that's too bad a consequence to allow as is. Is it enough if we displayed the collected stderr? I can think of either this or rerunning the failed command without changing how gdc or gdmd work.
Since gdmd is just a wrapper, I don't know how it would be able to split the -v output into legitimate output tied to stdout and error messages displayed on stderr. |
It could pass an internal switch to the command it's wrapping, which redirects these messages to standard output. I think that's what the |
I think we should try to pursue the third option first. If that doesn't work, then I think that would be OK provided that we only do this redirection for GDC. Since we're already parsing the output, we could also re-print all lines that we couldn't parse (and are therefore likely messages intended for the user). |
When invoking the compiler to calculate dependencies capture both stdout and stderr since gdc's verbose output goes to stderr.