| Summary: | Non-deterministic Metadata for SDK build | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Frieder Schrempf <frieder.schrempf> |
| Component: | core | Assignee: | Sakib Sajal <sakib.sajal> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | frieder.schrempf, meta.mr.watcher, meta.watcher, randy.macleod |
| Version: | 3.1.14 | ||
| Target Milestone: | 4.2 M1 | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Sakib, Check if this is reproducible. If it's not (as we suspect), we'll need more info about how to reproduce the issue. YP Triage I was unable to reproduce the issue, steps provided below.
using poky at:
commit 7e10918724646a86afd4739ea136dac63d22def3 (HEAD -> master, origin/master, origin/HEAD)
Author: Khem Raj <raj.khem@gmail.com>
Date: Tue Aug 16 09:58:56 2022 -0700
Steps:
# setup build dir
bitbake core-image-minimal
bitbake -c cleansstate meta-environment-qemux86-64
bitbake -c populate_sdk core-image-minimal
All the above steps completed without warnings/errors.
Am I missing something?
Ok, I did some more tests and so far I can only reproduce it on 3.1.14 which is outdated. On the recent Dunfell HEAD (3.1.19) I didn't see the issue anymore, so I assume it was fixed somewhere. I guess you can safely close this report and sorry for the noise! Works on supported branches. |
Doing the following: ``` bitbake -c cleansstate meta-environment-<machine> bitbake -c populate_sdk core-image-minimal ``` results in: ``` ERROR: When reparsing /yocto-ktn/build-sp5/../layers/poky/meta/recipes-core/meta/meta-environment.bb:do_generate_content, the basehash value changed from f8e0d4bacfb2940c49542bf6b72b81fa06f96746fa1f4acb58a56c4b28a766da to 2bd1f3bb9789d9d2330e546d0678ae875882376905b00de4d4661ec2c935eb27. The metadata is not deterministic and this needs to be fixed. ERROR: The following commands may help: ERROR: $ bitbake meta-environment-imx8mm-sp5 -cdo_generate_content -Snone ERROR: Then: ERROR: $ bitbake meta-environment-imx8mm-sp5 -cdo_generate_content -Sprintdiff ``` Debugging leads to the variable METADATA_REVISION in meta/classes/toolchain-scripts-base.bbclass changing from the git commit hash of the poky repo to <unknown>. The following change seems to fix the issue, but I'm not sure if it's a valid fix. Maybe some other fix is needed to avoid having METADATA_REVISION change in the first place!? ```diff --- a/meta/classes/toolchain-scripts-base.bbclass +++ b/meta/classes/toolchain-scripts-base.bbclass @@ -8,4 +8,4 @@ toolchain_create_sdk_version () { echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile echo 'Timestamp: ${DATETIME}' >> $versionfile } -toolchain_create_sdk_version[vardepsexclude] = "DATETIME" +toolchain_create_sdk_version[vardepsexclude] = "DATETIME METADATA_REVISION" ```