Subject: apt: ftbfs with GCC-15

From: Matthias Klose <[email-masked]>
Date: Mon, 17 Feb 2025 17:03:33 +0000

Package: src:apt
Version: 2.9.29
Severity: important
Tags: sid forky
User: [email-masked]
Usertags: ftbfs-gcc-15

[This bug is NOT targeted to the upcoming trixie release]

Please keep this issue open in the bug tracker for the package it
was filed for.  If a fix in another package is required, please
file a bug for the other package (or clone), and add a block in this
package. Please keep the issue open until the package can be built in
a follow-up test rebuild.

The package fails to build in a test rebuild on at least amd64 with
gcc-15/g++-15, but succeeds to build with gcc-14/g++-14. The
severity of this report will be raised before the forky release.

The full build log can be found at:
http://qa-logs.debian.net/2025/02/16/amd64exp/apt_2.9.29_unstable_gccexp.log.gz
The last lines of the build log are at the end of this report.

To build with GCC 15, either set CC=gcc-15 CXX=g++-15 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++ 

GCC 15 now defaults to the C23/C++23 standards, exposing many FTBFS.
Other Common build failures are new warnings resulting in build failures
with -Werror turned on, or new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-15/porting_to.html

[...]
[1/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/apt-pkg && echo "APTPKG_6.0 {global: *; };" > /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/apt-pkg/apt-pkg.versionscript
[2/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/apt-private && echo "APTPRIVATE_0.0 {global: *; };" > /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/apt-private/apt-private.versionscript
[3/1066] cd /build/reproducible-path/apt-2.9.29 && xgettext --add-comments --from-code=utf-8 --foreign --package-name=apt --package-version=2.9.29 "--msgid-bugs-address=APT Development Team <[email-masked]>" -L Shell -o /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/po/apt.sh.pot dselect/install dselect/update
dselect/install:33: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:52: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:84: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:88: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:92: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:95: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:102: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:103: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:104: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:105: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/install:106: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/update:30: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
dselect/update:45: warning: the syntax $"..." is deprecated due to security reasons; use eval_gettext instead
[5/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt && /usr/bin/cmake -Dcfgdir= -P /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt/gtest/tmp/gtest-mkdirs.cmake && /usr/bin/cmake -E touch /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt/gtest/src/gtest-stamp/gtest-mkdir
[7/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt/gtest/src/gtest-stamp/gtest-download
[8/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt/gtest/src/gtest-stamp/gtest-update
[10/1066] cd /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /build/reproducible-path/apt-2.9.29/obj-x86_64-linux-gnu/test/libapt/gtest/src/gtest-stamp/gtest-patch
FAILED: apt-pkg/CMakeFiles/apt-pkg.dir/contrib/strutl.cc.o 
/build/reproducible-path/apt-2.9.29/apt-pkg/contrib/strutl.cc: In function ‘std::string Base64Encode(const std::string&)’:
/build/reproducible-path/apt-2.9.29/apt-pkg/contrib/strutl.cc:597:7: error: ‘uint8_t’ was not declared in this scope
  597 |       uint8_t Bits[3] = {0,0,0};
      |       ^~~~~~~
/build/reproducible-path/apt-2.9.29/apt-pkg/contrib/strutl.cc:52:8: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   51 | #include <apti18n.h>
  +++ |+#include <cstdint>
   52 |                                                                         /*}}}*/
/build/reproducible-path/apt-2.9.29/apt-pkg/contrib/strutl.cc:598:7: error: ‘Bits’ was not declared in this scope
  598 |       Bits[0] = I[0];
      |       ^~~~
ninja: build stopped: subcommand failed.
dh_auto_build: error: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 ninja -j8 -v returned exit code 1
make: *** [debian/rules:21: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2