[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1008036: marked as done (apt: FTBFS with gcc-12)



Your message dated Mon, 21 Mar 2022 08:33:46 +0000
with message-id <E1nWDU2-000Caf-SQ@fasolo.debian.org>
and subject line Bug#1008036: fixed in apt 2.4.3
has caused the Debian Bug report #1008036,
regarding apt: FTBFS with gcc-12
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1008036: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008036
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: apt
Version: 2.4.2
Tags: ftbfs patch
User: helmutg@debian.org
Usertags: rebootstrap

apt fails to build from source when using gcc-12. The issues roughly
are:
 * Use of std::array without including #include <array>.
 * Use of deprecated std::iterator (twice).
 * Use of make_pair without std:: namespace.

Please consider applying the attached patch. I'll be cherry-picking this
into rebootstrap now, so there is no urgency from my side.

Helmut
diff --minimal -Nru apt-2.4.2/apt-pkg/cacheiterators.h apt-2.4.2+nmu1/apt-pkg/cacheiterators.h
--- apt-2.4.2/apt-pkg/cacheiterators.h	2022-03-17 09:17:27.000000000 +0100
+++ apt-2.4.2+nmu1/apt-pkg/cacheiterators.h	2022-03-21 05:31:39.000000000 +0100
@@ -44,8 +44,7 @@
 // abstract Iterator template						/*{{{*/
 /* This template provides the very basic iterator methods we
    need to have for doing some walk-over-the-cache magic */
-template<typename Str, typename Itr> class APT_PUBLIC pkgCache::Iterator :
-			public std::iterator<std::forward_iterator_tag, Str> {
+template<typename Str, typename Itr> class APT_PUBLIC pkgCache::Iterator {
 	/** \brief Returns the Pointer for this struct in the owner
 	 *  The implementation of this method should be pretty short
 	 *  as it will only return the Pointer into the mmap stored
@@ -61,6 +60,12 @@
 	pkgCache *Owner;
 
 	public:
+	// iterator_traits
+	using iterator_category = std::forward_iterator_tag;
+	using value_type = Str;
+	using difference_type = std::ptrdiff_t;
+	using pointer = Str*;
+	using reference = Str&;
 	// Iteration
 	inline bool end() const {return Owner == 0 || S == OwnerPointer();}
 
diff --minimal -Nru apt-2.4.2/apt-pkg/cacheset.h apt-2.4.2+nmu1/apt-pkg/cacheset.h
--- apt-2.4.2/apt-pkg/cacheset.h	2022-03-17 09:17:27.000000000 +0100
+++ apt-2.4.2+nmu1/apt-pkg/cacheset.h	2022-03-21 05:31:39.000000000 +0100
@@ -203,12 +203,16 @@
 };									/*}}}*/
 // Iterator templates for our Containers				/*{{{*/
 template<typename Interface, typename Master, typename iterator_type, typename container_iterator, typename container_value> class Container_iterator_base :
-   public std::iterator<typename std::iterator_traits<container_iterator>::iterator_category, container_value>,
    public Interface::template iterator_base<iterator_type>
 {
 protected:
 	container_iterator _iter;
 public:
+	using iterator_category = typename std::iterator_traits<container_iterator>::iterator_category;
+	using value_type = container_value;
+	using difference_type = std::ptrdiff_t;
+	using pointer = container_value*;
+	using reference = container_value&;
 	explicit Container_iterator_base(container_iterator const &i) : _iter(i) {}
 	inline container_value operator*(void) const { return static_cast<iterator_type const*>(this)->getType(); };
 	operator container_iterator(void) const { return _iter; }
diff --minimal -Nru apt-2.4.2/apt-pkg/depcache.cc apt-2.4.2+nmu1/apt-pkg/depcache.cc
--- apt-2.4.2/apt-pkg/depcache.cc	2022-03-17 09:17:27.000000000 +0100
+++ apt-2.4.2+nmu1/apt-pkg/depcache.cc	2022-03-21 05:31:39.000000000 +0100
@@ -2056,7 +2056,7 @@
 	 if (itsFine == false)
 	 {
 	    // change the candidate
-	    Changed.push_back(make_pair(V, TargetVer));
+	    Changed.push_back(std::make_pair(V, TargetVer));
 	    if (SetCandidateRelease(V, TargetRel, Changed) == false)
 	    {
 	       if (stillOr == false)
diff --minimal -Nru apt-2.4.2/debian/changelog apt-2.4.2+nmu1/debian/changelog
--- apt-2.4.2/debian/changelog	2022-03-17 09:17:27.000000000 +0100
+++ apt-2.4.2+nmu1/debian/changelog	2022-03-21 05:31:39.000000000 +0100
@@ -1,3 +1,10 @@
+apt (2.4.2+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with gcc-12. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Mon, 21 Mar 2022 05:31:39 +0100
+
 apt (2.4.2) unstable; urgency=medium
 
   [ Frans Spiesschaert ]
diff --minimal -Nru apt-2.4.2/test/interactive-helper/aptwebserver.cc apt-2.4.2+nmu1/test/interactive-helper/aptwebserver.cc
--- apt-2.4.2/test/interactive-helper/aptwebserver.cc	2022-03-17 09:17:27.000000000 +0100
+++ apt-2.4.2+nmu1/test/interactive-helper/aptwebserver.cc	2022-03-21 05:31:07.000000000 +0100
@@ -22,6 +22,7 @@
 #include <unistd.h>
 
 #include <algorithm>
+#include <array>
 #include <fstream>
 #include <iostream>
 #include <list>

--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 2.4.3
Done: Julian Andres Klode <jak@debian.org>

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1008036@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 21 Mar 2022 09:20:41 +0100
Source: apt
Architecture: source
Version: 2.4.3
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Closes: 1008036
Changes:
 apt (2.4.3) unstable; urgency=medium
 .
   [ Guillem Jover ]
   * Update .mailmap
 .
   [ David Kalnischkies ]
   * Fix build failure with gcc-12 due to missing include (Closes: #1008036)
   * Avoid using unqualified make_pair potentially triggering ftbfs
Checksums-Sha1:
 a05a24978cd9ab0017adb105a4c677cf17cd03cc 2797 apt_2.4.3.dsc
 caaf6f78386d10b0c693ab7a26d95924afa36f61 2216172 apt_2.4.3.tar.xz
 528adf9559dbaff603c7883c37d8ad1a961446fd 7531 apt_2.4.3_source.buildinfo
Checksums-Sha256:
 1596dc1289a04a1ce46e3285a7fae6bdc91bbe6a89cf54736fbde636ff93aea8 2797 apt_2.4.3.dsc
 5a7215ca924302da0b2205862cd2d651326eea222a589184ec6ce663885729f7 2216172 apt_2.4.3.tar.xz
 07e7315ab97bd2a9846a9b35f0332b12905ba3dac21a912947925f77fe9cb71a 7531 apt_2.4.3_source.buildinfo
Files:
 1011a73057539abff692029976ae6db5 2797 admin important apt_2.4.3.dsc
 5719dc5d031f47723630464c481da81f 2216172 admin important apt_2.4.3.tar.xz
 41796745f95b7a81b8590f7454323863 7531 admin important apt_2.4.3_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEET7WIqEwt3nmnTHeHb6RY3R2wP3EFAmI4NjYPHGpha0BkZWJp
YW4ub3JnAAoJEG+kWN0dsD9xTNYP/j+zwQmP4z9k/U6WvUIPqHRq8mGD+eD1zKPw
ZfQnUuzbvvQvFYblY6ecyifkPOcrIL6PY2EScXcb9aFrnrnuV/HxaMmX+1kTBjIP
vuMNQihMDgAJdFX1ZDhakVuEHws2alI1h0Kyr7okxnP7R7aY3GK48wj5Lhjv8yBn
etAjcarHzVOK3HIQ8lReyle9Yp2qz95CWzEorVQTiJ1w5JQlOKdtc8qCsHwtPzOf
3b2tC1ZCM9BJmg0y3335Xh1Cbw+W9W73XXkkNZrx06eNIk315pxj2v75z87jrG3X
XbWVBx+MrGxqwK8SlT5JUIDi4JTZSX6U8z6mOWsPWbApw9r6FiRSb9hD+ITN3Tic
TjOU/46wAlf/ycfWbSpo/DvDujErijeEXDV9a9ACKa01rI63dPt8wXkGdz2vroba
0cFY427/9mdYH8jpU3EzVg+aRElMBBcAE6S+NwpnX7Wkv26d4bsoBDeaGeqqGG8B
m1Am6z0dpAt00hDuaFWtG+qhwjJLxRVJTKUv5Whg6nZZujLewCaBr2NNl097FWVs
mXpGwDowqwrMUjgi82sa+BB9dh1xuQjYRe1qiQZacUbVVUBF3sR6JZOtxHxE15wy
h8htTGvDKDQCuoSAejV2Jf8I5r9iRoMf4s3YE7bKbrD5aF0uKcwp3JizwQA1OiWt
8Skkv32P
=m7cn
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: