diff mbox series

bitbake.conf: Drop PE and PR from WORKDIR and STAMP

Message ID 20230810164114.261613-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit cc83e45484656a6b577ff84817131735023daad4
Headers show
Series bitbake.conf: Drop PE and PR from WORKDIR and STAMP | expand

Commit Message

Richard Purdie Aug. 10, 2023, 4:41 p.m. UTC
Once, we relied upon stamps changing to rebuild. PE and PR are packaging
variables and are reflected in the taskhashes when/where they're used so
they do not need to be in STAMP.

Similarly, once, multiple versions were something which was useful in
WORKDIR but this is really just noise causing long pathnames now.

Drop PR and PE from these variables to clean up the paths a bit.

This may break some tool assumptions about paths but those are probably
things we need to fix.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/bitbake.conf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Jansa Nov. 8, 2023, 8:34 a.m. UTC | #1
On Thu, Aug 10, 2023 at 6:41 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> Once, we relied upon stamps changing to rebuild. PE and PR are packaging
> variables and are reflected in the taskhashes when/where they're used so
> they do not need to be in STAMP.
>
> Similarly, once, multiple versions were something which was useful in
> WORKDIR but this is really just noise causing long pathnames now.
>
> Drop PR and PE from these variables to clean up the paths a bit.
>
> This may break some tool assumptions about paths but those are probably
> things we need to fix.
>

meta/conf/bitbake.conf:
-fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
meta/conf/bitbake.conf:
-fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \

What about changing ^ as well to match workdir names? I know it works as it
is now and it might be useful to know from which PR the PN-dbg files are,
but as we don't depend on PR in WORKDIR maybe we don't need it in
/usr/src/debug as well anymore.

The interesting side-effect of this is that for DISTROs which still use PR
(e.g. webOS OSE), the difference in -fdebug-prefix-map causes all binaries
to be slightly different when rebuilt with different PR (due to this path,
even when otherwise they are binary reproducible) and when the number of
digits in PR changes (e.g. from r9 to r10) it also results in slightly
bigger binaries (and more unnecessary changes in buildhistory diffs).

For example this foo binary, the difference between "new" and "old" is
extra patch applied in SRC_URI (which doesn't affect the foo binary, but
was the reason for PR bump).

And the binary is bigger with r10, identical with r6 and slightly different
due to debug-prefix-map between r6 and r7:

$ ls -la 1.0.0-175-*/image/usr/sbin/foo
-rwxr-xr-x 1 bitbake bitbake 30182460 Nov  8 08:29
1.0.0-175-new-r10/image/usr/sbin/foo
-rwxr-xr-x 1 bitbake bitbake 30182224 Nov  8 08:02
1.0.0-175-new-r6/image/usr/sbin/foo
-rwxr-xr-x 1 bitbake bitbake 30182224 Nov  8 07:49
1.0.0-175-new-r7/image/usr/sbin/foo
-rwxr-xr-x 1 bitbake bitbake 30182224 Nov  8 07:39
1.0.0-175-old-r6/image/usr/sbin/foo
$ md5sum 1.0.0-175-*/image/usr/sbin/foo
8e3ab67d596f8cc2f9c6320dab10af01  1.0.0-175-new-r10/image/usr/sbin/foo
f6ff1e64fe6affb9ba0d8f278cf7ed79  1.0.0-175-new-r6/image/usr/sbin/foo
6469a0b10aac233911e63c5ea97b03c0  1.0.0-175-new-r7/image/usr/sbin/foo
f6ff1e64fe6affb9ba0d8f278cf7ed79  1.0.0-175-old-r6/image/usr/sbin/foo
Richard Purdie Nov. 9, 2023, 11:16 a.m. UTC | #2
On Wed, 2023-11-08 at 09:34 +0100, Martin Jansa wrote:
> On Thu, Aug 10, 2023 at 6:41 PM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > Once, we relied upon stamps changing to rebuild. PE and PR are
> > packaging
> > variables and are reflected in the taskhashes when/where they're
> > used so
> > they do not need to be in STAMP.
> > 
> > Similarly, once, multiple versions were something which was useful
> > in
> > WORKDIR but this is really just noise causing long pathnames now.
> > 
> > Drop PR and PE from these variables to clean up the paths a bit.
> > 
> > This may break some tool assumptions about paths but those are
> > probably
> > things we need to fix.
> > 
> 
> 
> meta/conf/bitbake.conf: -fdebug-prefix-
> map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> meta/conf/bitbake.conf: -fdebug-prefix-
> map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> 
> What about changing ^ as well to match workdir names? I know it works
> as it is now and it might be useful to know from which PR the PN-dbg
> files are, but as we don't depend on PR in WORKDIR maybe we don't
> need it in /usr/src/debug as well anymore.

I'm ok with trying that. I think we could drop PE there too and I'm
even wondering about PV...

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 475d6523bb8..599bbc4ba85 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -402,10 +402,10 @@  PERSISTENT_DIR = "${TOPDIR}/cache"
 LOG_DIR = "${TMPDIR}/log"
 
 STAMPS_DIR ?= "${TMPDIR}/stamps"
-STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
 STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
 BASE_WORKDIR ?= "${TMPDIR}/work"
-WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
 T = "${WORKDIR}/temp"
 D = "${WORKDIR}/image"
 S = "${WORKDIR}/${BP}"