fix runtime versions
cover fix runtime versions
This series of patches was sent in April. Ross suggested discussing this with upstream to see if they could update the scripts to address the issue. I talked to upstream and they declined because they believed that "autoreconf may result in different built source code than what has been distributed"[1].
I found that Debian maintains a similar patch in their own repo[2], as it was also rejected upstream[3].
[1] https://lists.gnupg.org/pipermail/gnupg-devel/2025-May/035913.html
[2] https://salsa.debian.org/debian/gnupg2/-/blob/debian/unstable/debian/patches/debian-packaging/avoid-beta-warning.patch
[3] https://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029068.html
Yi Zhao (8):
libgpg-error: drop -unknown suffix from version number
pinentry: drop -unknown suffix from version number
libgcrypt: drop -unknown suffix from version number
gnupg: drop -unknown suffix from version number
libassuan: drop -unknown suffix from version number
libksba: drop -unknown suffix from version number
procps: fix runtime version when using git shallow tarball
psmisc: fix runtime version when using git shallow tarball
meta/recipes-extended/procps/procps_4.0.5.bb | 4 +++ meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 + ...h-fix-find-version-for-beta-checking.patch | 22 ++++++++---- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libassuan/libassuan_3.0.2.bb | 1 + ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgcrypt/libgcrypt_1.11.1.bb | 1 + ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgpg-error/libgpg-error_1.55.bb | 1 + ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ meta/recipes-support/libksba/libksba_1.6.7.bb | 3 +- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../pinentry/pinentry_1.3.1.bb | 1 + 13 files changed, 201 insertions(+), 8 deletions(-) create mode 100644 meta/recipes-support/libassuan/libassuan/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch create mode 100644 meta/recipes-support/libgcrypt/files/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch create mode 100644 meta/recipes-support/libksba/libksba/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch create mode 100644 meta/recipes-support/pinentry/pinentry-1.3.1/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
Signature · 1 line
2.34.1
PATCH 1/8 libgpg-error: drop -unknown suffix from version number
If autogen.sh is run outside of a git repo, the find-version function always assumes that libgpg-error is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ gpg-error --version gpg-error (libgpg-error) 1.51-unknown
After the fix:
$ gpg-error --version gpg-error (libgpg-error) 1.51
--- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgpg-error/libgpg-error_1.55.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
meta/recipes-support/libgpg-error/libgpg-error/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 7358f4ff6c711bde1d83b9a38bbf349a23e0e243 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Tue, 15 Apr 2025 15:32:58 +0800 +Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number + +If autogen.sh is run outside of a git repo, the find-version function +always assumes that libgpg-error is a beta version and adds the suffix +'-unknown' to the version number. This should not work for users who use +tarball and re-run autoconf in build directory. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/autogen.sh b/autogen.sh +index 9f91297..daa2730 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -270,8 +270,8 @@ if [ "$myhost" = "find-version" ]; then + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no +- beta=yes +- tmp="-unknown" ++ beta=no ++ tmp="" + cid="0000000" + rev="0000000" + rvd="0" +-- +2.34.1 +
meta/recipes-support/libgpg-error/libgpg-error_1.55.bb +1 -0
@@ -16,6 +16,7 @@ UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \ file://pkgconfig.patch \ file://0001-Do-not-fail-when-testing-config-scripts.patch \ + file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \ file://run-ptest \ "
Signature · 1 line
2.34.1
PATCH 2/8 pinentry: drop -unknown suffix from version number
In reply to Yi ZhaoIf autogen.sh is run outside of a git repo, the find-version function always assumes that pinentry is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ pinentry --version pinentry-curses (pinentry) 1.3.1-unknown
After the fix:
$ pinentry --version pinentry-curses (pinentry) 1.3.1
--- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../pinentry/pinentry_1.3.1.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/pinentry/pinentry-1.3.1/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
meta/recipes-support/pinentry/pinentry-1.3.1/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 211fd00a631da3e907e3a78890bfd1cf3bbe069e Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Tue, 15 Apr 2025 15:32:58 +0800 +Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number + +If autogen.sh is run outside of a git repo, the find-version function +always assumes that pinentry is a beta version and adds the suffix +'-unknown' to the version number. This should not work for users who use +tarball and re-run autoconf in build directory. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/autogen.sh b/autogen.sh +index e6efe33..6acff4d 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -269,8 +269,8 @@ if [ "$myhost" = "find-version" ]; then + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no +- beta=yes +- tmp="-unknown" ++ beta=no ++ tmp="" + rev="0000000" + rvd="0" + fi +-- +2.34.1 +
meta/recipes-support/pinentry/pinentry_1.3.1.bb +1 -0
@@ -14,6 +14,7 @@ UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://libassuan_pkgconf.patch \ file://gpg-error_pkconf.patch \ + file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \ " SRC_URI[sha256sum] = "bc72ee27c7239007ab1896c3c2fae53b076e2c9bd2483dc2769a16902bce8c04"
Signature · 1 line
2.34.1
PATCH 3/8 libgcrypt: drop -unknown suffix from version number
In reply to Yi ZhaoIf autogen.sh is run outside of a git repo, the find-version function always assumes that libgcrypt is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0-unknown
After the fix:
$ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0
--- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgcrypt/libgcrypt_1.11.1.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/libgcrypt/files/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
meta/recipes-support/libgcrypt/files/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 028305ba9ad7769d6f1747a4945949ced8761ba9 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Tue, 15 Apr 2025 15:32:58 +0800 +Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number + +If autogen.sh is run outside of a git repo, the find-version function +always assumes that libgcrypt is a beta version and adds the suffix +'-unknown' to the version number. This should not work for users who use +tarball and re-run autoconf in build directory. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/autogen.sh b/autogen.sh +index 9b36158..4b2e657 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -265,8 +265,8 @@ if [ "$myhost" = "find-version" ]; then + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no +- beta=yes +- tmp="-unknown" ++ beta=no ++ tmp="" + rev="0000000" + rvd="0" + fi +-- +2.34.1 +
meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb +1 -0
@@ -24,6 +24,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ file://0001-tests-Fix-link-errors-for-t-thread-local.patch \ file://no-native-gpg-error.patch \ file://no-bench-slope.patch \ + file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \ file://run-ptest \ " SRC_URI[sha256sum] = "24e91c9123a46c54e8371f3a3a2502f1198f2893fbfbf59af95bc1c21499b00e"
Signature · 1 line
2.34.1
PATCH 4/8 gnupg: drop -unknown suffix from version number
In reply to Yi ZhaoIf autogen.sh is run outside of a git repo, the find-version function always assumes that gnupg is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ gpg --version gpg (GnuPG) 2.5.5-unknown
After the fix:
$ gpg --version gpg (GnuPG) 2.5.5
--- ...h-fix-find-version-for-beta-checking.patch | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-)
meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch +15 -7
@@ -1,4 +1,4 @@ -From 4d8cc1982273d571b4e80fe981878d0fa5884236 Mon Sep 17 00:00:00 2001 +From 8152507a5ee312889366177c48fd99dc351d4c41 Mon Sep 17 00:00:00 2001 From: Wenzong Fan <[email protected]> Date: Wed, 16 Aug 2017 11:23:22 +0800 Subject: [PATCH] autogen.sh: fix find-version for beta checking
@@ -7,25 +7,33 @@ find-version always assumes that gnupg is beta if autogen.sh is run out of git-repo. This doesn't work for users whom just take release tarball and re-run autoconf in their local build dir. -Upstream-Status: Pending +Upstream-Status: Inappropriate [oe specific] Signed-off-by: Wenzong Fan <[email protected]> Rebase to 2.1.23 Signed-off-by: Hongxu Jia <[email protected]> + +Drop '-unknown' suffix from version number and set beta to no instead of +removing it. + +Signed-off-by: Yi Zhao <[email protected]> --- - autogen.sh | 1 - - 1 file changed, 1 deletion(-) + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh -index 9f91297..116fb7f 100755 +index 0b08e8b..0c5e425 100755 --- a/autogen.sh +++ b/autogen.sh -@@ -270,7 +270,6 @@ if [ "$myhost" = "find-version" ]; then +@@ -284,8 +284,8 @@ if [ "$myhost" = "find-version" ]; then rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) else ingit=no - beta=yes - tmp="-unknown" +- tmp="-unknown" ++ beta=no ++ tmp="" cid="0000000" rev="0000000" + rvd="0"
Signature · 1 line
2.34.1
PATCH 5/8 libassuan: drop -unknown suffix from version number
In reply to Yi ZhaoIf autogen.sh is run outside of a git repo, the find-version function always assumes that libassuan is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ cat /usr/lib/pkgconfig/libassuan.pc
[snip]
Name: libassuan
Description: IPC library for the GnuPG components
Requires.private: gpg-error
Version: 3.0.2-unknown
Cflags: -I${includedir}
[snip]After the fix:
$ cat /usr/lib/pkgconfig/libassuan.pc
[snip]
Name: libassuan
Description: IPC library for the GnuPG components
Requires.private: gpg-error
Version: 3.0.2
Cflags: -I${includedir}
[snip]--- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libassuan/libassuan_3.0.2.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/libassuan/libassuan/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
meta/recipes-support/libassuan/libassuan/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch new file +35 -0
@@ -0,0 +1,35 @@ +From ecf05e7794edd56c6ff1cd7b14154e647dd0d787 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Tue, 15 Apr 2025 15:32:58 +0800 +Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number + +If autogen.sh is run outside of a git repo, the find-version function +always assumes that libassuan is a beta version and adds the suffix +'-unknown' to the version number. This should not work for users who use +tarball and re-run autoconf in build directory. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/autogen.sh b/autogen.sh +index 0b08e8b..0c5e425 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -284,8 +284,8 @@ if [ "$myhost" = "find-version" ]; then + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no +- beta=yes +- tmp="-unknown" ++ beta=no ++ tmp="" + cid="0000000" + rev="0000000" + rvd="0" +-- +2.34.1 +
meta/recipes-support/libassuan/libassuan_3.0.2.bb +1 -0
@@ -18,6 +18,7 @@ DEPENDS = "libgpg-error" UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/libassuan/libassuan-${PV}.tar.bz2 \ file://libassuan-add-pkgconfig-support.patch \ + file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \ " SRC_URI[sha256sum] = "d2931cdad266e633510f9970e1a2f346055e351bb19f9b78912475b8074c36f6"
Signature · 1 line
2.34.1
PATCH 6/8 libksba: drop -unknown suffix from version number
In reply to Yi ZhaoIf autogen.sh is run outside of a git repo, the find-version function always assumes that libksba is a beta version and adds the suffix '-unknown' to the version number.
Befor the fix:
$ cat /usr/lib/pkgconfig/ksba.pc
[snip]
Name: ksba
Description: X.509 and CMS support library
Requires: gpg-error
Version: 1.6.7-unknown
Cflags: -I${includedir}
[snip]After the fix:
$ cat /usr/lib/pkgconfig/ksba.pc
[snip]
Name: ksba
Description: X.509 and CMS support library
Requires: gpg-error
Version: 1.6.7
Cflags: -I${includedir}
[snip]--- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ meta/recipes-support/libksba/libksba_1.6.7.bb | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libksba/libksba/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch
meta/recipes-support/libksba/libksba/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 5837fbaa76e6959ea895dc118893fb60957012fc Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Tue, 15 Apr 2025 15:32:58 +0800 +Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number + +If autogen.sh is run outside of a git repo, the find-version function +always assumes that libksba is a beta version and adds the suffix +'-unknown' to the version number. This should not work for users who use +tarball and re-run autoconf in build directory. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + autogen.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/autogen.sh b/autogen.sh +index e6efe33..6acff4d 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -269,8 +269,8 @@ if [ "$myhost" = "find-version" ]; then + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no +- beta=yes +- tmp="-unknown" ++ beta=no ++ tmp="" + rev="0000000" + rvd="0" + fi +-- +2.34.1 +
meta/recipes-support/libksba/libksba_1.6.7.bb +2 -1
@@ -22,7 +22,8 @@ inherit autotools binconfig-disabled pkgconfig texinfo UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ - file://ksba-add-pkgconfig-support.patch" + file://ksba-add-pkgconfig-support.patch \ + file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch" SRC_URI[sha256sum] = "cf72510b8ebb4eb6693eef765749d83677a03c79291a311040a5bfd79baab763"
Signature · 1 line
2.34.1
PATCH 7/8 procps: fix runtime version when using git shallow tarball
In reply to Yi ZhaoThe 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
@@ -29,6 +29,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
PATCH 8/8 psmisc: fix runtime version when using git shallow tarball
In reply to Yi ZhaoThe 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
@@ -23,6 +23,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 } PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
Signature · 1 line
2.34.1
Re: [OE-core] [PATCH 8/8] psmisc: fix runtime version when using git shallow tarball
Quoted 15 lines · Yi Zhao via lists.openembedded.org
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
Quoted 8 lines
After the fix:
root@intel-x86-64:~# pslog -V pslog (PSmisc) 23.7Signed-off-by Yi Zhao <[email protected]>---
meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 +1 file changed, 1 insertion(+)
Does adding the tag parameter to the url fix this?
That should cause the shallow clones to fetch the tag data.
Cheers,
Richard
Re: [OE-core] [PATCH 8/8] psmisc: fix runtime version when using git shallow tarball
Quoted 20 lines · Richard Purdie
Quoted 19 lines · Yi Zhao via lists.openembedded.org
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) UNKNOWNAfter the fix:
root@intel-x86-64:~# pslog -V pslog (PSmisc) 23.7
Quoted 5 lines
Quoted 4 lines
Signed-off-by Yi Zhao <[email protected]>--- meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 + 1 file changed, 1 insertion(+)Does adding the tag parameter to the url fix this?
I have tested it. But it doesn't work.
//Yi
Quoted 6 lines
That should cause the shallow clones to fetch the tag data.
Cheers,
Richard
Re: [OE-core] [PATCH 8/8] psmisc: fix runtime version when using git shallow tarball
Quoted 29 lines · Yi Zhao
Quoted 27 lines · Richard Purdie
Quoted 25 lines · Yi Zhao via lists.openembedded.org
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) UNKNOWNAfter the fix:
root@intel-x86-64:~# pslog -V pslog (PSmisc) 23.7
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Signed-off-by Yi Zhao <[email protected]>---
meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 +1 file changed, 1 insertion(+)Does adding the tag parameter to the url fix this?
I have tested it. But it doesn't work.
I was curious why not and I had a look myself. The trouble is that the way the shallow cloning works, it squashes out references so "v23.7" becomes just that, not "refs/tags/v23.7".
I'm not 100% convinced the fetcher is doing the right thing here. If we could convince the fetcher to preserve the refs/tags piece, then this probably would work...
At the very least I wanted to document why it didn't work.
After writing this, I did dig a bit further. If I change the fetcher like this:
bitbake/lib/bb/fetch2/git.py +1 -1
@@ -634,7 +634,7 @@ class Git(FetchMethod): all_refs.append(line.split()[-1]) extra_refs = [] if 'tag' in ud.parm: - extra_refs.append(ud.parm['tag']) + extra_refs.append("refs/tags/" + ud.parm['tag']) for r in ud.shallow_extra_refs: if not ud.bareclone: r = r.replace('refs/heads/', 'refs/remotes/origin/')
it does work. Perhaps we should do that.
Cheers,
Richard
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [OE-core] [PATCH 8/8] psmisc: fix runtime version when using git shallow tarball
Quoted 71 lines · Richard Purdie via lists.openembedded.org
Quoted 31 lines · Yi Zhao
Quoted 29 lines · Richard Purdie
Quoted 27 lines · Yi Zhao via lists.openembedded.org
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) UNKNOWNAfter the fix:
root@intel-x86-64:~# pslog -V pslog (PSmisc) 23.7Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Signed-off-by Yi Zhao <[email protected]>---
meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 +1 file changed, 1 insertion(+)Does adding the tag parameter to the url fix this?
I have tested it. But it doesn't work.
I was curious why not and I had a look myself. The trouble is that the
way the shallow cloning works, it squashes out references so "v23.7" becomes just that, not "refs/tags/v23.7".I'm not 100% convinced the fetcher is doing the right thing here. If we
could convince the fetcher to preserve the refs/tags piece, then this probably would work...At the very least I wanted to document why it didn't work.
After writing this, I did dig a bit further. If I change the fetcher like this:
bitbake/lib/bb/fetch2/git.py +0
-0@@ -634,7 +634,7 @@ class Git(FetchMethod): all_refs.append(line.split()[-1])
extra_refs= []
if 'tag' in ud.parm:
-extra_refs.append(ud.parm['tag'])
+extra_refs.append("refs/tags/" + ud.parm['tag'])for r in ud.shallow_extra_refs:
if not ud.bareclone:
r =r.replace('refs/heads/', 'refs/remotes/origin/')
Quoted 1 line
it does work. Perhaps we should do that.
I've sent a couple of patches doing this, and adding the tag to the shallow tarball name so we can add tags to recipes without complaints and migrate to the new layout without issue.
Cheers,
Richard
Quoted 5 lines · Yi Zhao via lists.openembedded.org
This series of patches was sent in April. Ross suggested discussing this with upstream to see if they could update the scripts to address the issue. I talked to upstream and they declined because they believed that "autoreconf may result in different built source code than what has been distributed"[1].
Is there a benefit of carrying these patches in core to the broader community? I don't think anyone's particularly confused or misled by 'unknown' reported by executables at runtime, we have procedures to verify that what we build is exactly what upstream has released, and various built time reporting mechanisms to see the versions.
Wind River obviously has invested a lot of time and effort into this, presumably because it has a paying customer that is obsessed about what executables on target say, but I do struggle to justify carrying and maintaining these fixes.
Alex
Quoted 14 lines · Alexander Kanavin via lists.openembedded.org
Quoted 5 lines · Yi Zhao via lists.openembedded.org
This series of patches was sent in April. Ross suggested discussing this with upstream to see if they could update the scripts to address the issue. I talked to upstream and they declined because they believed that "autoreconf may result in different built source code than what has been distributed"[1].
Is there a benefit of carrying these patches in core to the broader community? I don't think anyone's particularly confused or misled by 'unknown' reported by executables at runtime, we have procedures to verify that what we build is exactly what upstream has released, and various built time reporting mechanisms to see the versions.
Quoted 4 lines
Wind River obviously has invested a lot of time and effort into this, presumably because it has a paying customer that is obsessed about what executables on target say, but I do struggle to justify carrying and maintaining these fixes.
I guess it raises the question of patch vs sed too.
Would this be more maintainable if we just had a common sed like function to take these out of autogen.sh? If it breaks, it isn't the end of the world...
There is the advantage that it is relatively standardised.
Cheers,
Richard
Quoted 13 lines · Alexander Kanavin
Quoted 5 lines · Yi Zhao via lists.openembedded.org
This series of patches was sent in April. Ross suggested discussing this with upstream to see if they could update the scripts to address the issue. I talked to upstream and they declined because they believed that "autoreconf may result in different built source code than what has been distributed"[1].
Is there a benefit of carrying these patches in core to the broader community? I don't think anyone's particularly confused or misled by 'unknown' reported by executables at runtime, we have procedures to verify that what we build is exactly what upstream has released, and various built time reporting mechanisms to see the versions.
Quoted 4 lines
Wind River obviously has invested a lot of time and effort into this, presumably because it has a paying customer that is obsessed about what executables on target say, but I do struggle to justify carrying and maintaining these fixes.
This is exposed by version check using check-version-mismatch.bbclass.
In some cases, a mismatch between the runtime version and the build-time version can cause confusion for users. On the other hand, this suffix does not exist in other distributions.
I will follow Richard's suggestion. Use a more standardized approach.
Thanks,
Yi
Quoted 2 lines
Alex
Quoted 13 lines · Yi Zhao via lists.openembedded.org
This series of patches was sent in April. Ross suggested discussing this with upstream to see if they could update the scripts to address the issue. I talked to upstream and they declined because they believed that "autoreconf may result in different built source code than what has been distributed"[1].
I found that Debian maintains a similar patch in their own repo[2], as it was also rejected upstream[3].[1] https://lists.gnupg.org/pipermail/gnupg-devel/2025-May/035913.html
[2] https://salsa.debian.org/debian/gnupg2/-/blob/debian/unstable/debian/patches/debian-packaging/avoid-beta-warning.patch
[3] https://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029068.html
Quoted 9 lines
Yi Zhao (8):
libgpg-error: drop -unknown suffix from version number
pinentry: drop -unknown suffix from version number
libgcrypt: drop -unknown suffix from version number
gnupg: drop -unknown suffix from version number
libassuan: drop -unknown suffix from version number
libksba: drop -unknown suffix from version number
procps: fix runtime version when using git shallow tarball
psmisc: fix runtime version when using git shallow tarball
I did also want to ask if WindRiver have considered a slightly different approach to testing some of this. We already have some tests which run things like "dnf --help" and "dnf --version" on the target using the runtime testing. Those did catch a missing dependency in the recent dnf upgrade so they do add some value.
I've been wondering for a while about extending this to run those kinds of options against more of our binaries. In this specific case, we could check that "unknown" doesn't creep back in.
Is that something WindRiver would be intersted in extending our runtime tests to do, at least for some set of binaries. We can guard the tests on whether the images contain the appropriate packages.
Cheers,
Richard