<?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>15798</bug_id>
          
          <creation_ts>2025-03-16 00:12:36 +0000</creation_ts>
          <short_desc>reproducible: in case of an error, the saved log does not contain detailed task log</short_desc>
          <delta_ts>2025-05-18 16:44:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Functional (self) Testing</product>
          <component>oe-selftest</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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yoann Congal">yoann.congal</reporter>
          <assigned_to name="Yoann Congal">yoann.congal</assigned_to>
          <cc>randy.macleod</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>101381</commentid>
    <comment_count>0</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-03-16 00:12:36 +0000</bug_when>
    <thetext>For example: in [0], nodejs fails to build with:
  2025-03-15 07:51:22,878 - oe-selftest - INFO -       ERROR: Logfile of failure stored in: /srv/pokybuild/yocto-worker/reproducible-meta-oe/build/build/build-st-meta-oe/build-st/reproducibleA/tmp/work/core2-64-poky-linux/nodejs/22.13.1/temp/log.do_compile.2854302
  2025-03-15 07:51:22,878 - oe-selftest - INFO -       Log data follows:
  2025-03-15 07:51:22,878 - oe-selftest - INFO -       | DEBUG: Executing python function set_gyp_variables
[...]
  2025-03-15 07:51:22,879 - oe-selftest - INFO -       | ERROR: oe_runmake failed
  2025-03-15 07:51:22,879 - oe-selftest - INFO -       | WARNING: exit code 1 from a shell command.
  2025-03-15 07:51:22,879 - oe-selftest - INFO -       NOTE: recipe nodejs-22.13.1-r0: task do_compile: Failed
  2025-03-15 07:51:22,879 - oe-selftest - INFO -       ERROR: Task (/srv/pokybuild/yocto-worker/reproducible-meta-oe/build/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_22.13.1.bb:do_compile) failed with exit code &apos;1&apos;

But the save logs[1] only contains:
  ERROR: Logfile of failure stored in: /srv/pokybuild/yocto-worker/reproducible-meta-oe/build/build/build-st-meta-oe/build-st/reproducibleA/tmp/work/core2-64-poky-linux/nodejs/22.13.1/temp/log.do_compile.2854302
  NOTE: recipe nodejs-22.13.1-r0: task do_compile: Failed
  ERROR: Task (/srv/pokybuild/yocto-worker/reproducible-meta-oe/build/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_22.13.1.bb:do_compile) failed with exit code &apos;1&apos;

The &quot;Log data follows&quot; is missing and contains precious information.

[0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/36/steps/32/logs/stdio
[1]: https://valkyrie.yocto.io/pub/repro-fail-openembedded/meta-oe/oe-reproducible-20250315-8_7ama2q/bitbake-reproducibleA.log</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101924</commentid>
    <comment_count>1</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-11 08:59:20 +0000</bug_when>
    <thetext>Suspicious code is in https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/ui/knotty.py#n354:
def print_event_log(event, includelogs, loglines, termfilter):
...
        bb.error(&quot;Logfile of failure stored in: %s&quot; % logfile)
        if includelogs and not event.errprinted:
            print(&quot;Log data follows:&quot;)
...
                for line in lines:
                    print(line)

=&gt; print_event_log prints on stdout bypassing the log framework. Refactor this to use the log framework instead?

Note: the commit introducing this function is:
---
commit	24879df071d4803db3d39ae1d5cad852daa92f28
Author :	Paul Eggleton &lt;paul.eggleton@linux.intel.com&gt;  Thu Aug 31 01:30:44 2017
tinfoil: ensure log lines get printed when tasks fail
If a task fails during build_targets(), we need to print out the log
lines as knotty does or the user will be missing information about the
failure.

(This should get some deeper refactoring, but now isn&apos;t the time for
that.)
---
Maybe now is the time for that? ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101959</commentid>
    <comment_count>2</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-14 21:32:20 +0000</bug_when>
    <thetext>Patch sent:
[PATCH] knotty: pass failed task logs through the log infrastructure
https://lists.openembedded.org/g/bitbake-devel/message/17611</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101987</commentid>
    <comment_count>3</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-18 16:44:12 +0000</bug_when>
    <thetext>Fixed in https://git.openembedded.org/bitbake/commit/?id=d3b3ad32da7c7ebf61814fc807f8667a37aa149b
See https://valkyrie.yocto.io/pub/repro-fail-openembedded/meta-python/oe-reproducible-20250517-6z4mvfq6/bitbake-reproducibleA.log for a full error log</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>