Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916438 - mail-filter/rspamd-3.6-r1 fails to build with gcc14
Summary: mail-filter/rspamd-3.6-r1 fails to build with gcc14
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Petr Vaněk
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: gcc-14
  Show dependency tree
 
Reported: 2023-10-28 16:54 UTC by Kim B. Sindalsen
Modified: 2023-11-17 11:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,555.45 KB, text/plain)
2023-10-28 18:02 UTC, Kim B. Sindalsen
Details
build.log - with #include <algorithm> (build2.log,574.37 KB, text/plain)
2023-10-29 07:19 UTC, Kim B. Sindalsen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim B. Sindalsen 2023-10-28 16:54:02 UTC
Fails to compile with gcc14, compiles fine with gcc 13

Portage 3.0.51 (python 3.11.5-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-14, glibc-2.37-r7, 6.1.60-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-6.1.60-gentoo-x86_64-x86_64-12th_Gen_Intel-R-_Core-TM-_i7-1270P-with-glibc2.37
KiB Mem:     8148524 total,   1265704 free
KiB Swap:    6291452 total,   6254588 free
Timestamp of repository guru: Sat, 28 Oct 2023 07:46:46 +0000
Head commit of repository guru: 429f3a9d7f21e497d38762006f9167d7b62ef07c

Timestamp of repository gentoo: Sat, 28 Oct 2023 01:30:01 +0000
Head commit of repository gentoo: 0911fe2b3fb47a3bf0594ebe18c8570664f12b66
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.5::gentoo
dev-lang/rust-bin:         1.71.1::gentoo
dev-util/cmake:            3.26.5-r2::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.2.1_p20230826::gentoo, 14.0.0_pre20231022-r1::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r7::gentoo
Repositories:

local
    location: /var/db/repos/local
    sync-type: rsync
    sync-uri: rsync://ns.vlh.dk/vlh-portage
    masters: gentoo
    priority: -1
    volatile: False
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts:

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://ns.vlh.dk/gentoo-portage
    priority: 1
    volatile: False
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -Werror=strict-aliasing -Werror=odr -Werror=lto-type-mismatch -fgraphite-identity -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=2 -fuse-linker-plugin -fno-fat-lto-objects -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -Werror=strict-aliasing -Werror=odr -Werror=lto-type-mismatch -fgraphite-identity -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=2 -fuse-linker-plugin -fno-fat-lto-objects -ftree-vectorize -flifetime-dse=1"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--binpkg-respect-use=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=native -Werror=strict-aliasing -Werror=odr -Werror=lto-type-mismatch -fgraphite-identity -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=2 -fuse-linker-plugin -fno-fat-lto-objects -ftree-vectorize"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -Werror=strict-aliasing -Werror=odr -Werror=lto-type-mismatch -fgraphite-identity -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=2 -fuse-linker-plugin -fno-fat-lto-objects -ftree-vectorize"
GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.halifax.rwth-aachen.de/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirror.netcologne.de/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-fuse-ld=mold -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -Werror=strict-aliasing -Werror=odr -Werror=lto-type-mismatch -fgraphite-identity -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=2 -fuse-linker-plugin -fno-fat-lto-objects -ftree-vectorize -flifetime-dse=1 -Wl,--defsym=__gentoo_check_ldflags__=0"
LEX="flex"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="http://ns.vlh.dk/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="acl amd64 berkdb bzip2 caps cli crypt dri fortran geoip2 hardened iconv idn ipv6 jemalloc libtirpc lto mysql ncurses nls nptl openmp pam pcre pgo pie readline seccomp split-usr ssl ssp syslog test-rust udev unicode usb verify-sig xattr xml xtpax zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" PHP_TARGETS="php8-1" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS



Reproducible: Always




build.log from gcc14 - http://0x0.st/HyaG.txt

I *think* the error is here:
/var/tmp/portage/mail-filter/rspamd-3.6-r1/work/rspamd-3.6/src/libstat/backends/http_backend.cxx:264:49: error: cannot convert ‘std::vector<rspamd_statfile*>::i
terator’ to ‘const char*’
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-28 17:43:36 UTC
Please always include build.logs as an attachment, not a link to a paste service.
Comment 2 Kim B. Sindalsen 2023-10-28 18:02:07 UTC
Created attachment 873608 [details]
build.log

build.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 05:50:35 UTC
/var/tmp/portage/mail-filter/rspamd-3.6-r1/work/rspamd-3.6/src/libstat/backends/http_backend.cxx: In member function ‘bool rspamd::stat::http::http_backends_collection::remove_backend(rspamd_statfile*)’:
/var/tmp/portage/mail-filter/rspamd-3.6-r1/work/rspamd-3.6/src/libstat/backends/http_backend.cxx:264:49: error: cannot convert ‘std::vector<rspamd_statfile*>::iterator’ to ‘const char*’
  264 |         auto backend_it = std::remove(std::begin(backends), std::end(backends), st);
      |                                       ~~~~~~~~~~^~~~~~~~~~
      |                                                 |
      |                                                 std::vector<rspamd_statfile*>::iterator
In file included from /var/tmp/portage/mail-filter/rspamd-3.6-r1/work/rspamd-3.6_build/src/config.h:246,
                 from /var/tmp/portage/mail-filter/rspamd-3.6-r1/work/rspamd-3.6/src/libstat/backends/http_backend.cxx:17:
/usr/include/stdio.h:152:32: note:   initializing argument 1 of ‘int remove(const char*)’
  152 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~

Can you try adding a <algorithm> include in http_backend.cxx?

(There's a bug here in the compiler should give a fixit, too.)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 05:51:30 UTC
(arkamar, do you fancy coming up with some small example of this where it gives that horrible error with no suggestion to include algorithm? cvise should be able to help)
Comment 5 Kim B. Sindalsen 2023-10-29 07:19:48 UTC
Created attachment 873634 [details]
build.log - with #include <algorithm>

New build.log after manually adding #include <algorithm> to src/libstat/backends/http_backend.cxx
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-29 07:22:14 UTC
try adding <algorithm> to mime_string.hxx too
Comment 7 Kim B. Sindalsen 2023-10-29 07:32:00 UTC
Added #include <algorithm> to both

src/libstat/backends/http_backend.cxx
src/libmime/mime_string.hxx

And it compiles fine.
Comment 8 Petr Vaněk gentoo-dev 2023-10-29 19:07:23 UTC
(In reply to Sam James from comment #4)
> (arkamar, do you fancy coming up with some small example of this where it
> gives that horrible error with no suggestion to include algorithm? cvise
> should be able to help)

I will give it a shot in following days. 3.7.3 has the same issue.
Comment 9 Petr Vaněk gentoo-dev 2023-10-30 10:26:11 UTC
I was able to minimize it to this:

```
#include <functional>
#include <stdexcept>
struct test;
std::vector<test *> v;
auto f(test *t) {
  auto it = std::remove(begin(v), end(v), t);
}
```

It builds fine with gcc-13 but gcc-14 produces similar error to original one:

test.cxx: In function _auto f(test*)_:
test.cxx:6:30: error: cannot convert _std::vector<test*>::iterator_ to _const char*_
    6 |   auto it = std::remove(begin(v), end(v), t);
      |                         ~~~~~^~~
      |                              |
      |                              std::vector<test*>::iterator
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/cstdio:42,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/ext/string_conversions.h:45,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/basic_string.h:4158,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/string:54,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/stdexcept:39,
                 from test.cxx:2:
/usr/include/stdio.h:157:32: note:   initializing argument 1 of _int remove(const char*)_
  157 | extern int remove (const char *__filename) __THROW;
      |
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-30 10:28:37 UTC
Thanks. The failing to build is fine (libstdc++ changes transitive includes regularly between releases - see e.g. https://gcc.gnu.org/gcc-13/porting_to.html (page for 14 isn't there yet)), but the terrible error message without a fixit is not.

Do you want me to report it, requesting a better error message + fixit, or do you want to?
Comment 11 Petr Vaněk gentoo-dev 2023-10-30 11:00:11 UTC
I will report it.
Comment 12 Petr Vaněk gentoo-dev 2023-10-30 13:54:33 UTC
reported to gcc
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-31 05:57:14 UTC
Thanks!

jwakely has added https://gcc.gnu.org/git/?p=gcc-wwwdocs.git;a=commit;h=f83141b2c816b09a2dd44ea5a84d868b7f0e50e7 -> https://gcc.gnu.org/gcc-14/porting_to.html now too so we can link to that in upstream commit msgs.
Comment 14 Petr Vaněk gentoo-dev 2023-11-01 12:15:08 UTC
Issue is fixed in upstream https://github.com/rspamd/rspamd/commit/249939dfcb2244ba83d5ceb2b50a0429f53b23f1
Comment 15 Larry the Git Cow gentoo-dev 2023-11-17 11:09:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba1af88fd6f662102ff33d552461b8045ec0a9bf

commit ba1af88fd6f662102ff33d552461b8045ec0a9bf
Author:     Petr Vaněk <arkamar@atlas.cz>
AuthorDate: 2023-11-14 15:48:03 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-17 11:07:57 +0000

    mail-filter/rspamd: add 3.7.4
    
    Unneeded dependencies detected by qa-vdb:
    - sys-apps/file  - Upstream does not use it since version 2.0, see [1].
    - dev-libs/libev - Upstream bundles this library since version 2.0,
                       see [2]. It contains few incompatible changes [3-5],
                       which make unbundling currently unfeasible.
    
    dev-libs/libfmt and dev-libs/xxhash are DEPEND only, detected by qa-vdb.
    Upstream uses them both in inline mode, see [6] and [7], respecitvely.
    
    Upstream bundles backward-cpp [8] since version 3.7.1. It was necessary
    to disable its auto-detection property. The last release was in 2021, so
    I decided to keep it bundled for now.
    
    This version also contains the fix for GCC 14, see bug 916438.
    
    [1] https://github.com/rspamd/rspamd/commit/56e236efa012c4be6b3893314ce4d3a570e16327
    [2] https://github.com/rspamd/rspamd/commit/5376c8a25208ae4c7c21c2ff1894a5ebb2df6340
    [3] https://github.com/rspamd/rspamd/commit/7c4eb706c124806d254af6033c7023ee488b2c6c
    [4] https://github.com/rspamd/rspamd/commit/b3713de7cefa87af9ed95d091db497cef63502d0
    [5] https://github.com/rspamd/rspamd/commit/0194245dcdbecfb34088339689668fd6c1111cb8
    [6] https://github.com/rspamd/rspamd/blob/3.7.3/CMakeLists.txt#L264
    [7] https://github.com/rspamd/rspamd/blob/3.7.3/src/libcryptobox/cryptobox.c#L30-L31
    [8] https://github.com/bombela/backward-cpp
    
    Closes: https://bugs.gentoo.org/916438
    Closes: https://bugs.gentoo.org/916488
    Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
    Signed-off-by: Sam James <sam@gentoo.org>

 mail-filter/rspamd/Manifest            |   1 +
 mail-filter/rspamd/rspamd-3.7.4.ebuild | 152 +++++++++++++++++++++++++++++++++
 2 files changed, 153 insertions(+)