#1034369 libcereal: autopkgtest regression on non x86: cc1plus: all warnings being treated as errors

#1034369#5
Date:
2023-04-13 18:00:27 UTC
From:
To:
Dear maintainer(s),

Your package has an autopkgtest, great. However, it fails on all
architectures except amd64 and i386 since August 2022. Can you please
investigate the situation and fix it? I copied some of the output at the
bottom of this report. (src:gcc-defaults switching to gcc-12 migrated on
2022-08-10 to testing)

The release team has announced [1] that failing autopkgtest on amd64 and
arm64 are considered RC in testing. [Release Team member hat on] Because
we're currently in the hard freeze for bookworm, I have marked this bug
as bookworm-ignore. Targeted fixes are still welcome.

More information about this bug and the reason for filing it can be
found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://lists.debian.org/debian-devel-announce/2019/07/msg00002.html

https://ci.debian.net/data/autopkgtest/testing/arm64/libc/libcereal/32116422/log.gz

[ 25%] Building CXX object unittests/CMakeFiles/test_map.dir/map.cpp.o
In file included from
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:28:
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:
In instantiation of ‘void test_map() [with IArchive =
cereal::BinaryInputArchive; OArchive = cereal::BinaryOutputArchive]’:
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:34:68:
   required from here
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43:
error: narrowing conversion of ‘random_value<char>(gen)’ from
‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’
[-Werror=narrowing]
    65 |       o_esplmap.insert({random_value<char>(gen),  {
random_value<int>(gen), random_value<int>(gen) }});
       |                         ~~~~~~~~~~~~~~~~~~^~~~~
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:
In instantiation of ‘void test_map() [with IArchive =
cereal::PortableBinaryInputArchive; OArchive =
cereal::PortableBinaryOutputArchive]’:
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:39:84:
   required from here
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43:
error: narrowing conversion of ‘random_value<char>(gen)’ from
‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’
[-Werror=narrowing]
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:
In instantiation of ‘void test_map() [with IArchive =
cereal::XMLInputArchive; OArchive = cereal::XMLOutputArchive]’:
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:44:62:
   required from here
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43:
error: narrowing conversion of ‘random_value<char>(gen)’ from
‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’
[-Werror=narrowing]
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:
In instantiation of ‘void test_map() [with IArchive =
cereal::JSONInputArchive; OArchive = cereal::JSONOutputArchive]’:
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:49:64:
   required from here
/tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43:
error: narrowing conversion of ‘random_value<char>(gen)’ from
‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’
[-Werror=narrowing]
cc1plus: all warnings being treated as errors
make[2]: *** [unittests/CMakeFiles/test_map.dir/build.make:76:
unittests/CMakeFiles/test_map.dir/map.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:556:
unittests/CMakeFiles/test_map.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

#1034369#12
Date:
2023-04-14 05:46:04 UTC
From:
To:
Hi,

I guess the fix will boil down to a type casting in this line

https://salsa.debian.org/med-team/libcereal/-/blob/master/unittests/map.hpp#L65

     o_esplmap.insert({random_value<char>(gen),  { random_value<int>(gen), random_value<int>(gen) }});

unfortunately my C++ knowledge is too limited to know whether it is
really that simple nor how exactly this line needs to be fixed.  The fix
should be tested at least on arm64 (since the test passes on amd64).

Any help would be welcome
    Andreas.

Am Thu, Apr 13, 2023 at 08:00:27PM +0200 schrieb Paul Gevers:

#1034369#19
Date:
2023-04-14 10:59:09 UTC
From:
To:
I opened an issue upstream
#1034369#26
Date:
2023-04-14 13:37:59 UTC
From:
To:
tags 1034369 + patch
thanks

Andreas Tille <andreas@an3as.eu> writes:

#1034369 looks very similar to #1021394, which worked around
corresponding build-time errors by disabling -Werror but I see left the
autopkgtest's cmake invocation as is; there may be merit in disabling
-Werror on that front too.  At any rate, I would recommend properly
addressing the compiler's concerns by changing random_value<char> to
random_value<int8_t> here and in the other unittests/*map.hpp headers to
match the corresponding containers' declarations, per the attached
patch.  The relevant platform difference is whether plain char is
signed, as it notably is on x86 but not arm*.  (There are other
architectures in each camp.)

#1034369#33
Date:
2023-04-14 19:48:57 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
libcereal, 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 1034369@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Tille <tille@debian.org> (supplier of updated libcereal 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)
Format: 1.8
Date: Fri, 14 Apr 2023 19:18:06 +0200
Source: libcereal
Architecture: source
Version: 1.3.2+dfsg-5
Distribution: unstable
Urgency: medium
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Changed-By: Andreas Tille <tille@debian.org>
Closes: 1034369
Changes:
 libcereal (1.3.2+dfsg-5) unstable; urgency=medium
 .
   * Team upload.
 .
   [ Aaron M. Ucko ]
   * Fix autopkgtest regression on non x86: cc1plus: all warnings being
     treated as errors
     Closes: #1034369
Checksums-Sha1:
 c7a786162a722bb7c1d8f1fa6641ba0ed35e05f8 2188 libcereal_1.3.2+dfsg-5.dsc
 29153438af159f116391f07d7a5427e1acd87d40 7972 libcereal_1.3.2+dfsg-5.debian.tar.xz
 5ffd327f2a256f96b1be2deaccad6aa885c962eb 7655 libcereal_1.3.2+dfsg-5_amd64.buildinfo
Checksums-Sha256:
 80caaafb4c9cfa7ef541a0488221e284a8784babb2d475c8d3ab2f03e6074261 2188 libcereal_1.3.2+dfsg-5.dsc
 f1bd148cbf2796aea5c4503a158356055af8d4ba26914c25f7f6d0c962c76a74 7972 libcereal_1.3.2+dfsg-5.debian.tar.xz
 85df6c191bf8f9de53f73ab72a87f2459008e2e032d2edc443350a6ab77cb285 7655 libcereal_1.3.2+dfsg-5_amd64.buildinfo
Files:
 f7591dacde13100ec3e41ed10ca7bfc3 2188 libdevel optional libcereal_1.3.2+dfsg-5.dsc
 61087aaf473478ac731aa378828757bd 7972 libdevel optional libcereal_1.3.2+dfsg-5.debian.tar.xz
 a8a09779849ef73c62ac55bb350b8847 7655 libdevel optional libcereal_1.3.2+dfsg-5_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmQ5qKYRHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtGB/w/9EqnWDZPwEBMD9+80O8s0Yuh0MXrrPkf6
mpGHFz0PFKDTZRwt2v4e1UlGo7hc7lcUktYYn0RS/4XfdEvAZOjL53lGJnHR8QMB
s/MNvkdtJCViQOSCw1DGwIDLw1BJmcpz13A1QMrlIM82drB+fBIa77a6YrzfNf2+
PSl9f1mzxAgLmOIKDj29oakOl8aYOy2UJzuifjGxjNMilcxBI/B38Xtz2CBVyc96
QP9m264h/PZrZzVMaWZk41LqyUKYTAzGviye7FXQDyucn8Udbo5Et+xm6wDkmsxe
dya4mFJTTSpmIiZcoQKxdmzmK3XpFFIp+KvTVY/1VoUCaMRsYVijmbLtQFkNvpiy
ZSdrwprSlVqXYQMDyPLg5s+VcJR/X1RMXmuqeCrOBZVvBAfJmO24dWiF9kV+Arvr
1JIFTeBlrNNVhPeXeZXx/E2CiHnUlTbz/Of39y2+F7efcflFKRPlD0CYsWDlA9bI
qti6pF0zxhOklm7zXW6nzM44MCQwiE0USPEwChwFDkmYMcuof5H8dh80rRjRCcp2
mZ+3sdMa75pPcnD4/uvWunWrnFvv+qX9Ybvm0yFZN2DYTVybrKvH2tIwx9Ris4fb
wdP2hppT72tAImRBJOm3E6+oMS2m0jCuaKKhgIIHIC1InYpexOPjzSOXqCJL2i0y
NVu18UAsrs8=
=B6DS
-----END PGP SIGNATURE-----