<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11275</bug_id>
          
          <creation_ts>2017-03-31 09:56:45 +0000</creation_ts>
          <short_desc>tinfoil: some output gets duplicated</short_desc>
          <delta_ts>2017-09-01 00:10:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Backport to 2.3.1 ?</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71950</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-31 09:56:45 +0000</bug_when>
    <thetext>Output produced by the bitbake server (for example, bb.note() messages) gets printed twice in a tinfoil application, even with current bitbake master-next.

Example application &quot;parse-recipes.py&quot;:

#!/usr/bin/python3

import os
import sys
import logging

# Allow importing lib modules
lib_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + &apos;/../lib&apos;)
sys.path.insert(0, lib_path)

# look for bitbake/bin dir in PATH
bitbakepath = None
for pth in os.environ[&apos;PATH&apos;].split(&apos;:&apos;):
    if os.path.exists(os.path.join(pth, &apos;../lib/bb&apos;)):
        bitbakepath = os.path.abspath(os.path.join(pth, &apos;..&apos;))
        break
if bitbakepath:
    sys.path.insert(0, bitbakepath + &apos;/lib&apos;)
else:
    print(&quot;ERROR: bitbake not found in PATH. This script must be called after setting up a bitbake build environment.&quot;,
          file=sys.stderr)
    exit(1)

import bb.tinfoil
import bb
with bb.tinfoil.Tinfoil() as tinfoil:
    # Increase logging from tinfoil and use the logger.
    logger = tinfoil.logger
    tinfoil.logger.setLevel(logging.INFO)
    # Both of these messages appear only once.
    logger.info(&apos;logger.info: foo&apos;)
    bb.note(&apos;bb.note: bar&apos;)
    # But any bb.note or bb.warn from a recipe appears twice.
    tinfoil.prepare(config_only=False)

Modified OE-core to trigger a message:

diff --git a/meta/recipes-extended/ethtool/ethtool_4.8.bb b/meta/recipes-extended/ethtool/ethtool_4.8.bb
index 4ca88d766c6..ef153164335 100644
--- a/meta/recipes-extended/ethtool/ethtool_4.8.bb
+++ b/meta/recipes-extended/ethtool/ethtool_4.8.bb
@@ -28,3 +28,6 @@ do_install_ptest () {
    install ${B}/ethtool             ${D}${PTEST_PATH}/ethtool
    sed -i &apos;s/^Makefile/_Makefile/&apos;  ${D}${PTEST_PATH}/Makefile
 }
+python () {
+    bb.note(&apos;ethtool getting parsed&apos;)
+}

Output okay in bitbake, not okay in the test app:

$ rm -rf cache/ tmp-glibc/cache/
$ parse-recipes.py
NOTE: logger.info: foo
NOTE: bb.note: bar
NOTE: ethtool getting parsed###########################################################################                 | ETA:  0:00:03
NOTE: /fast/work/intel-iot-refkit/openembedded-core/meta/recipes-extended/ethtool/ethtool_4.8.bb: ethtool getting parsed
NOTE: /fast/work/intel-iot-refkit/openembedded-core/meta/recipes-extended/ethtool/ethtool_4.8.bb: ethtool getting parsed
Parsing recipes: 100% |#################################################################################################| Time: 0:00:23
Parsing of 2174 .bb files complete (0 cached, 2174 parsed). 3017 targets, 455 skipped, 0 masked, 0 errors.

Summary: There was 1 WARNING message shown.

$ rm -rf cache/ tmp-glibc/cache/
$ bitbake -g ethtool
NOTE: /fast/work/intel-iot-refkit/openembedded-core/meta/recipes-extended/ethtool/ethtool_4.8.bb: ethtool getting parsed| ETA:  0:00:03
Parsing recipes: 100% |#################################################################################################| Time: 0:00:23
Parsing of 2174 .bb files complete (0 cached, 2174 parsed). 3017 targets, 455 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: PN build list saved to &apos;pn-buildlist&apos;
NOTE: Task dependencies saved to &apos;task-depends.dot&apos;
NOTE: Flatened recipe dependencies saved to &apos;recipe-depends.dot&apos;

Summary: There was 1 WARNING message shown.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71951</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-31 09:59:14 +0000</bug_when>
    <thetext>Note that the &quot;ethtool getting parsed&quot; actually gets printed three times, once without the &quot;.../ethtool/ethtool_4.8.bb: &quot; prefix, twice with it.

The one without prefix overlaps poorly with the progress bar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71952</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-03-31 10:11:12 +0000</bug_when>
    <thetext>Another side-effect of my recent change, I&apos;m afraid :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73288</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-05-16 22:01:01 +0000</bug_when>
    <thetext>To give a more complete explanation, this was a side-effect of http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=542eb4731cd491c23e30689e5c8c0da91ba4bb44. At the moment I&apos;m not sure of a solution that allows us to see the timeout messages without duplicating others, but I&apos;m working on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73990</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-06-12 15:34:18 +0000</bug_when>
    <thetext>Fixes merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d44d5a2e79affce73750561c1e1ca58f8fcb7bb1
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=55c4781cdef853480d9e9d94f5aee26c512777c3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76072</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-23 03:46:29 +0000</bug_when>
    <thetext>This issue has unfortunately returned - after the recent server rework we again saw messages going missing so I had to revert d44d5a2e79affce73750561c1e1ca58f8fcb7bb1. I am currently testing a fix which should be ready for M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76432</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-09-01 00:10:53 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6ef0a567706be050c65efcebf444510c0969ce89</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>