Bug 15688

Summary: can't use bbverbnote in rootfs postprocess
Product: [Build System, Metadata & Runtime] BitBake Reporter: kweihmann
Component: bitbakeAssignee: Yoann Congal <yoann.congal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: mark.asselstine, poky.bs.watcher, poky.watcher, randy.macleod, yoann.congal
Version: unspecified   
Target Milestone: 5.2   
Hardware: x86   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

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.