diff mbox series

[10/16] which: update 2.21 -> 2.23

Message ID 20250911085123.1551425-10-alex.kanavin@gmail.com
State New
Headers show
Series [01/16] gnupg: update 2.5.5 -> 2.5.11 | expand

Commit Message

Alexander Kanavin Sept. 11, 2025, 8:51 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

This (and 2.22) is a first release in many years.

- drop tweaks and dependency on cwautomacros as that is no longer used

- drop patch as configure.ac has been rewritten

- drop --disable-iberty as otherwise built-in implementation of xmalloc() isn't enabled

Sadly, cwautomacros has been replaced by an equally custom, weird set
of macros, written by 'which' maintainer: https://github.com/CarloWood/cwm4

- one effect of that is that autoreconf isn't happy with which's configure.ac and won't run;
one is supposed to use a custom script instead: https://github.com/CarloWood/cwm4/blob/master/scripts/bootstrap.sh

- alas, that script is not shipped in tarballs; the maintainer wants
everyone to trust their 200k configure script (hello xz backdoor)

- building from git (where the script exists) is not impossible,
but that has no version tags

- so in the end configure.ac is deleted; this has an effect
of autotools.bbclass running configure instead

All this 'special handling' for what, exactly? One single-function
executable, one manpage and one info page, which should all be in coreutils
to begin with. GNU's attachment to autotools defies reason.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 .../which/which-2.21/automake.patch           | 19 ------------
 ...opt-Fix-signature-of-getenv-function.patch | 29 +++++++++++--------
 .../which/{which_2.21.bb => which_2.23.bb}    |  8 ++---
 3 files changed, 19 insertions(+), 37 deletions(-)
 delete mode 100644 meta/recipes-extended/which/which-2.21/automake.patch
 rename meta/recipes-extended/which/{which-2.21 => which-2.23}/0001-getopt-Fix-signature-of-getenv-function.patch (51%)
 rename meta/recipes-extended/which/{which_2.21.bb => which_2.23.bb} (74%)

Comments

Ross Burton Sept. 15, 2025, 7:25 p.m. UTC | #1
On 11 Sep 2025, at 09:51, Alexander Kanavin via lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> wrote:
> This (and 2.22) is a first release in many years.

Yay!

> - drop tweaks and dependency on cwautomacros as that is no longer used

Yay!

> Sadly, cwautomacros has been replaced by an equally custom, weird set
> of macros, written by 'which' maintainer: https://github.com/CarloWood/cwm4

Okaaaaay

> - one effect of that is that autoreconf isn't happy with which's configure.ac and won't run;
> one is supposed to use a custom script instead: https://github.com/CarloWood/cwm4/blob/master/scripts/bootstrap.sh

Sigh.

> - alas, that script is not shipped in tarballs; the maintainer wants
> everyone to trust their 200k configure script (hello xz backdoor)

Facepalm.

> - building from git (where the script exists) is not impossible,
> but that has no version tags

Groan.

> - so in the end configure.ac is deleted; this has an effect
> of autotools.bbclass running configure instead

Ick.

> All this 'special handling' for what, exactly? One single-function
> executable, one manpage and one info page, which should all be in coreutils
> to begin with. GNU's attachment to autotools defies reason.

The attachment to not even standard autotools, even.

Between various factors including how late in the cycle we are, how ugly this upgrade is, and how minor GNU which is, and the number of post-release “fix out of bounds” patches in master, I propose holding off this for now.

We can file bugs and talk with upstream about some of the pain points (no tags, no rebuilds from tarballs, etc sounds like he’s trying to actively encourage a supply chain attack) and hopefully have a saner release in the future?

Ross
Alexander Kanavin Sept. 16, 2025, 9:29 a.m. UTC | #2
On Mon, 15 Sept 2025 at 21:25, Ross Burton <Ross.Burton@arm.com> wrote:

> > All this 'special handling' for what, exactly? One single-function
> > executable, one manpage and one info page, which should all be in coreutils
> > to begin with. GNU's attachment to autotools defies reason.
>
> The attachment to not even standard autotools, even.
>
> Between various factors including how late in the cycle we are, how ugly this upgrade is, and how minor GNU which is, and the number of post-release “fix out of bounds” patches in master, I propose holding off this for now.
>
> We can file bugs and talk with upstream about some of the pain points (no tags, no rebuilds from tarballs, etc sounds like he’s trying to actively encourage a supply chain attack) and hopefully have a saner release in the future?

Or drop GNU which entirely from core. Alternatives are available in
debianutils (and debian defaults to it) or busybox.

Alex
Alexander Kanavin Sept. 18, 2025, 6:50 p.m. UTC | #3
On Mon, 15 Sept 2025 at 21:25, Ross Burton <Ross.Burton@arm.com> wrote:

> > All this 'special handling' for what, exactly? One single-function
> > executable, one manpage and one info page, which should all be in coreutils
> > to begin with. GNU's attachment to autotools defies reason.
>
> The attachment to not even standard autotools, even.
>
> Between various factors including how late in the cycle we are, how ugly this upgrade is, and how minor GNU which is, and the number of post-release “fix out of bounds” patches in master, I propose holding off this for now.
>
> We can file bugs and talk with upstream about some of the pain points (no tags, no rebuilds from tarballs, etc sounds like he’s trying to actively encourage a supply chain attack) and hopefully have a saner release in the future?

I sat down, wrote and tested a meson.build file for this (in less than
an hour). V2 patches coming soon, but I'm really not sure whether the
maintainer will be open to the idea of throwing away all his precious
m4 macros and replacing them with a 50x shorter meson file. GNU is
known to dismiss anything that is not autotools as 'passing fads'
(I've had this response from gettext maintainer).

Alex
diff mbox series

Patch

diff --git a/meta/recipes-extended/which/which-2.21/automake.patch b/meta/recipes-extended/which/which-2.21/automake.patch
deleted file mode 100644
index 4d0f2e4d7be..00000000000
--- a/meta/recipes-extended/which/which-2.21/automake.patch
+++ /dev/null
@@ -1,19 +0,0 @@ 
-Update autoconf prologue to use "foreign" strictness.
-
-Upstream-Status: Pending
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/configure.ac b/configure.ac
-index d974461..a20dfa8 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,7 +1,7 @@
- dnl Process this file with autoconf to produce a configure script.
- AC_INIT([which], [2.21])
- AC_CONFIG_SRCDIR(which.c)
--AM_INIT_AUTOMAKE
-+AM_INIT_AUTOMAKE([foreign])
- AM_CONFIG_HEADER(config.h)
- AM_MAINTAINER_MODE
- 
-
diff --git a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch b/meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch
similarity index 51%
rename from meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch
rename to meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch
index e006d797d3c..c54368a0840 100644
--- a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch
+++ b/meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch
@@ -1,4 +1,4 @@ 
-From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001
+From 83d2ed3fd203868a8f287d2ebedc7c304c74fbb4 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 22 Mar 2025 17:56:19 -0700
 Subject: [PATCH] getopt: Fix signature of getenv function
@@ -13,27 +13,32 @@  Upstream-Status: Submitted [https://lists.gnu.org/archive/html/which-bugs/2025-0
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
  getopt.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ getopt.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
+diff --git a/getopt.c b/getopt.c
+index 9ac2ed6..b1aa322 100644
 --- a/getopt.c
 +++ b/getopt.c
-@@ -209,7 +209,7 @@ static char *posixly_correct;
+@@ -205,7 +205,7 @@ static char *posixly_correct;
  /* Avoid depending on library functions or files
     whose names are inconsistent.  */
  
--char *getenv ();
+-char *getenv();
 +char *getenv (const char*);
  
- static char *
- my_index (str, chr)
+ static char *my_index(str, chr) const char *str;
+ int chr;
+diff --git a/getopt.h b/getopt.h
+index f080053..e04e3ca 100644
 --- a/getopt.h
 +++ b/getopt.h
-@@ -103,7 +103,7 @@ struct option
+@@ -102,7 +102,7 @@ struct option {
     errors, only prototype getopt for the GNU C library.  */
- extern int getopt (int argc, char *const *argv, const char *shortopts);
- #else /* not __GNU_LIBRARY__ */
--extern int getopt ();
+ extern int getopt(int argc, char *const *argv, const char *shortopts);
+ #else  /* not __GNU_LIBRARY__ */
+-extern int getopt();
 +extern int getopt (int, char * const [], const char *);
  #endif /* __GNU_LIBRARY__ */
- extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- 		        const struct option *longopts, int *longind);
+ extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind);
+ extern int getopt_long_only(int argc, char *const *argv, const char *shortopts, const struct option *longopts,
diff --git a/meta/recipes-extended/which/which_2.21.bb b/meta/recipes-extended/which/which_2.23.bb
similarity index 74%
rename from meta/recipes-extended/which/which_2.21.bb
rename to meta/recipes-extended/which/which_2.23.bb
index 7279a047373..e98d897e75b 100644
--- a/meta/recipes-extended/which/which_2.21.bb
+++ b/meta/recipes-extended/which/which_2.23.bb
@@ -9,21 +9,17 @@  HOMEPAGE = "https://carlowood.github.io/which/"
 LICENSE = "GPL-3.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                     file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2"
-DEPENDS     = "cwautomacros-native"
 
 inherit autotools texinfo update-alternatives
 
-EXTRA_OECONF = "--disable-iberty"
-
 SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
-           file://automake.patch \
            file://0001-getopt-Fix-signature-of-getenv-function.patch \
            "
 
-SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad"
+SRC_URI[sha256sum] = "a2c558226fc4d9e4ce331bd2fd3c3f17f955115d2c00e447618a4ef9978a2a73"
 
 do_configure:prepend() {
-	sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am
+	rm -f ${S}/configure.ac
 }
 
 ALTERNATIVE:${PN} = "which"