Thanks for the information - perhaps this should be added to the commit message?

Does this change discard things that appear on stderr completely, or
does it still go somewhere where it can be seen later?

Alex

On Wed, 29 Jun 2022 at 21:22, Shruthi Ravichandran
<[email protected]> wrote:
>
> Hi Alex,
>
> I've found that some OE commands print an error during cleanup when
> the tmp_dir does not exist and an attempt is made to delete it. I've
> submitted a patch to opkg to fix that.
> Link: 
> https://git.yoctoproject.org/opkg/commit/?id=8dfdda86afd407a66e3dc00a077bdcc8b53d54ea.
> That was the one instance that was causing an issue in our builds.
> There may be other instances that I don't know of. Given that, I think
> the package_manager code should be resilient against any such
> miscellaneous stderr messages, which do not result in the command
> itself failing.
>
> Hope that helps,
> Shruthi
>
> > -----Original Message-----
> > From: Alexander Kanavin <[email protected]>
> > Sent: Tuesday, June 28, 2022 1:33 PM
> > To: Shruthi Ravichandran <[email protected]>
> > Cc: [email protected]
> > Subject: Re: [OE-core][PATCH] package_manager/ipk: do not pipe stderr to 
> > stdout
> >
> > This needs additional justification. What are the error messages, why are 
> > they harmless and why the solution is to suppress them instead of
> > addressing the reasons they appear?
> >
> > Alex
> >
> > On Tue 28. Jun 2022 at 23.13, Shruthi Ravichandran 
> > <[email protected] <mailto:[email protected]> > wrote:
> >
> >
> >       When parsing the output of a command, do not pipe stderr to stdout.
> >       Opkg sometimes prints harmless error messages even when the opkg
> >       command succeeds. When stderr is piped to stdout, these error
> >       messages may clobber the stdout and cause unexpected results while
> >       parsing the output.
> >
> >       Signed-off-by: Shruthi Ravichandran <[email protected] 
> > <mailto:[email protected]> >
> >       ---
> >        meta/lib/oe/package_manager/ipk/__init__.py | 2 +-
> >        1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >       diff --git a/meta/lib/oe/package_manager/ipk/__init__.py 
> > b/meta/lib/oe/package_manager/ipk/__init__.py
> >       index 4cd3963111..d7f3f31853 100644
> >       --- a/meta/lib/oe/package_manager/ipk/__init__.py
> >       +++ b/meta/lib/oe/package_manager/ipk/__init__.py
> >       @@ -103,7 +103,7 @@ class OpkgDpkgPM(PackageManager):
> >                """
> >
> >                try:
> >       -            output = subprocess.check_output(cmd, 
> > stderr=subprocess.STDOUT, shell=True).decode("utf-8")
> >       +            output = subprocess.check_output(cmd, 
> > shell=True).decode("utf-8")
> >                except subprocess.CalledProcessError as e:
> >                    bb.fatal("Unable to list available packages. Command 
> > '%s' "
> >                             "returned %d:\n%s" % (cmd, e.returncode, 
> > e.output.decode("utf-8")))
> >       --
> >       2.20.1
> >
> >
> >       
> >
> >
>
>
> INTERNAL - NI CONFIDENTIAL
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167405): 
https://lists.openembedded.org/g/openembedded-core/message/167405
Mute This Topic: https://lists.openembedded.org/mt/92051989/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to