Bug 15641 - BB_CONSOLELOG is overwritten on 2nd+ runs when using memory resident BitBake
Summary: BB_CONSOLELOG is overwritten on 2nd+ runs when using memory resident BitBake
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: 6.1 M4
Assignee: Antonin Godard
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-11-05 15:34 UTC by Yoann Congal
Modified: 2026-06-17 15:24 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yoann Congal 2024-11-05 15:34:38 UTC
When using "memory resident BitBake", the BB_CONSOLELOG is read from config when the server starts but, on the runs after that, any BB_CONSOLELOG config will be overwritten by the value read at the server start.


How to reproduce:

In local.conf
  BB_SERVER_TIMEOUT = "-1"
  BB_CONSOLELOG = "${LOG_DIR}/XXX.log"

Ensure there is no resident bitbake server:
  bitbake --kill-server

Read BB_CONSOLELOG:
  bitbake-getvar BB_CONSOLELOG
  => XXX.log

Change BB_CONSOLELOG:
  BB_CONSOLELOG = "${LOG_DIR}/YYY.log"

Re-read BB_CONSOLELOG:
  bitbake-getvar BB_CONSOLELOG
  => XXX.log
# Here I was expecting YYY.log

Restart bitbake to "fix" this:
  bitbake --kill-server
  bitbake-getvar BB_CONSOLELOG
  => YYY.log


Note: this may be by design, the code is in
https://git.openembedded.org/bitbake/tree/lib/bb/cooker.py#n290:
        if consolelog:
            self.data.setVar("BB_CONSOLELOG", consolelog)

In any case, this behavior should be documented
Comment 1 Randy MacLeod 2024-11-07 15:37:32 UTC
This is by design so that failures, when disconnected, go somewhere.
Comment 2 Antonin Godard 2025-06-06 07:45:01 UTC
Bulk move of bugs I am assigned to from Milestone 5.2 to 5.3M1.
Comment 3 Antonin Godard 2026-06-09 09:06:55 UTC
Yoann, I was reading this and was wondering how you actually start a "memory resident BitBake". I tried starting bitbake with --server-only but it eventually dies. Is there a way to have the bitbake server run permanently?
Comment 4 Yoann Congal 2026-06-09 12:18:14 UTC
(In reply to Antonin Godard from comment #3)
> Yoann, I was reading this and was wondering how you actually start a "memory
> resident BitBake". I tried starting bitbake with --server-only but it
> eventually dies. Is there a way to have the bitbake server run permanently?

I don't play with "--server-only".
For me "memory resident BitBake" is a normal bitbake run with BB_SERVER_TIMEOUT != 0

Use "-1" for infinite timeout but I usually set it to 60 to save on parsing time in bitbake call sequence but not leave idle bb processes too long. 

See: https://docs.yoctoproject.org/ref-manual/variables.html#term-BB_SERVER_TIMEOUT
Comment 5 Antonin Godard 2026-06-10 08:30:08 UTC
Hi Yoann, I see thanks, I was able to reproduce the issue. There's also the -T parameter for controlling the timeout FWIW. I just sent a patch to document this behavior :)
https://lore.kernel.org/r/20260610-bb-console-log-persistent-v1-1-5430d24061c3@bootlin.com