Created attachment 5218 [details] Recipes to reproduce the issue (build `component` first, then update PKGV in `dep3` and rebuild `component`) In some scenarios, including the populate_sysroot unihash is not sufficient to trigger a rebuild when a dependency changes (e.g., when only the PKGV of a package changes). One such scenario is +---------------+ | | | Component +----------+ | | | +-------+-------+ | | | DEPENDS | | | v | +---------------+ | | | | | Dependency 1 | RDEPENDS | | | +-------+-------+ | | | DEPENDS | | | v | +---------------+ | | | | | Dependency 2 | | | | | +-------+-------+ | | | DEPENDS | | | v | +---------------+ | | | | | Dependency 3 |<---------+ | | +---------------+ i.e., a dependency chain where a component has a runtime dependency to a transitive dependency which in turn is not depended upon by its intermediary. Consider the case where only the PKGV of "Dependency 3” changes thus resulting in a new `package` and `packagedata` unihash. This will invalidate "Dependency 2”’s `package` task hash and force its reexecution. However, as "Dependency 2” does not have a runtime dependency on "Dependency 3”, the output generated by the task will be equivalent and the unihash will be set to the one before the change. This in turn means that “Dependency 1”'s packagedata unihash will get rewritten to the original value. As “Component"'s `package` task only has a dependency to "Dependency 1”'s `packagedata` task it will then get reused from cache leading to error messages such as * Solver encountered 1 problem(s): * Problem 1/1: * - conflicting requests * - nothing provides Dependency 3 >= x.y.z needed by Component * * Solution 1: * - do not ask to install a package providing Component when building an image containing "Component". This issue could be fixed by making `Dependency 3`'s `packagedata` unihash part of the outhash of all dependents (similarly to what's done for `do_populate_sysroot` in `staging.bbclass`). However, this is would be fairly invasive and eliminate hash equivalence hits when the component does not have a dependency on the changed dependency after all. An improved approach to this would be to make recursive dependencies part of the task hash calculation (similar to `recrdeptask` but only for build time task dependencies). This would allow hash equivalence to continue to work correctly while still requiring a rebuild whenever the package data of a recursive dependency changes. A reproducer of this issue is attached to this issue. The issue can be replicated by first building `component`. Once done the `PKGV` of `dep3` shall be changed and `component` shall be rebuilt. Checking the logs / produced packages will then show that `component` continues to RDEPEND on the old version of `dep3` rather than the updated `PKGV`.