Bug 14946 - Image rebuilds with rm_work result in missing license manifests
Summary: Image rebuilds with rm_work result in missing license manifests
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 4.0.4
Hardware: All Multiple
: Medium+ normal
Target Milestone: 6.1 M2
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-10-25 08:25 UTC by Christian Thießen
Modified: 2026-10-21 07:31 UTC (History)
3 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 Christian Thießen 2022-10-25 08:25:10 UTC
See also the previous discussion at https://lists.openembedded.org/g/openembedded-core/topic/94530086 .

Preconditions/Environment
-------------------------
Set up just about any build based on Yocto kirkstone, e.g. core-image-minimal for intel-corei7-64. Add INHERIT+="rm_work" to local.conf.

Triggering Action/Cause
-----------------------
Build the image, then run the build again

Expectation
-----------
After each build, build/tmp/deploy/licenses/${IMAGE}-${MACHINE} contains image_license.manifest, license.manifest and package.manifest.
This is important for CI builds because I need to deploy the image and manifest files to our artifact repository under the same build ID.

Actual Result
-------------
After the rebuild, build/tmp/deploy/licenses/${IMAGE}-${MACHINE} only contains image_license.manifest. license.manifest and package.manifest are mising.

Reproducibility
---------------
5/5

Findings as of now
------------------
The missing files are supposed to be generated by are generated by the image's do_rootfs task (ROOTFS_POSTPROCESS_COMMAND:prepend = "write_package_manifest; license_create_manifest; " in poky/meta/classes/license_image.bbclass).
When rm_work is enabled, bitbake reruns at minimum three tasks: bitbake will rerun three tasks: populate_lic_deploy, rm_work and build. This creates a new build/tmp/deploy/licenses/${IMAGE}-${MACHINE}-<datetime> directory and updates the symlink, but only recreates image_license.manifest in that new directory.

Possible workarounds
--------------------
Force running the do_rootfs task of the image recipe with bitbake -C.
Exclude the image recipe from rm_work using RM_WORK_EXCLUDE.
Always delete the whole /tmp before (CI) builds.

Possible solutions
------------------
Move the manifest creation to a different point in the build process.
Instead of a symlink to timestamped directories, make build/tmp/deploy/licenses/${IMAGE}-${MACHINE} a proper directory containing timestamped files and a non-timestamped symlink to each file, similar to build/tmp/deploy/images/${MACHINE}
Comment 1 Ross Burton 2025-06-11 12:18:09 UTC
I can replicate with walnascar.

Do a build with rm_work and these files exist in deploy:

./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/license.manifest
./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/package.manifest
./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/image_license.manifest

Re-run bitbake:

/licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611121342/image_license.manifest
./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/license.manifest
./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/package.manifest
./licenses/qemuarm64/core-image-minimal-qemuarm64.rootfs-20250611113346/image_license.manifest

The three old files exist, but only one for the new image.
Comment 2 Randy MacLeod 2026-03-03 22:10:19 UTC
Probably still a problem, bump to 6.0-M4.
Comment 3 Randy MacLeod 2026-05-28 13:17:56 UTC
Bulk move of unassigned 6.0-M* bugs to 6.1-M2.