Bug 14715 - Outdated sstate used after updated kernel
Summary: Outdated sstate used after updated kernel
Status: RESOLVED INVALID
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-02-08 13:55 UTC by Johannes Schrimpf
Modified: 2022-02-10 15:42 UTC (History)
3 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 Johannes Schrimpf 2022-02-08 13:55:49 UTC
Hi, presumingly after a kernel update, my build fails with:

```
calculate_dependencies_for: Cannot satisfy the following dependencies for packagegroup-be-video:
 * 	kernel-5.10.74+g7ae74dbbe24f * 
```

The strange thing is that the correct kernel version in the same build is `kernel-5.10.74+gaf5aa53b55c8`

It seems the wrong version comes in through the sstate cache. I verified that it happens with a clean tmp directory.

Somehow, bitbake does not seem to understand that the cached package (including a kernel module) was built against another kernel version hash, uses the old sstate and thereby adds a dependency that cannot be resolved.

Regarding my setup, `packagegroup-be-video` includes a package that depends on `kernel-module-imx-gpu-viv` from meta-freescale.

However, when searching my `tmp/work` folder, I find more packages including the wrong hash, f. ex. `perf`, also imported from the sstate cache. The modules built from the kernel recipe directly all seem to have the correct version in the `tmp/work` folder.

I use honister, the latest versions from git.

```
meta                 
meta-poky            
meta-yocto-bsp       = "heads/honister:4d7162798ec19c726877e85509e4c7a99eb6576d"
...[own layers]...
meta-freescale       = "heads/honister:724def083c543489d151b72568d1cbb31d884ee5"
meta-freescale-3rdparty = "heads/honister:155ffd6d7b694d8de76919c25681ecb98882646e"
meta-freescale-distro = "heads/honister:d2e27cc4778663450495a67bfb036cba600cb27a"
meta-swupdate        = "heads/honister:8f5437673629f2d86e2ce7030f753201caae6447"
meta-oe              
meta-filesystems     
meta-multimedia      
meta-networking      
meta-python          
meta-webserver       = "heads/honister:c05ae80ba680887ac924c21536091be7a1173427"
meta-ros-common      
meta-ros1            
meta-ros1-noetic     = "heads/honister:53d3b8f59b1c5d2fbb605db0fe37af996ea63d3b"
```
Comment 1 Johannes Schrimpf 2022-02-08 14:20:33 UTC
After cleaning the sstate cache for those packages and the related folders in `tmp/work` that had references to the wrong version number, I get the same error with a new version string:

```
calculate_dependencies_for: Cannot satisfy the following dependencies for packagegroup-be-video:
 * 	kernel-5.10.74+geac40b789261 * 
```

The correct kernel version in the image is still kernel-5.10.74+gaf5aa53b55c8
Comment 2 Johannes Schrimpf 2022-02-08 16:16:39 UTC
I manages a successful build by:
- Cleaning the sstate of all kernel-related packages and modules
- Deleting the tmp directory (likely enough to delete all folders for relevant packages in the work folder)


Then I manages to reproduce the bug afterwards by:
- Cleaning the sstate cache for kernel-module-imx-gpu-viv
- Deleting the tmp directory
- Building the image

In this setup, kernel-module-imx-gpu-viv gets the wrong version string.
Comment 3 Richard Purdie 2022-02-10 10:58:07 UTC
Unfortunately you're using the freescale layers which do all kinds of weird things with the kernel. We've not seen this with the core yocto project and I suspect this is some issue in those kernel/module recipes. If you can reproduce this without the freescale layers we can look into the issue but right now I think you need to talk to the freescale maintainers about this.
Comment 4 Randy MacLeod 2022-02-10 15:42:39 UTC
Please check with freescale. No on using just oe-core has seen this.