Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/2] commands: send stderr to a new pipe
Date: Thu, 22 Jun 2017 21:35:01 +0200	[thread overview]
Message-ID: <1498160101.22706.53.camel@intel.com> (raw)
In-Reply-To: <1498150775.24449.120.camel@linuxfoundation.org>

On Thu, 2017-06-22 at 17:59 +0100, Richard Purdie wrote:
> The problem here is that stdout and stderr are being mixed and that
> mixing is not accounting for newlines. bitbake itself does print
> different messages to both. The mixing depends on kernel page size and
> when the buffers are flushed.

It's a single process were stdout and stderr share the same pipe.
Caching outside of the kernel may be to blame, but kernel behavior
should not have an effect.

My guess is that "Parsing recipes..WARNING:
File /etc/selftest-replaceme-patched..." comes from printing "Parsing
recipes.." to stdout without newline and then printing "WARNING:
File ..." to stderr.

I don't know whether Python logging can coordinate two streams. The
logic would have to be that when stdout/stderr go to the same stream and
the last output to stdout did not end in a new line and there's a
message to be printed on stderr, a newline should be inserted first.

> The key thing I'm not sure about from reading the bug is whether this
> output is from the same bitbake process or different ones?

It's from a single "devtool" invocation, so whatever goes wrong with
output handling is in that process.

> I can think of three things we can do here:
> 
> a) Add some flush calls somewhere assuming this is different calls.
> That somehow seems unlikely
> b) Keep stdout and stderr separate as per Leo's change

That helps testing, but actual users will still see confusing output. So
I would prefer to enhance output handling. However, it's probably more
complicated than running tests with split output.

> c) Have a command version which merges stdout and stderr respecting
> newlines. I suspect this happens on a console but likely not on inter
> process pipes...

In this case it happens for a pipe.

> It does sound like we need to answer some questions on what exactly is
> happening before we can know which solution(s) might work.

Yes.

And please, whatever we do, let's not change oeqa in a way that breaks
existing tests, whether they are in OE-core or some other layer.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





  reply	other threads:[~2017-06-22 19:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 14:39 [PATCH 1/2] commands: send stderr to a new pipe leonardo.sandoval.gonzalez
2017-06-19 14:39 ` [PATCH 2/2] selftest/cases: use stderr data when querying for errors leonardo.sandoval.gonzalez
2017-06-21 10:56 ` [PATCH 1/2] commands: send stderr to a new pipe Jussi Kukkonen
2017-06-21 11:08   ` Burton, Ross
2017-06-21 15:01   ` Leonardo Sandoval
2017-06-22 14:17 ` Patrick Ohly
2017-06-22 14:58   ` Leonardo Sandoval
2017-06-22 15:14     ` Patrick Ohly
2017-06-22 15:37       ` Leonardo Sandoval
2017-06-22 15:59         ` Patrick Ohly
2017-06-22 16:18           ` Leonardo Sandoval
2017-06-22 17:39             ` Patrick Ohly
2017-06-22 20:47               ` Leonardo Sandoval
2017-06-22 21:07                 ` Patrick Ohly
2017-06-22 21:27                   ` Leonardo Sandoval
2017-06-22 16:59           ` Richard Purdie
2017-06-22 19:35             ` Patrick Ohly [this message]
2017-06-22 20:51               ` Leonardo Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498160101.22706.53.camel@intel.com \
    --to=patrick.ohly@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox