Subject: Bug#848168: readline: Please drop the multilib packages

From: Sven Joachim <[email-masked]>
Date: Wed, 14 Dec 2016 21:05:54 +0100

Source: readline
Version: 7.0-1
Tags: buster sid
Control: block 848163 by -1

I intend to remove the ncurses multilib packages after the stretch
release, see #848163.  Since ncurses is required to build readline, this
means that the readline multilib packages can then no longer be built.

There are no reverse dependencies of the readline multilib packages, so
removing them should not be a problem.

---

From: Sven Joachim <[email-masked]>
Date: Wed, 14 Dec 2016 21:21:21 +0100

Control: clone -1 -2
Control: reassign -2 src:readline6

> removing them should not be a problem.

For completeness' sake I'm reassigning a copy to readline6, although you
probably want to remove that in the near future anyway (#840397).

Cheers,
       Sven

---

From: Matthias Klose <[email-masked]>
Date: Thu, 15 Dec 2016 08:38:22 +0100

> removing them should not be a problem.

Did we stop building gdb64 packages for 32bit architectures?

I'd like to delay that change until the buildds can manage dependencies on
foreign architectures.

---

From: Sven Joachim <[email-masked]>
Date: Thu, 15 Dec 2016 21:28:40 +0100

> Did we stop building gdb64 packages for 32bit architectures?

Yes, since gdb 7.9-1.

> I'd like to delay that change until the buildds can manage dependencies on

Has there been any progress on that?  Bug #770925 has not seen any
updates for 16 months. :-(

Which use case of foreign architecture dependencies is handled by the
existing readline multilib packages?

Cheers,
       Sven

---

From: Sven Joachim <[email-masked]>
Date: Sat, 10 Feb 2018 13:41:14 +0100

Control: tags -1 + patch

> existing readline multilib packages?

Also, while installing foreign architecture packages might sometimes be
useful, linking a program in a newly built package against a shared
foreign-arch library is not really possible, because dpkg-shlipdeps will
generate incorrect dependencies for it.

There is an overdue ncurses library transition (#230990) in the works,
and I do not want to introduce lib32ncurses6 etc. to the archive.
Attached is a patch which removes the readline multilib packages.

diff -Nru readline-7.0/debian/changelog readline-7.0/debian/changelog
--- readline-7.0/debian/changelog	2017-05-15 22:00:23.000000000 +0200
+++ readline-7.0/debian/changelog	2018-02-10 11:17:01.000000000 +0100
@@ -1,3 +1,10 @@
+readline (7.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Drop the multilib packages (Closes: #848168).
+
+ -- Sven Joachim <[email-masked]>  Sat, 10 Feb 2018 11:17:01 +0100
+
 readline (7.0-3) unstable; urgency=medium
 
   * Apply upstream patches 002 and 003. Closes: #852750.
diff -Nru readline-7.0/debian/control readline-7.0/debian/control
--- readline-7.0/debian/control	2017-01-24 16:19:24.000000000 +0100
+++ readline-7.0/debian/control	2017-11-05 17:21:36.000000000 +0100
@@ -4,11 +4,9 @@
 Maintainer: Matthias Klose <[email-masked]>
 Standards-Version: 3.9.8
 Build-Depends: debhelper (>= 9),
-  libtinfo-dev, lib32tinfo-dev [amd64 ppc64],
+  libtinfo-dev,
   libncursesw5-dev (>= 5.6),
-  lib32ncursesw5-dev [amd64 ppc64], lib64ncurses5-dev [i386 powerpc sparc s390],
-  mawk | awk, texinfo, autotools-dev,
-  gcc-multilib [amd64 i386 kfreebsd-amd64 powerpc ppc64 s390 sparc]
+  mawk | awk, texinfo, autotools-dev
 
 Package: libreadline7
 Architecture: any
@@ -25,19 +23,6 @@
  The GNU history library provides a consistent user interface for
  recalling lines of previously typed input.
 
-Package: lib64readline7
-Architecture: i386 powerpc s390 sparc
-Depends: readline-common, ${shlibs:Depends}, ${misc:Depends}
-Section: libs
-Priority: optional
-Description: GNU readline and history libraries, run-time libraries (64-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
 Package: readline-common
 Architecture: all
 Multi-Arch: foreign
@@ -74,21 +59,6 @@
  .
  This package contains development files.
 
-Package: lib64readline-dev
-Architecture: i386 powerpc s390 sparc
-Depends: lib64readline7 (= ${binary:Version}), ${devxx:Depends}, ${misc:Depends}
-Conflicts: lib64readline6-dev, lib64readline-gplv2-dev
-Provides: lib64readline6-dev
-Section: libdevel
-Priority: optional
-Description: GNU readline and history libraries, development files (64-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
 Package: libreadline7-dbg
 Architecture: any
 Depends: libreadline7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
@@ -119,34 +89,6 @@
  .
  See the ledit and rlwrap packages for other programs of that kind.
 
-Package: lib32readline7
-Architecture: amd64 ppc64
-Depends: readline-common, ${shlibs:Depends}, ${misc:Depends}
-Section: libs
-Priority: optional
-Description: GNU readline and history libraries, run-time libraries (32-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
-Package: lib32readline-dev
-Architecture: amd64 ppc64
-Depends: lib32readline7 (= ${binary:Version}), lib32tinfo-dev, ${devxx:Depends}, ${misc:Depends}
-Conflicts: lib32readline6-dev, lib32readline-gplv2-dev
-Provides: lib32readline6-dev
-Section: libdevel
-Priority: optional
-Description: GNU readline and history libraries, development files (32-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
 Package: readline-doc
 Architecture: all
 Multi-Arch: foreign
diff -Nru readline-7.0/debian/lib32readline7.symbols readline-7.0/debian/lib32readline7.symbols
--- readline-7.0/debian/lib32readline7.symbols	2016-01-08 08:46:21.000000000 +0100
+++ readline-7.0/debian/lib32readline7.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-libhistory.so.7 #PACKAGE# #MINVER#
-#include "libhistory7.symbols.common"
-libreadline.so.7 #PACKAGE# #MINVER#
-#include "libreadline7.symbols.common"
diff -Nru readline-7.0/debian/lib64readline7.symbols readline-7.0/debian/lib64readline7.symbols
--- readline-7.0/debian/lib64readline7.symbols	2016-01-08 08:46:41.000000000 +0100
+++ readline-7.0/debian/lib64readline7.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-libhistory.so.7 #PACKAGE# #MINVER#
-#include "libhistory7.symbols.common"
-libreadline.so.7 #PACKAGE# #MINVER#
-#include "libreadline7.symbols.common"
diff -Nru readline-7.0/debian/rules readline-7.0/debian/rules
--- readline-7.0/debian/rules	2016-01-08 09:21:54.000000000 +0100
+++ readline-7.0/debian/rules	2017-11-05 17:20:08.000000000 +0100
@@ -17,46 +17,6 @@
 CROSS=gcc
 endif
 
-ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/i386/powerpc/sparc/s390/))
-  build64 = yes
-  CC64 = $(CROSS) -m64
-  gencontrol_flags = -- \
-	'-Vdevxx:Depends=libc6-dev-$(ARCH64)'
-  ifeq ($(DEB_HOST_ARCH),i386)
-    ARCH64 = amd64
-    HOST64 = x86_64-linux-gnu
-  endif
-  ifeq ($(DEB_HOST_ARCH),powerpc)
-    ARCH64 = ppc64
-    HOST64 = ppc64-linux-gnu
-  endif
-  ifeq ($(DEB_HOST_ARCH),sparc)
-    ARCH64 = sparc64
-    HOST64 = sparc64-linux-gnu
-  endif
-  ifeq ($(DEB_HOST_ARCH),s390)
-    ARCH64 = s390x
-    HOST64 = s390x-linux-gnu
-  endif
-endif
-
-ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/amd64/ppc64/))
-  build32 = yes
-  CC32 = $(CROSS) -m32
-  lib32dir = lib32
-  lib32devdir = usr/lib32
-  gencontrol_flags = -- \
-	'-Vdevxx:Depends=libc6-dev-$(ARCH32)'
-  ifeq ($(DEB_HOST_ARCH),amd64)
-    ARCH32 = i386
-    HOST32 = i486-linux-gnu
-  endif
-  ifeq ($(DEB_HOST_ARCH),ppc64)
-    ARCH32 = powerpc
-    HOST32 = powerpc-linux-gnu
-  endif
-endif
-
 unexport CPPFLAGS CFLAGS LDFLAGS
 
 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
@@ -69,34 +29,22 @@
 SHELL	= bash
 
 p_rl	= libreadline$(soversion)
-p_rl32	= lib32readline$(soversion)
-p_rl64	= lib64readline$(soversion)
 p_comm	= readline-common
 p_rld	= libreadline-dev
-p_rld32	= lib32readline-dev
-p_rld64	= lib64readline-dev
 p_rlg	= $(p_rl)-dbg
 p_doc	= readline-doc
 p_rlfe	= rlfe
 
 d	= debian/tmp
-d32	= debian/tmp32
-d64	= debian/tmp64
 d_rl	= debian/$(p_rl)
-d_rl32	= debian/$(p_rl32)
-d_rl64	= debian/$(p_rl64)
 d_comm	= debian/$(p_comm)
 d_rld	= debian/$(p_rld)
-d_rld32	= debian/$(p_rld32)
-d_rld64	= debian/$(p_rld64)
 d_rlg	= debian/$(p_rlg)
 d_doc	= debian/$(p_doc)
 d_rlfe	= debian/$(p_rlfe)
 
 srcdir		= $(CURDIR)
 builddir	= $(CURDIR)/build
-builddir32	= $(CURDIR)/build32
-builddir64	= $(CURDIR)/build64
 
 default: build
 
@@ -113,22 +61,6 @@
 		--host=$(DEB_HOST_GNU_TYPE) \
 		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
 
-ifneq ($(build32),)
-	rm -rf $(builddir32)
-	mkdir $(builddir32)
-	cd $(builddir32) && \
-	  CC="$(CC32)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(srcdir)/configure \
-		--host=$(HOST32) --prefix=/usr
-endif
-
-ifneq ($(build64),)
-	rm -rf $(builddir64)
-	mkdir $(builddir64)
-	cd $(builddir64) && \
-	  CC="$(CC64)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(srcdir)/configure \
-		--host=$(HOST64) --prefix=/usr
-endif
-
 	touch configure-stamp
 
 ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
@@ -147,25 +79,6 @@
 	    SHOBJ_LDFLAGS='$(LDFLAGS) -shared' \
 	    SHLIB_LIBS="-ltinfo"
 
-ifneq ($(build32),)
-	$(MAKE) -C $(builddir32) \
-	    CC="$(CC32)" \
-	    CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
-	    SHOBJ_CFLAGS="-fPIC -D_REENTRANT" \
-	    SHOBJ_LDFLAGS='$(LDFLAGS) -shared' \
-	    SHLIB_LIBS="-ltinfo"
-	    SHLIB_XLDFLAGS='-Wl,-soname,`echo $$@ | sed s/\\..$$$$//`'
-endif
-
-ifneq ($(build64),)
-	$(MAKE) -C $(builddir64) \
-	    CC="$(CC64)" \
-	    CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
-	    SHOBJ_CFLAGS="-fPIC -D_REENTRANT" \
-	    SHOBJ_LDFLAGS='$(LDFLAGS) -shared' \
-	    SHLIB_LIBS="-ltinfo"
-	    SHLIB_XLDFLAGS='-Wl,-soname,`echo $$@ | sed s/\\..$$$$//`'
-endif
 	$(MAKE) -C $(builddir)/doc info
 
 	touch build-stamp
@@ -194,7 +107,7 @@
 	dh_testroot
 	rm -f configure*-stamp build*-stamp install-stamp
 	rm -rf autom4te.cache
-	rm -rf $(builddir) $(builddir32) $(builddir64)
+	rm -rf $(builddir)
 	rm -rf debian/tmp*
 	rm -f doc/*.dvi
 	rm -f debian/shlibs.local
@@ -291,74 +204,6 @@
 	cp -p debian/rlfe.1 $(d_rlfe)/usr/share/man/man1/.
 endif
 
-ifneq ($(build32),)
-	rm -rf $(d32)
-	mkdir -p $(d32)/usr/bin
-	$(MAKE) -C $(builddir32) install \
-	    CC="$(CC32)" \
-	    CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -D_REENTRANT" \
-	    SHOBJ_LDFLAGS='-shared $(LDFLAGS)' \
-	    SHLIB_XLDFLAGS='-Wl,-soname,`echo $$@ | sed s/\\..$$$$//`' \
-	    SHLIB_LIBS=-ltinfo \
-	    DESTDIR=$(CURDIR)/$(d32) \
-	    mandir=/usr/share/man \
-	    infodir=/usr/share/info
-
-	dh_installdirs -p$(p_rl32) \
-	    $(lib32dir) \
-	    usr/share/doc
-	cp -p $(d32)/usr/lib/lib{history,readline}.so.$(libversion) \
-		$(d_rl32)/$(lib32dir)/
-	ln -s libhistory.so.$(libversion) \
-		$(d_rl32)/$(lib32dir)/libhistory.so.$(soversion)
-	ln -s libreadline.so.$(libversion) \
-		$(d_rl32)/$(lib32dir)/libreadline.so.$(soversion)
-
-	dh_installdirs -p$(p_rld32) \
-	    $(lib32devdir) \
-	    usr/share/doc
-	ln -s /$(lib32dir)/libhistory.so.$(soversion) \
-		$(d_rld32)/$(lib32devdir)/libhistory.so
-	ln -s /$(lib32dir)/libreadline.so.$(soversion) \
-		$(d_rld32)/$(lib32devdir)/libreadline.so
-	mv $(d32)/usr/lib/lib{history,readline}.a $(d_rld32)/$(lib32devdir)/.
-endif
-
-ifneq ($(build64),)
-	rm -rf $(d64)
-	mkdir -p $(d64)/usr/bin
-	$(MAKE) -C $(builddir64) install \
-	    CC="$(CC64)" \
-	    CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -D_REENTRANT" \
-	    SHOBJ_LDFLAGS='-shared $(LDFLAGS)' \
-	    SHLIB_XLDFLAGS='-Wl,-soname,`echo $$@ | sed s/\\..$$$$//`' \
-	    SHLIB_LIBS=-ltinfo \
-	    DESTDIR=$(CURDIR)/$(d64) \
-	    mandir=/usr/share/man \
-	    infodir=/usr/share/info
-
-	dh_installdirs -p$(p_rl64) \
-	    lib64 \
-	    usr/share/doc
-	dh_installdirs -p$(p_rld64) \
-	    usr/share/doc
-	cp -p $(d64)/usr/lib/lib{history,readline}.so.$(libversion) \
-		$(d_rl64)/lib64/
-	ln -s libhistory.so.$(libversion) \
-		$(d_rl64)/lib64/libhistory.so.$(soversion)
-	ln -s libreadline.so.$(libversion) \
-		$(d_rl64)/lib64/libreadline.so.$(soversion)
-
-	dh_installdirs -p$(p_rld64) \
-	    usr/lib64 \
-	    usr/share/doc
-	ln -s /lib64/libhistory.so.$(soversion) \
-		$(d_rld64)/usr/lib64/libhistory.so
-	ln -s /lib64/libreadline.so.$(soversion) \
-		$(d_rld64)/usr/lib64/libreadline.so
-	mv $(d64)/usr/lib/lib{history,readline}.a $(d_rld64)/usr/lib64/.
-endif
-
 	: # $(p_doc)
 	mkdir -p $(d_doc)/usr/share/info
 	mv $(d)/usr/share/info/{readline.info,history.info} \
@@ -420,36 +265,6 @@
 		 -L $(p_rl) -l $(d_rl)/lib
 endif
 
-ifneq ($(build32),)
-	-ls -l $(d_rld)/usr/share/doc/$(p_rl)
-	dh_installdocs -p$(p_rl32) \
-		USAGE debian/inputrc.arrows
-	dh_installchangelogs -p$(p_rl32) CHANGES
-	ln -sf $(p_rl32) $(d_rld32)/usr/share/doc/$(p_rld32)
-	dh_compress -p$(p_rl32) -p$(p_rld32)
-	dh_fixperms -p$(p_rl32) -p$(p_rld32)
-	dh_strip --dbg-package=$(p_rlg) -p$(p_rl32) -p$(p_rld32)
-	dh_makeshlibs -p$(p_rl32)
-	-dh_shlibdeps -p$(p_rl32) -p$(p_rld32) \
-		 -L $(p_rl32) -l $(d_rl32)/lib
-	-ls -l $(d_rld)/usr/share/doc/$(p_rl)
-endif
-
-ifneq ($(build64),)
-	-ls -l $(d_rld)/usr/share/doc/$(p_rl)
-	dh_installdocs -p$(p_rl64) \
-		USAGE debian/inputrc.arrows
-	dh_installchangelogs -p$(p_rl64) CHANGES
-	ln -sf $(p_rl64) $(d_rld64)/usr/share/doc/$(p_rld64)
-	dh_compress -p$(p_rl64) -p$(p_rld64)
-	dh_fixperms -p$(p_rl64) -p$(p_rld64)
-	dh_strip --dbg-package=$(p_rlg) -p$(p_rl64) -p$(p_rld64)
-	dh_makeshlibs -p$(p_rl64)
-	-dh_shlibdeps -p$(p_rl64) -p$(p_rld64) \
-		 -L $(p_rl64) -l $(d_rl64)/lib
-	-ls -l $(d_rld)/usr/share/doc/$(p_rl)
-endif
-
 	dh_installdeb -s
 	dh_gencontrol -s $(gencontrol_flags)
 	dh_md5sums -s

---

From: Matthias Klose <[email-masked]>
Date: Sat, 10 Feb 2018 15:00:51 +0100

> generate incorrect dependencies for it.

well, this is an issue which should be filed against dpkg-shlipdeps. Did you
actually try to build that?

---

From: Sven Joachim <[email-masked]>
Date: Sat, 10 Feb 2018 18:09:59 +0100

> actually try to build that?

Here's an example which you should be able to reproduce.  The
grub-legacy package depends on multilib packages on amd64, since it's
32-bit only:

,----
| $ apt-cache show grub-legacy:amd64 | grep Depends
| Depends: lib32ncurses5 (>= 6), lib32tinfo5 (>= 6), libc6-i386 (>= 2.7), grub-common
`----

Let's try to build it with i386 packages instead of multilib:

,----
| $ apt-get source grub
| $ sed -i '/lib32ncurses5-dev/libncurses5-dev:i386/' grub-0.97/debian/control
`----

Build the package in a chroot with amd64 as native and i386 as foreign
architecture, I used pbuilder for that.  This is the result:

,----
| $ dpkg-deb -f grub-legacy_0.97-72_amd64.deb | grep Depends
| Depends: libc6 (>= 2.7), libncurses5 (>= 6), libtinfo5 (>= 6), grub-common
`----

The problem here is that the dependencies are not arch-qualified.

Cheers,
       Sven

---

From: Matthias Klose <[email-masked]>
Date: Sat, 10 Feb 2018 18:44:00 +0100

> The problem here is that the dependencies are not arch-qualified.

that's not how cross builds are supposed to work. build with dpkg-buildpackage
-a <target>. of course fixing / removing the libc6-i386 b-d.  And no, you can't
upload such a package to the archive. Everything with dependencies on foreign
archs gets rejected.  In the end we want to get away with multilibs, but it's
too early to remove that multilib support.

Matthias

---

From: Sven Joachim <[email-masked]>
Date: Sat, 10 Feb 2018 19:00:05 +0100

On 2018-02-10 18:44 +0100, Matthias Klose wrote:

> archs gets rejected.

Oh, I had not realized that you were talking about cross builds, sorry.

> In the end we want to get away with multilibs, but it's

I agree that gcc-multilib will have to be kept for some time, but I
still fail to see the use case for the readline multilib packages.

Cheers,
       Sven

---

From: Sven Joachim <[email-masked]>
Date: Fri, 16 Feb 2018 21:06:19 +0100

> existing readline multilib packages?

I still have not received an answer to this question, could you please
elaborate?

Cheers,
       Sven

---

From: Matthias Klose <[email-masked]>
Date: Sat, 17 Feb 2018 09:33:01 +0700

> I still have not received an answer to this question, could you please

it's still the same reason as before: to build a 64bit gdb on 32bit
architectures.  Yes, I know that the gdb maintainer has removed the 64bit gdb
package unfortunately, but why make it even more difficult to build such a
binary?  The gdb upstream sources come with readline sources, but not with
ncurses sources, so you definitely make it harder to build this.

---

From: Sven Joachim <[email-masked]>
Date: Sat, 17 Feb 2018 10:32:32 +0100

On 2018-02-17 09:33 +0700, Matthias Klose wrote:

> package unfortunately,

To which you did not really object, BTW.  At least I did not understand
"Did we stop building gdb64 packages for 32bit architectures?" in that
sense.

The original proposal in #775948, making gdb multiarch-coinstallable,
might still make sense.  OTOH, on i386 installing gdb:amd64 is already
possible, and for other architectures there is also gdb-multiarch.

> but why make it even more difficult to build such a binary?

The reasons why I filed #848163, and the great complexity in the ncurses
packaging due to multilib.  I know this is no problem for a guru like
you who likes complicated packages, but I am a mere mortal with limited
skills. :-(

Is there any problem building a 64-bit gdb on i386 after installing
libreadline-dev:amd64, libncurses5-dev:amd64 and possibly other useful
packages to give gdb more bells and whistles - the gdb64 package was
equivalent to gdb-minimal?

Cheers,
       Sven

---

From: Matthias Klose <[email-masked]>
Date: Sun, 18 Feb 2018 08:27:26 +0700

On 17.02.2018 16:32, Sven Joachim wrote:
> To which you did not really object, BTW.

was this announced somewhere outside the gdb packaging? In that case I might
have missed it.  And even then, I'm not a gdb packager.

> At least I did not understand

> possible, and for other architectures there is also gdb-multiarch.

No, I don't think that gdb-multiarch was covering all cases that gdb64 did.

> you who likes complicated packages, but I am a mere mortal with limited

well, even libtinfo had to be brought to you :-/

> equivalent to gdb-minimal?

this is only possible if both architectures are part of the release pocket, or
if you have matching versions of all packages in unstable. So at some times you
can do that in unstable, but you'll never be able to do that for release/testing
if one of these architectures is not part of the release.

Matthias