Bug 16494

Summary: bitbake-setup fetcher logging is terrible
Product: [Build System, Metadata & Runtime] BitBake Reporter: Richard Purdie <richard.purdie>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: IN PROGRESS REVIEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: adrian.freihofer, alex.kanavin, ccasciato, poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2026-11-11 18:14:30 UTC
$ bitbake-setup --setting default top-dir-prefix /tmp/pokybuild/ --setting default top-dir-name poky-tiny --setting default dl-dir /foobar --setting default common-sstate no --global-settings /tmp/pokybuild/settings.conf init --skip-selection machine --skip-selection distro --setup-dir-name build --non-interactive poky-master poky machine/qemux86-64 distro/poky-tiny
NOTE: Bitbake-setup is using /tmp/pokybuild/poky-tiny as top directory.
/tmp/pokybuild/poky-tiny looks like a new top directory. If you would like to use a different directory, answer "n" below and either:
	1) Change the default bitbake-setup settings:
		bitbake-setup settings set default top-dir-prefix <PATH>
		bitbake-setup settings set default top-dir-name <NAME>
	2) Pass one or more options on the command line to change the top level directory in that invocation only:
		bitbake-setup --setting default top-dir-prefix <PATH> ...
		bitbake-setup --setting default top-dir-name <NAME> ...

A common site.conf file will be created, please check it is correct before running builds
    /tmp/pokybuild/poky-tiny/site.conf

NOTE: Looking up config poky-master in configuration registry
NOTE: Skipping a selection of machine, as requested on command line. The resulting bitbake configuration may require further manual adjustments.
NOTE: Skipping a selection of distro, as requested on command line. The resulting bitbake configuration may require further manual adjustments.
NOTE: Run 'bitbake-setup init --non-interactive poky-master poky' to select this configuration non-interactively.

Initializing a setup directory in
    /tmp/pokybuild/poky-tiny/build
Fetching layer/tool repositories into /tmp/pokybuild/poky-tiny/build/layers
    bitbake
ERROR: cannot access local variable 'lf' where it is not associated with a value


The actual error is that DL_DIR of /foobar is not writable!

I'm filing as the logging output/error is terrible in multiple ways and we should improve this.
Comment 1 Richard Purdie 2026-11-11 18:19:57 UTC
I've sent a fix for the lf not being set issue, but the bigger question is why there isn't any traceback shown here?
Comment 2 Alexander Kanavin 2026-11-11 18:35:58 UTC
At some point it was decided that it's better to show a clean error message contained in the exception, and skip the stack trace that caused it (unless in debug mode):

https://git.openembedded.org/bitbake/commit/?id=9fb6b0011bae34a7c1feb53281e13364d85ddee8

We might want to revisit that idea...
Comment 3 Richard Purdie 2026-11-11 20:25:17 UTC
Copying Adrian, I think we might want to undo this as it is actively breaking usability, I'd rather have the ugly tracebacks to be honest
Comment 4 Randy MacLeod 2026-11-12 15:42:21 UTC
RP has a patch.