Bug 16492 - bitbake: write_variables fails on missing build folder
Summary: bitbake: write_variables fails on missing build folder
Status: NEW
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-11-10 13:33 UTC by Mathieu Dubois-Briand
Modified: 2026-11-10 13:33 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

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Dubois-Briand 2026-11-10 13:33:33 UTC
I had a bitbake crash after removing the tmp folder while bitbake-resident was still alive:


> ERROR: Command execution failed: Traceback (most recent call last):
>   File "/home/mathieu/projects/swat/gits/bitbake/lib/bb/command.py", line 127, in runAsyncCommand
>     commandmethod(self.cmds_async, self, options)
>     ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/mathieu/projects/swat/gits/bitbake/lib/bb/command.py", line 644, in buildTargets
>     command.cooker.buildTargets(pkgs_to_build, task)
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
>   File "/home/mathieu/projects/swat/gits/bitbake/lib/bb/cooker.py", line 1588, in buildTargets
>     self.eventlog[2].write_variables()
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
>   File "/home/mathieu/projects/swat/gits/bitbake/lib/bb/cooker.py", line 116, in write_variables
>     with open(self.eventfile, "a") as f:
>          ~~~~^^^^^^^^^^^^^^^^^^^^^
> FileNotFoundError: [Errno 2] No such file or directory: '/home/mathieu/projects/swat/gits/build/tmp/log/eventlog/20261109164837.json'

This can easily be reproduced with:

> export BB_SERVER_TIMEOUT=600
> bitbake zlib-native
> rm -rf tmp/log/eventlog
> bitbake zlib-native

Now, I feel we are missing an mkdir() somewhere, maybe just in write_variables(). But maybe one should not manipulate the tmp folder while bitbake is still alive.