please fix building apt using gcc-snapshot

Bug #1477299 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Michael Vogt

Bug Description

please fix building apt using gcc-snapshot. I'd like to check the possible wrong-code issue with the GCC trunk version. The build fails with:

In file included from ../build/include/apt-pkg/algorithms.h:35:0,
                 from /scratch/doko/tmp/apt-1.0.9.10ubuntu4/cmdline/apt-get.cc:31:
../build/include/apt-pkg/depcache.h: In member function 'bool pkgDepCache::MarkAndSweep()':
../build/include/apt-pkg/depcache.h:406:11: warning: 'template<class> class std::auto_ptr' is deprecated [-Wd
eprecated-declarations]
      std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
           ^
In file included from /usr/lib/gcc-snapshot/include/c++/6.0.0/memory:81:0,
                 from ../build/include/apt-pkg/depcache.h:48,
                 from ../build/include/apt-pkg/algorithms.h:35,
                 from /scratch/doko/tmp/apt-1.0.9.10ubuntu4/cmdline/apt-get.cc:31:
/usr/lib/gcc-snapshot/include/c++/6.0.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
/scratch/doko/tmp/apt-1.0.9.10ubuntu4/cmdline/apt-get.cc: In function 'bool DoDownload(CommandLine&)':
/scratch/doko/tmp/apt-1.0.9.10ubuntu4/cmdline/apt-get.cc:633:36: error: no matching function for call to 'APT::CacheSetHelper::CacheSetHelper(std::ostream&)'
    APT::CacheSetHelper helper(c0out);
                                    ^
In file included from /scratch/doko/tmp/apt-1.0.9.10ubuntu4/cmdline/apt-get.cc:34:0:
../build/include/apt-pkg/cacheset.h:49:2: note: candidate: APT::CacheSetHelper::CacheSetHelper(bool, GlobalError::MsgType)
  CacheSetHelper(bool const ShowError = true,
  ^
../build/include/apt-pkg/cacheset.h:49:2: note: no known conversion for argument 1 from 'std::ostream {aka std::basic_ostream<char>}' to 'bool'
../build/include/apt-pkg/cacheset.h:39:7: note: candidate: constexpr APT::CacheSetHelper::CacheSetHelper(const APT::CacheSetHelper&)
 class CacheSetHelper { /*{{{*/
       ^

Related branches

Revision history for this message
Matthias Klose (doko) wrote :

debian/rules:

export CC = /usr/lib/gcc-snapshot/bin/gcc
export CXX = /usr/lib/gcc-snapshot/bin/g++
export CPP = /usr/lib/gcc-snapshot/bin/gcc -E
export CXXCPP = /usr/lib/gcc-snapshot/bin/g++ -E

and call the check target with

LD_LIBRARY_PAth=/usr/lib/gcc-snapshot/lib $(MAKE) test

Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
David Kalnischkies (donkult) wrote :

or the fix which is in the experimental branch for this issue for 2+ months now… ;)
353c135e45d3b76dbecc1ba1b2bd9266601181ee

I don't think the virtual package handling CacheSetHelperAPTGet provides is really needed (nor even wanted) for download or changelog, so we can just use the default helper – as before without a crazy non-sense std::ostream to bool conversion.

The auto_ptr think keeps being a warning for now, right? I am happily using c++11 features in (currently unreleased) patches, but I have my doubts if I should really force c++11 upon the reverse dependencies just now (as the auto_ptr gcc is warning about here is in a public header). Even through std=c++11 is the new default, right? Well, we will see after the gcc5 transition is done.

There are some more issues with apt build with gcc5 and running with the new libstdc++6, namely that some code pieces assume std::string to have copy-on-write behavior, which it doesn't have in c++11 mode anymore which can be observed by the integration tests – not run at buildtime, but by autopkgtest. Patches for that are in the experimental branch, too, for a while as they break the abi, but the step to gcc5 does break abi anyhow so who cares. ;)

mvo said he isn't around for a while, so I will try to polish up the sid-gcc5 branch he created and follow up at debbug#790979 then I am done hopefully later this weekend.

Revision history for this message
Matthias Klose (doko) wrote :

> Even through std=c++11 is the new default, right?

No. still the same as in 4.9. GCC 6 (currently gcc-snapshot) will default to c++14. For GCC 5, please use a standard explicitly, if you need it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.0.9.10ubuntu7

---------------
apt (1.0.9.10ubuntu7) wily; urgency=medium

  * cherry pick 353c135 to fix build failure with gcc-snapshot
    (LP: #1477299)

 -- Michael Vogt <email address hidden> Fri, 18 Sep 2015 10:02:55 +0200

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.