Skip to contentSkip to conversation

procps: fix runtime version when using git shallow tarball

PATCH In review Yi Zhao 3 participants 6 messages May 16, 2025

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/2 procps: fix runtime version when using git shallow tarball

The runtime version of procps is generated by 'git describe' command in local/git-version-gen. But when using git shallow tarball, git-version-gen can not get the correct version due to missing git tag/commit messages. This actually breaks reproducibility, since the generated binaries should be consistent regardless of the source code packaging format.

Add a .tarball-version file in source directory. Then get-version-gen can determine the version through this file instead of 'git describe' command.

Before the fix:

root@intel-x86-64:~# ps -V
ps from procps-ng UNKNOWN
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng UNKNOWN

After the fix:

root@intel-x86-64:~# ps -V
ps from procps-ng 4.0.5
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng 4.0.5
---
 meta/recipes-extended/procps/procps_4.0.5.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-extended/procps/procps_4.0.5.bb +4 -0
index 3be40c38a4..e3f5bf6b65 100644
@@ -31,6 +31,10 @@ EXTRA_OECONF = "--enable-skill --disable-modern-top"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
 
+do_configure:prepend () {
+	[ ! -e ${S}/.tarball-version ] && echo ${PV} > ${S}/.tarball-version
+}
+
 do_install:append () {
 	install -d ${D}${base_bindir}
 	[ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 psmisc: fix runtime version when using git shallow tarball

The runtime version of psmisc is generated by 'git describe' command in misc/git-version-gen. But when using git shallow tarball, git-version-gen can not get the correct version due to missing git tag/commit messages. This actually breaks reproducibility, since the generated binaries should be consistent regardless of the source code packaging format.

Add a .tarball-version file in source directory. Then get-version-gen can determine the version through this file instead of 'git describe' command.

Before the fix:

root@intel-x86-64:~# pslog -V
pslog (PSmisc) UNKNOWN

After the fix:

root@intel-x86-64:~# pslog  -V
pslog (PSmisc) 23.7
---
 meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/psmisc/psmisc_23.7.bb +1 -0
index 4128ca0533..d6bb7ef81b 100644
@@ -24,6 +24,7 @@ inherit autotools gettext
 # doesn't believe po/ is a gettext directory and won't generate po/Makefile.
 do_configure:prepend() {
     ( cd ${S} && po/update-potfiles )
+    [ ! -e ${S}/.tarball-version ] && echo ${PV} > ${S}/.tarball-version
 }
 
 
Signature · 1 line
2.34.1
#2 lore raw
In reply to Yi Zhao
Quoted 17 lines · Yi Zhao via lists.openembedded.org

The runtime version of procps is generated by 'git describe' command in local/git-version-gen. But when using git shallow tarball, git-version-gen can not get the correct version due to missing git tag/commit messages. This actually breaks reproducibility, since the generated binaries should be consistent regardless of the source code packaging format.

Add a .tarball-version file in source directory. Then get-version-gen can determine the version through this file instead of 'git describe' command.

Before the fix:

root@intel-x86-64:~# ps -V
ps from procps-ng UNKNOWN
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng UNKNOWN
Quoted 6 lines

After the fix:

root@intel-x86-64:~# ps -V
ps from procps-ng 4.0.5
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng 4.0.5

Hello,
Did you try to add the tag parameter to SRC_URI?
Since
https://git.openembedded.org/bitbake/commit/?id=03945475886b8d31c7eccc80fe594ab5306bcf5d,
it looks like it should work.

Quoted 39 lines
---
 meta/recipes-extended/procps/procps_4.0.5.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-extended/procps/procps_4.0.5.bb +2 -0
index 3be40c38a4..e3f5bf6b65 100644
@@ -31,6 +31,10 @@ EXTRA_OECONF = "--enable-skill --disable-modern-top"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
 
+do_configure:prepend () {
+       [ ! -e ${S}/.tarball-version ] && echo ${PV} >

${S}/.tarball-version

meta/recipes-extended/procps/procps_4.0.5.bb +2 -0
+}
+
 do_install:append () {
        install -d ${D}${base_bindir}
        [ "${bindir}" != "${base_bindir}" ] && for i in

${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done --
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#216731):
https://lists.openembedded.org/g/openembedded-core/message/216731
Mute This Topic: https://lists.openembedded.org/mt/113142319/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#3 lore raw
Quoted 45 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Yoann Congal via lists.openembedded.org
Sent: Friday, May 16, 2025 11:36
To: [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH 1/2] procps: fix runtime version when using git shallow tarball

Le ven. 16 mai 2025 à 11:31, Yi Zhao via lists.openembedded.org
<http://lists.openembedded.org>
<[email protected] <mailto:[email protected]> > a écrit :

The runtime version of procps is generated by 'git describe' command in local/git-version-gen. But when using git shallow tarball, git-version-gen can not get the correct version due to missing git tag/commit messages. This actually breaks reproducibility, since the generated binaries should be consistent regardless of the source code packaging format.

Add a .tarball-version file in source directory. Then get-version-gen can determine the version through this file instead of 'git describe' command.

Before the fix:
root@intel-x86-64:~# ps -V
ps from procps-ng UNKNOWN
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng UNKNOWN

After the fix:
root@intel-x86-64:~# ps -V
ps from procps-ng 4.0.5
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng 4.0.5

Quoted 5 lines

Hello,
Did you try to add the tag parameter to SRC_URI?
Since
https://git.openembedded.org/bitbake/commit/?id=03945475886b8d31c7eccc80fe
594ab5306bcf5d, it looks like it should work.

There is one problem with the tag in SRC_URI - it should be done only on upgrade.
If you just add tag without bumping the version, you will still get the shallow tarball without the tag from already populated local download folder or download mirror.

Peter

Quoted 48 lines

<mailto:[email protected]> >

	---
	 meta/recipes-extended/procps/procps_4.0.5.bb <http://procps_4.0.5.bb>
| 4 ++++
	 1 file changed, 4 insertions(+)
	diff --git a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>  b/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	index 3be40c38a4..e3f5bf6b65 100644
	--- a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	+++ b/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	@@ -31,6 +31,10 @@ EXTRA_OECONF = "--enable-skill --disable-modern-
top"
	 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES',

'systemd', d)}"
PACKAGECONFIG[systemd] = "--with-systemd,--without-
systemd,systemd"

	+do_configure:prepend () {
	+       [ ! -e ${S}/.tarball-version ] && echo ${PV} > ${S}/.tarball-version
	+}
	+
	 do_install:append () {
	        install -d ${D}${base_bindir}
	        [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do
mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
	--
	2.34.1

--

Yoann Congal
Smile ECS

#4 lore raw

Le ven. 16 mai 2025 à 11:44, Marko, Peter <[email protected]> a écrit :

Quoted 55 lines
Quoted 10 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Yoann Congal via lists.openembedded.org
Sent: Friday, May 16, 2025 11:36
To: [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH 1/2] procps: fix runtime version when

using git

Quoted 11 lines

shallow tarball

Le ven. 16 mai 2025 à 11:31, Yi Zhao via lists.openembedded.org
<http://lists.openembedded.org>
<[email protected] <mailto:[email protected]> > a écrit :

The runtime version of procps is generated by 'git describe'

command in

Quoted 3 lines

local/git-version-gen. But when using git shallow tarball, git-version-gen can not get the correct version due to missing git tag/commit messages. This actually breaks reproducibility, since

the

Quoted 1 line

generated binaries should be consistent regardless of the source

code

Quoted 3 lines

packaging format.

Add a .tarball-version file in source directory. Then

get-version-gen

Quoted 1 line

can determine the version through this file instead of 'git

describe'

Quoted 16 lines

command.

Before the fix:
root@intel-x86-64:~# ps -V
ps from procps-ng UNKNOWN
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng UNKNOWN

After the fix:
root@intel-x86-64:~# ps -V
ps from procps-ng 4.0.5
root@intel-x86-64:~# sysctl -V
sysctl from procps-ng 4.0.5

Quoted 4 lines

Hello,
Did you try to add the tag parameter to SRC_URI?
Since

Quoted 9 lines

https://git.openembedded.org/bitbake/commit/?id=03945475886b8d31c7eccc80fe

Quoted 1 line

594ab5306bcf5d, it looks like it should work.

There is one problem with the tag in SRC_URI - it should be done only on upgrade.
If you just add tag without bumping the version, you will still get the shallow tarball without the tag from already populated local download folder or download mirror.

Ok, I did not know.
Sounds like a bug in the git fetcher.
Maybe the clonedir_need_update function needs to be upgraded to handle this case?
https://git.openembedded.org/bitbake/tree/lib/bb/fetch2/git.py#n317

Quoted 54 lines

Peter

Quoted 8 lines

<mailto:[email protected]> >

      ---
       meta/recipes-extended/procps/procps_4.0.5.bb <

http://procps_4.0.5.bb>

Quoted 14 lines

| 4 ++++

       1 file changed, 4 insertions(+)
      diff --git a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>  b/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
      index 3be40c38a4..e3f5bf6b65 100644
      --- a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
      +++ b/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
      @@ -31,6 +31,10 @@ EXTRA_OECONF = "--enable-skill --disable-modern-
top"
       PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES',
Quoted 6 lines

'systemd', d)}"
PACKAGECONFIG[systemd] = "--with-systemd,--without-
systemd,systemd"

+do_configure:prepend () {
+ [ ! -e ${S}/.tarball-version ] && echo ${PV} >

${S}/.tarball-version

Quoted 5 lines
      +}
      +
       do_install:append () {
              install -d ${D}${base_bindir}
              [ "${bindir}" != "${base_bindir}" ] && for i in

${base_bindir_progs}; do

Quoted 15 lines

mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done

      --
      2.34.1

--

Yoann Congal
Smile ECS

Signature · 2 lines
Yoann Congal
Smile ECS
#5 lore raw
Quoted 85 lines

-----Original Message-----
From: Yoann Congal <[email protected]>
Sent: Friday, May 16, 2025 12:01
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH 1/2] procps: fix runtime version when using git shallow tarball

Le ven. 16 mai 2025 à 11:44, Marko, Peter <[email protected] <mailto:[email protected]> > a écrit :

	> -----Original Message-----
	> From: [email protected]

<mailto:[email protected]> <openembedded-
> [email protected] <mailto:[email protected]>

Quoted 1 line

On Behalf Of Yoann Congal via

> lists.openembedded.org <http://lists.openembedded.org>
> Sent: Friday, May 16, 2025 11:36
> To: [email protected] <mailto:[email protected]> > Cc: [email protected]
<mailto:[email protected]>
> Subject: Re: [OE-core] [PATCH 1/2] procps: fix runtime version when
using git

	> shallow tarball
	>
	>
	>
	> Le ven. 16 mai 2025 à 11:31, Yi Zhao via lists.openembedded.org

<http://lists.openembedded.org>
> <http://lists.openembedded.org>
> <[email protected]
<mailto:[email protected]>
> <mailto:[email protected]
<mailto:[email protected]> > > a écrit :

	>
	>
	>       The runtime version of procps is generated by 'git describe'
command in
	>       local/git-version-gen. But when using git shallow tarball,
	>       git-version-gen can not get the correct version due to missing git
	>       tag/commit messages. This actually breaks reproducibility, since the
	>       generated binaries should be consistent regardless of the source
code
	>       packaging format.
	>
	>       Add a .tarball-version file in source directory. Then get-version-gen
	>       can determine the version through this file instead of 'git describe'
	>       command.
	>
	>       Before the fix:
	>       root@intel-x86-64:~# ps -V
	>       ps from procps-ng UNKNOWN
	>       root@intel-x86-64:~# sysctl -V
	>       sysctl from procps-ng UNKNOWN
	>
	>       After the fix:
	>       root@intel-x86-64:~# ps -V
	>       ps from procps-ng 4.0.5
	>       root@intel-x86-64:~# sysctl -V
	>       sysctl from procps-ng 4.0.5
	>
	>
	>
	> Hello,
	> Did you try to add the tag parameter to SRC_URI?
	> Since
	>

https://git.openembedded.org/bitbake/commit/?id=03945475886b8d31c7eccc80fe
> 594ab5306bcf5d, it looks like it should work.

There is one problem with the tag in SRC_URI - it should be done only on
upgrade.
If you just add tag without bumping the version, you will still get the
shallow tarball without the tag from already populated local download folder or download mirror.

Quoted 5 lines

Ok, I did not know.
Sounds like a bug in the git fetcher.
Maybe the clonedir_need_update function needs to be upgraded to handle this case?
https://git.openembedded.org/bitbake/tree/lib/bb/fetch2/git.py#n317

I'm not sure if it's a good idea to update shallow tarball after downloading it from mirror.
One of the use-cases is to verify that upstream is not contacted when downloading from mirror (e.g. for air-gaped environments).

If you want this working, better way would probably be to add the tag to filename, so new shallow tarball is generated.

Peter

Quoted 69 lines

	Peter

	>
	>
	>
	>
	>       Signed-off-by: Yi Zhao <[email protected]
<mailto:[email protected]>
	> <mailto:[email protected] <mailto:[email protected]> > >
	>       ---
	>        meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>  <http://procps_4.0.5.bb>
	> | 4 ++++
	>        1 file changed, 4 insertions(+)
	>
	>       diff --git a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	> <http://procps_4.0.5.bb>  b/meta/recipes-
extended/procps/procps_4.0.5.bb <http://procps_4.0.5.bb>
	> <http://procps_4.0.5.bb>
	>       index 3be40c38a4..e3f5bf6b65 100644
	>       --- a/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	> <http://procps_4.0.5.bb>
	>       +++ b/meta/recipes-extended/procps/procps_4.0.5.bb
<http://procps_4.0.5.bb>
	> <http://procps_4.0.5.bb>
	>       @@ -31,6 +31,10 @@ EXTRA_OECONF = "--enable-skill --disable-
modern-
	> top"
	>        PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES',
	> 'systemd', d)}"
	>        PACKAGECONFIG[systemd] = "--with-systemd,--without-
	> systemd,systemd"
	>
	>       +do_configure:prepend () {
	>       +       [ ! -e ${S}/.tarball-version ] && echo ${PV} > ${S}/.tarball-
version
	>       +}
	>       +
	>        do_install:append () {
	>               install -d ${D}${base_bindir}
	>               [ "${bindir}" != "${base_bindir}" ] && for i in
${base_bindir_progs}; do
	> mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
	>       --
	>       2.34.1
	>
	>
	>
	>
	>
	>
	>
	>
	> --
	>
	> Yoann Congal
	> Smile ECS

--

Yoann Congal
Smile ECS