Bug 13749 - Example recipe created with bitbake-layers create-layer doesn't print to stdout
Summary: Example recipe created with bitbake-layers create-layer doesn't print to stdout
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 3.0.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-01-24 11:20 UTC by alan.martinovic
Modified: 2020-01-30 15:36 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
bitbake -e example 2>&1 > bitbake_e_example.output (1002.32 KB, application/octet-stream)
2020-01-24 11:20 UTC, alan.martinovic
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description alan.martinovic 2020-01-24 11:20:50 UTC
Created attachment 4617 [details]
bitbake -e example 2>&1  > bitbake_e_example.output

Running the example recipe create as a result of `bitbake-layers create-layer` doesn't print to stdout even though it has `bb.plain()`.

Steps to reproduce:

```
source oe-init-build-env
bitbake-layers create-layer custom_layer
bitbake-layers add-layer custom_layer
# Make sure the lack of output is not caused because the task was cached
echo 'do_build[nostamp]="1"' >> custom_layer/recipes-example/example/example_0.1.bb
bitbake example
```


Additional findings:

Doing the similar thing with the same bitbake directory but with the https://www.yoctoproject.org/docs/3.0/bitbake-user-manual/bitbake-user-manual.html#the-hello-world-example

results in the bb.plain() to be seen in the output.
Comment 1 alan.martinovic 2020-01-24 12:33:39 UTC
I've tested the exact same steps just with warrior. 
The results are the same.

Also tried running the build task explicitly:
bitbake example -c build

but it didn't make a difference.
Comment 2 alan.martinovic 2020-01-24 12:47:50 UTC
Taking a look at 
tmp/work/i586-poky-linux/example/0.1-r0/temp/
there are no do_build related files.

ll tmp/work/i586-poky-linux/example/0.1-r0/temp/*do_build*
returns nothing.
Comment 3 alan.martinovic 2020-01-25 09:43:36 UTC
The problem seems to be tied only to do_build.
Using do_install with the exact same code prints correctly.


```
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "MIT"

python do_install() {
    bb.plain("***********************************************");
    bb.plain("*                                             *");
    bb.plain("*  Example recipe created by bitbake-layers   *");
    bb.plain("*                                             *");
    bb.plain("***********************************************");
}

do_install[nostamp]="1"
```
Comment 4 Richard Purdie 2020-01-30 15:36:40 UTC
I think this is because do_build is a "noexec" task and hence doesn't execute any task contents. I therefore believe its working as intended.

You could make the bitbake example do the same with:

do_build[noexec] = "1"