Bitbake: "The metadata is not deterministic and this needs to be fixed"

Konstantin Shemyak picture Konstantin Shemyak · Feb 13, 2018 · Viewed 7.9k times · Source

I'm building a Bitbake recipe and getting the following error message:

ERROR: When reparsing virtual:native:/path/to/poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb.do_populate_cve_db, the basehash value changed from 0b637979bcb5db4263f9ed97497a6330 to bcd28a5efe646ed4d327fefa349f889c. The metadata is not deterministic and this needs to be fixed.

This reproduces in a clean build (after bitbake -c cleanall -c cleansstate <recipe>).

What is the reason for this error? The recipe has not been modified from the upstream version.

Answer

Sergio picture Sergio · May 24, 2018

The following is the yocto patch that adds this diagnostic message https://patchwork.openembedded.org/patch/133517/

Here is the commit message, explaining its reasons and a possible way to get further details for the problem:

Bitbake can parse metadata in the cooker and in the worker during builds. If the metadata isn't deterministic, it can change between these two parses and this confuses things a lot. It turns out to be hard to debug these issues currently.

This patch ensures the basehashes from the original parsing are passed into the workers and that these are checked when reparsing for consistency. The user is shown an error message if inconsistencies are found.

There is debug code in siggen.py (see the "Slow but can be useful for debugging mismatched basehashes" commented code), we don't enable this by default due to performance issues. If you run into this message, enable this code and you will find "sigbasedata" files in tmp/stamps which should correspond to the hashes shown in this error message. bitbake-diffsigs on the files should show which variables are changing.

Signed-off-by: Richard Purdie