diff mbox series

bitbake.conf: Remove PR glob part from STAMPCLEAN

Message ID 20250711163848.111907-2-michalwsieron@gmail.com
State New
Headers show
Series bitbake.conf: Remove PR glob part from STAMPCLEAN | expand

Commit Message

Michal Sieron July 11, 2025, 4:38 p.m. UTC
It's hard for me to explain what exactly are the consequences of the
STAMP value and STAMPCLEAN glob being mismatched. The issue is present
since the PR part was removed from the STAMP variable in
OE-Core rev: cc83e45484656a6b577ff84817131735023daad4.

I will at least show an example use case that I found was broken due
to this:
1. Have recipes foo_A.bb and foo_B.bb
2. Build foo-native with PREFERRED_VERSION_foo-native = "A"
3. ${COMPONENTS_DIR}/x86_64-linux/foo-native has version A
4. Build foo-native with PREFERRED_VERSION_foo-native = "B"
5. ${COMPONENTS_DIR}/x86_64-linux/foo-native has version B
6. Build foo-native with PREFERRED_VERSION_foo-native = "A"
7. ${COMPONENTS_DIR}/x86_64-linux/foo-native still has version B

In my case the PREFERRED_VERSION comes from different machines.
The issue showed itself when a bar-native compiled against foo-native
version A was pulled from sstate-cache and foo-native in version B was
kept in ${COMPONENTS_DIR} after previous build for a different machine.

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
---

I am not sure if there are any consequences that come with the
STAMPCLEAN not having `-` in the last part. Maybe too much stuff can be
removed? I am also not sure why STAMPCLEAN can't be generated from the
value of STAMP. This way such error wouldn't even happen. Is there any
situation where you might want STAMP and STAMPCLEAN mismatched?

 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 3a97fa1ac0..4d232a62e6 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -404,7 +404,7 @@  LOG_DIR = "${TMPDIR}/log"
 
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
-STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
+STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*"
 BASE_WORKDIR ?= "${TMPDIR}/work"
 WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
 UNPACKDIR ??= "${WORKDIR}/sources"