Subject: nanopolish: ftbfs with GCC-15

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

Package: src:nanopolish
Version: 0.14.0-1
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/nanopolish_0.14.0-1_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

[...]
      |                                                                   long int
src/nanopolish_polya_estimator.cpp: In function ‘void estimate_polya_for_single_read(const ReadDB&, const faidx_t*, FILE*, const bam_hdr_t*, const bam1_t*, size_t, int, int)’:
src/nanopolish_polya_estimator.cpp:765:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
  765 |             fprintf(out_fp, "%s\t%s\t%d\t-1.0\t-1.0\t-1.0\t-1.0\t-1.00\t-1.00\tREAD_FAILED_LOAD\n",
      |                                      ~^
      |                                       |
      |                                       int
      |                                      %ld
  766 |                 read_name.c_str(), ref_name.c_str(), record->core.pos);
      |                                                      ~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   long int
src/nanopolish_polya_estimator.cpp:823:35: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
  823 |         fprintf(out_fp, "%s\t%s\t%d\t%.1lf\t%.1lf\t%.1lf\t%.1lf\t%.2lf\t%.2lf\t%s\n",
      |                                  ~^
      |                                   |
      |                                   int
      |                                  %ld
  824 |                 read_name.c_str(), ref_name.c_str(), record->core.pos,
      |                                                      ~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   long int
make[2]: Leaving directory '/build/reproducible-path/nanopolish-0.14.0'
/usr/bin/make nanopolish_test
make[2]: Entering directory '/build/reproducible-path/nanopolish-0.14.0'
In file included from src/test/nanopolish_test.cpp:24:
./src/hmm/invgauss.hpp: In function ‘bool operator==(const inverse_gaussian_distribution<Real_Type>&, const inverse_gaussian_distribution<Real_Type>&)’:
./src/hmm/invgauss.hpp:37:127: error: ‘const class inverse_gaussian_distribution<Real_Type>’ has no member named ‘params’; did you mean ‘param’? [-Wtemplate-body]
   37 |     friend bool operator == (const inverse_gaussian_distribution& lhs, const inverse_gaussian_distribution& rhs) { return lhs.params() == rhs.params(); }
      |                                                                                                                               ^~~~~~
      |                                                                                                                               param
./src/hmm/invgauss.hpp:37:143: error: ‘const class inverse_gaussian_distribution<Real_Type>’ has no member named ‘params’; did you mean ‘param’? [-Wtemplate-body]
   37 |     friend bool operator == (const inverse_gaussian_distribution& lhs, const inverse_gaussian_distribution& rhs) { return lhs.params() == rhs.params(); }
      |                                                                                                                                               ^~~~~~
      |                                                                                                                                               param
./src/hmm/invgauss.hpp: In function ‘std::ostream& operator<<(std::ostream&, const inverse_gaussian_distribution<Real_Type>&)’:
./src/hmm/invgauss.hpp:42:17: error: ‘const class inverse_gaussian_distribution<Real_Type>’ has no member named ‘p’; did you mean ‘_p’? [-Wtemplate-body]
   42 |         os << d.p.first << " " << d.p.second;
      |                 ^
      |                 _p
./src/hmm/invgauss.hpp:42:37: error: ‘const class inverse_gaussian_distribution<Real_Type>’ has no member named ‘p’; did you mean ‘_p’? [-Wtemplate-body]
   42 |         os << d.p.first << " " << d.p.second;
      |                                     ^
      |                                     _p
make[2]: *** [Makefile:197: src/test/nanopolish_test.o] Error 1
make[2]: Leaving directory '/build/reproducible-path/nanopolish-0.14.0'
make[1]: *** [debian/rules:38: override_dh_auto_build] Error 2
make[1]: Leaving directory '/build/reproducible-path/nanopolish-0.14.0'
make: *** [debian/rules:27: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2