Package: libboost1.74-dev
Version: 1.74.0-8
Severity: serious
Tags: patch
User: debian...@lists.debian.org
Usertags: piuparts

libstdc++-dev is not a good virtual package to depend upon, since it is
provided by multiple packages:

bullseye# apt-get install libstdc++-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libstdc++-dev is a virtual package provided by:
  libstdc++-9-dev 9.3.0-22
  libstdc++-10-dev 10.2.1-6
You should explicitly select one to install.

E: Package 'libstdc++-dev' has no installation candidate

If apt has to choose, it may select the wrong one:

bullseye# apt-get install libboost1.74-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libstdc++-9-dev
Suggested packages:
  libboost1.74-doc libboost-atomic1.74-dev libboost-chrono1.74-dev 
libboost-container1.74-dev libboost-context1.74-dev libboost-contract1.74-dev 
libboost-coroutine1.74-dev libboost-date-time1.74-dev 
libboost-exception1.74-dev libboost-fiber1.74-dev
  libboost-filesystem1.74-dev libboost-graph1.74-dev 
libboost-graph-parallel1.74-dev libboost-iostreams1.74-dev 
libboost-locale1.74-dev libboost-log1.74-dev libboost-math1.74-dev 
libboost-mpi1.74-dev libboost-mpi-python1.74-dev libboost-numpy1.74-dev
  libboost-program-options1.74-dev libboost-python1.74-dev 
libboost-random1.74-dev libboost-regex1.74-dev libboost-serialization1.74-dev 
libboost-stacktrace1.74-dev libboost-system1.74-dev libboost-test1.74-dev 
libboost-thread1.74-dev libboost-timer1.74-dev
  libboost-type-erasure1.74-dev libboost-wave1.74-dev libboost1.74-tools-dev 
libmpfrc++-dev libntl-dev libboost-nowide1.74-dev libstdc++-9-doc
The following NEW packages will be installed:
  libboost1.74-dev libstdc++-9-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/11.2 MB of archives.
After this operation, 159 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

But worse, on upgrades from buster to bullseye libstdc++-8-dev would
have to be removed and libstdc++-10-dev would have to be installed to
perform a clean upgrade, but I've found with piuparts a few upgrade
paths where apt prefers to keep libstdc++-8-dev installed since it
provides libstdc++-dev. That causes the upgrade to fail, since apt
cannot find a valid upgrade path at al in these cases.

The attached patch exchanges this dependency to 
Upgrading to the packages with this patch applied fixes all the issues I
observed. I also tried a
  Depends: libstdc++-10-dev | libstdc++-dev
but that leaves us with the failure I initially observed

Andreas
diff -Nru boost1.74-1.74.0/debian/changelog boost1.74-1.74.0/debian/changelog
--- boost1.74-1.74.0/debian/changelog   2021-01-23 20:00:18.000000000 +0100
+++ boost1.74-1.74.0/debian/changelog   2021-03-08 16:18:55.000000000 +0100
@@ -1,3 +1,13 @@
+boost1.74 (1.74.0-8.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * libboost1.74-dev: Smoothen upgrades from buster by depending on
+    libstdc++-${gxx:major}-dev using the build-time version of g++ instead of
+    the virtual libstdc++-dev provided by multiple packages.
+    (Closes: #xxxxxx)
+
+ -- Andreas Beckmann <a...@debian.org>  Mon, 08 Mar 2021 16:18:55 +0100
+
 boost1.74 (1.74.0-8) unstable; urgency=medium
 
   * [85a2610] Fix compilation warnings. (Closes: #980497)
diff -Nru boost1.74-1.74.0/debian/control boost1.74-1.74.0/debian/control
--- boost1.74-1.74.0/debian/control     2021-01-23 19:37:38.000000000 +0100
+++ boost1.74-1.74.0/debian/control     2021-03-08 16:18:55.000000000 +0100
@@ -24,7 +24,7 @@
 Architecture: any
 Multi-Arch: same
 Section: libdevel
-Depends: ${misc:Depends}, ${shlibs:Depends}, libstdc++-dev
+Depends: ${misc:Depends}, ${shlibs:Depends}, libstdc++-${gxx:major}-dev
 Suggests: libboost1.74-doc,
  libboost-atomic1.74-dev,
  libboost-chrono1.74-dev,
diff -Nru boost1.74-1.74.0/debian/rules boost1.74-1.74.0/debian/rules
--- boost1.74-1.74.0/debian/rules       2020-12-25 23:26:58.000000000 +0100
+++ boost1.74-1.74.0/debian/rules       2021-03-08 16:18:55.000000000 +0100
@@ -343,6 +343,9 @@
        sed -i -r 's/^(libboost_numpy([0-9]{2}) \S+ (\S+).*)$$/\1, \3-py\2/' 
debian/libboost-numpy$(SOVERSION)/DEBIAN/shlibs
 endif
 
+override_dh_gencontrol:
+       dh_gencontrol -- -V'gxx:major=$(shell dpkg-query -f '$${version}' -W 
g++ | sed 's/.*://;s/\..*//')'
+
 $(b2):
        cd tools/build && bison -y -d -o src/engine/jamgram.cpp 
src/engine/jamgram.y
        ./bootstrap.sh --with-icu=/usr --prefix=$(CURDIR)/debian/tmp/usr \

Attachment: libkf5mailcommon-dev_4:20.08.3-1.log.gz
Description: application/gzip

Reply via email to