Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

direct stderr output to stderr again #400

Closed
wants to merge 2 commits into from

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented Sep 5, 2016

Fix for #396.

@@ -158,6 +158,8 @@ def prepare_arguments(parser):
help='Print output from commands in ordered blocks once the command finishes.')
add('--interleave-output', '-i', action='store_true', default=False,
help='Prevents ordering of command output when multiple commands are running at the same time.')
add('--split-stderr', '-e', action='store_false', dest='merge_stderr_into_stdout', default=True,
help='Direct stderr output to stderr again, instead of merging it with stdout (which is the default)')
Copy link
Member

Choose a reason for hiding this comment

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

The help should maybe not contain the "again"?

@NikolausDemmel
Copy link
Member

NikolausDemmel commented Sep 10, 2016

I notice that when running catkin build -v -j1 I get the output from stdout not continuously but all in one go once it is finished (for each build stage). I'm not sure if that is supposed to be that way or not, but in any case, how does that play together with this addition?

Would I get the full output of stderr and stdout interleaved correctly, or would I get them as two blocks one after another and not interleaved when I run with the added option to split stdout and stderr?

@rhaschke
Copy link
Contributor Author

I notice that when running catkin build -v -j1 I get the output from stdout not continuously.

I guess, this is intended. Otherwise output from different jobs might be interleaved. You can enforce interleaved output with option --interleave-output. I'm not sure, catkin automatically evaluates -j1 to modify it's output mode.

Would I get the full output of stderr and stdout interleaved correctly, or would I get them as two blocks one after another and not interleaved when I run with the added option to split stdout and stderr?

Didn't tried this, yet. In any case, the actual output you will see strongly depends on the buffering mode that is performed on stdout/stderr. By default stdout is buffered, while stderr is not, which will mix up the actual output!

@wjwwood
Copy link
Member

wjwwood commented Jan 11, 2017

@NikolausDemmel You would need to use -i if you wanted the output from each build command to "stream" to the screen, otherwise it will just print in blocks as each step finishes.

@NikolausDemmel
Copy link
Member

Thanks for the hints. I wasn't actually aware of that flag.

@wjwwood
Copy link
Member

wjwwood commented Jan 11, 2017

Oh and you don't need the -i if you use -p1. Basically, -p1 ensures only one process would be printing at a time and therefore it is safe to print immediately without a prefix. The -i is designed for when you have multiple processes in flight and you need to prefix them with the package name (and stage I think) so that you can disambiguate what came from where when they interleave.

@wjwwood
Copy link
Member

wjwwood commented Jan 11, 2017

Looking at this now, is there any benefit to outputting the error to stdout? It is already being captured separately, this only affects the printing, and so it shouldn't affect the output ordering. A calling program could always pipe the stderr of catkin build to stdout if they wished. I'm trying to come up with a reason that catkin build should need to do it itself.

@jbohren I imagine you're super busy at your new gig (congrats btw 😄), but perhaps you could give your perspective on why errors currently go to stdout in the first place?

I'm inclined to drop the option and just output errors to stderr always.

@wjwwood
Copy link
Member

wjwwood commented Jan 12, 2017

I created #424 to replace this one (could not push here), but I kept the commits from this pr. Thanks for pushing the initial pr @rhaschke.

@wjwwood wjwwood closed this Jan 12, 2017
@rhaschke rhaschke deleted the fix-#396 branch January 31, 2017 08:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants