Bug 15688 - can't use bbverbnote in rootfs postprocess
Summary: can't use bbverbnote in rootfs postprocess
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.2
Assignee: Yoann Congal
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2024-12-12 06:56 UTC by kweihmann
Modified: 2025-01-20 14:36 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kweihmann 2024-12-12 06:56:51 UTC
foo() {
    bbverbnote "Hello world!!!"
}

ROOTFS_POSTPROCESS_COMMAND:append = " foo;"

in an image recipe gives

DEBUG: Executing shell function foo
| /mnt/path/to/image/workspace/1.0/temp/run.foo.1115655: 154: bbverbnote: not found

Using bbnote or bbwarn or bberror doesn't show this issue
Comment 1 kweihmann 2024-12-12 07:05:43 UTC
Reason might be that https://git.yoctoproject.org/poky/tree/meta/classes-global/logging.bbclass is missing an implementation for that
Comment 2 Randy MacLeod 2024-12-12 15:46:17 UTC
Konrad, 
Can you send a patch to the related list please?
-- YP bug review
Comment 3 Randy MacLeod 2024-12-12 15:46:49 UTC
Confirming that you can work on the bug...
Comment 4 Randy MacLeod 2024-12-17 00:28:59 UTC
Konrad,
I guess you aren't able to work on this issue.
I've CCed Yoann who might take a look when he has time.
Comment 5 Mark 2024-12-28 01:46:44 UTC
Randy, is this a bug? The function will be run as shell, as the error message is reporting. If you want to use verbnote one would need to do something such as (I have not validated the syntax)

ROOTFS_POSTPROCESS_COMMAND += '${@bb.verbnote("Hello world!!!")}'
Comment 6 Yoann Congal 2025-01-09 21:39:12 UTC
(In reply to Mark from comment #5)
> Randy, is this a bug? The function will be run as shell, as the error
> message is reporting. If you want to use verbnote one would need to do
> something such as (I have not validated the syntax)
> 
> ROOTFS_POSTPROCESS_COMMAND += '${@bb.verbnote("Hello world!!!")}'

Hello, this is not the same thing (sorry).
- `${@bb.verbnote("Hello world!!!")}` is evaluated at parse-time
-  a bbverbnote "..." in ROOTFS_POSTPROCESS_COMMAND is intended to be printed at build time (IIRC in the do_rootfs task) and can contain build time info (error code, computed values etc...)

I agree with the original report: this is a real bug (but an easy one to fix)
Comment 7 Mark 2025-01-10 19:39:56 UTC
(In reply to Yoann Congal from comment #6)
> (In reply to Mark from comment #5)
> > Randy, is this a bug? The function will be run as shell, as the error
> > message is reporting. If you want to use verbnote one would need to do
> > something such as (I have not validated the syntax)
> > 
> > ROOTFS_POSTPROCESS_COMMAND += '${@bb.verbnote("Hello world!!!")}'
> 
> Hello, this is not the same thing (sorry).
> - `${@bb.verbnote("Hello world!!!")}` is evaluated at parse-time
> -  a bbverbnote "..." in ROOTFS_POSTPROCESS_COMMAND is intended to be
> printed at build time (IIRC in the do_rootfs task) and can contain build
> time info (error code, computed values etc...)
> 
> I agree with the original report: this is a real bug (but an easy one to fix)

No need to apologize. You are correct about the timing of the evaluation, I had overlooked that.