#1133443 cockpit: ftbfs with GCC-16

Package:
src:cockpit
Source:
src:cockpit
Submitter:
Emanuele Rocca
Date:
2026-05-13 02:45:12 UTC
Severity:
normal
Tags:
#1133443#5
Date:
2026-04-13 13:02:02 UTC
From:
To:
Hi,

cockpit fails to build in a test rebuild on at least amd64 and arm64 with
gcc-16/g++-16, but builds properly with gcc-15/g++-15. The severity of this
report will be raised before the forky release.

The full build log can be found at:
https://people.debian.org/~ema/gcc-16-rebuilds/output-1/cockpit_arm64.build.xz

The last lines of the build log are at the end of this report.

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

  apt-get -t=experimental install g++

Common build failures include unused (but set) variables, array subscripts
partly outside array bounds, and new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-16/porting_to.html

Please only close this issue after double-checking that the package can be
built correctly with GCC 16.

Please do not reassign this bug to another package. If a fix in another package
is required, then file a bug for the other package (or clone), and mark this
bug as blocked by the bug in the other package.

[...]


test/pytest/test_samples.py::test_cpu_temperature PASSED                 [ 79%]
test/pytest/test_samples.py::test_cgroup_disk_io PASSED                  [ 80%]
test/pytest/test_transport.py::TestSpooler::test_bad_fd PASSED           [ 80%]
test/pytest/test_transport.py::TestSpooler::test_poll_eof PASSED         [ 81%]
test/pytest/test_transport.py::TestSpooler::test_nopoll_eof PASSED       [ 81%]
test/pytest/test_transport.py::TestSpooler::test_poll_small PASSED       [ 82%]
test/pytest/test_transport.py::TestSpooler::test_nopoll_small PASSED     [ 83%]
test/pytest/test_transport.py::TestSpooler::test_big PASSED              [ 83%]
test/pytest/test_transport.py::TestEpollLimitations::test_read_file XFAIL [ 84%]
test/pytest/test_transport.py::TestEpollLimitations::test_dev_null XFAIL [ 85%]
test/pytest/test_transport.py::TestStdio::test_terminal_write_eof PASSED [ 85%]
test/pytest/test_transport.py::TestStdio::test_terminal_disconnect PASSED [ 86%]
test/pytest/test_transport.py::TestSubprocessTransport::test_true PASSED [ 86%]
test/pytest/test_transport.py::TestSubprocessTransport::test_cat PASSED  [ 87%]
test/pytest/test_transport.py::TestSubprocessTransport::test_send_signal PASSED [ 88%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pid PASSED  [ 88%]
test/pytest/test_transport.py::TestSubprocessTransport::test_terminate PASSED [ 89%]
test/pytest/test_transport.py::TestSubprocessTransport::test_stderr PASSED [ 90%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS PASSED [ 90%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS_nonzero_exit PASSED [ 91%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS_exit_code PASSED [ 91%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS_signal PASSED [ 92%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS_kill PASSED [ 93%]
test/pytest/test_transport.py::TestSubprocessTransport::test_pidfd_ENOSYS_concurrent PASSED [ 93%]
test/pytest/test_transport.py::TestSubprocessTransport::test_true_pty PASSED [ 94%]
test/pytest/test_transport.py::TestSubprocessTransport::test_broken_pipe PASSED [ 95%]
test/pytest/test_transport.py::TestSubprocessTransport::test_broken_pipe_backlog PASSED [ 95%]
test/pytest/test_transport.py::TestSubprocessTransport::test_window_size PASSED [ 96%]
test/pytest/test_transport.py::TestSubprocessTransport::test_env PASSED  [ 96%]
test/pytest/test_transport.py::TestSubprocessTransport::test_simple_close PASSED [ 97%]
test/pytest/test_transport.py::TestSubprocessTransport::test_flow_control PASSED [ 98%]
test/pytest/test_transport.py::TestSubprocessTransport::test_write_backlog_eof PASSED [ 98%]
test/pytest/test_transport.py::TestSubprocessTransport::test_write_backlog_close PASSED [ 99%]
test/pytest/test_transport.py::TestSubprocessTransport::test_write_backlog_eof_and_close PASSED [100%]

=================================== FAILURES ===================================

test/pytest/test_bridge.py:422:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/pytest/mocktransport.py:66: in check_open
    await self.assert_msg('', command='close', channel=ch, problem=problem, absent_keys=absent_keys,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <test.pytest.mocktransport.MockTransport object at 0xff010723cdd0>
expected_channel = '', absent_keys = ()
kwargs = {'channel': 'channel.1', 'command': 'close', 'problem': 'access-denied'}
msg = {'channel': 'channel.1', 'command': 'done'}

    async def assert_msg(self, expected_channel: str, absent_keys: 'Iterable[str]' = (),
                         **kwargs: JsonValue) -> JsonObject:
        msg = await self.next_msg(expected_channel)
test/pytest/mocktransport.py:127: AssertionError
=========================== short test summary info ============================
FAILED test/pytest/test_bridge.py::test_fsread1_errors - AssertionError: {'channel': 'channel.1', 'command': 'done'}
===== 1 failed, 138 passed, 19 skipped, 1 deselected, 3 xfailed in 14.92s ======
make[1]: *** [debian/rules:95: execute_after_dh_install-indep] Error 1
make[1]: Leaving directory '/build/reproducible-path/cockpit-358'
make: *** [debian/rules:38: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2

#1133443#10
Date:
2026-04-22 05:55:58 UTC
From:
To:
Hello Emanuele,

Emanuele Rocca [2026-04-13 15:02 +0200]:

Thanks for doing these checks!

I just built cockpit in current sid with gcc-16, and it works just fine.

This is Python code, so totally unrelated to the C compiler. Rather, what this
unit test assumes is that it doesn't run as root, i.e. that it cannot read
/etc/shadow. So either you ran the build as root (most probably) or your build
env has a world-readable /etc/shadow.

I fixed the test in the above PR to skip that bit when running as root.

Pitti

#1133443#19
Date:
2026-04-22 16:11:31 UTC
From:
To:
Hi Martin,

The archive rebuild was performed with sbuild using the unshare backend
under a non-root user. However, in order to pull in GCC-16 from
experimental I used the aspcud build dependency resolver. That has
caused a handful of false positives, and cockpit is one of them
unfortunately. The issue can be easily reproduced as follows:

 $ sbuild --build-dep-resolver=aspcud cockpit

Instead of installing systemd, aspcud ends up installing
systemd-standalone-sysusers. The build environment thus has no
/etc/shadow at all.

Glad there was at least some productive outcome. :-)

For the next rebuild I'll avoid using aspcud altogether.

While investigating this issue, I noticed that pytest is only running on
the Arch: all buildds, which are x86. That means that the package is not
tested on any other architecture really. Is this on purpose?

Thanks!
  Emanuele

#1133443#24
Date:
2026-04-23 06:30:46 UTC
From:
To:
Hello Emanuele,

Emanuele Rocca [2026-04-22 18:11 +0200]:

Ah, thanks for resolving the mystery! I was already wondering why the error
message looked a bit different than what I got with running as root.

I could also fix it by checking for file existence first, but TBH I'm not super
keen on adding ever more "if"s to tests. AFAIUI, it's all good for the purposes
of this bug?

It's on purpose in the sense that it runs pytest against the installed package,
to make sure the wheel/installation process was correct and complete. That of
course only works when we actually install cockpit-bridge.deb. It's not optimal
wrt. covering other architectures, but at least we do cover aarch64 (and until
recently, also s390x for some big-endian fun) in upstream tests, which I think
is good enough -- arch specific issues are rare in Python.

Thanks,

Pitti

#1133443#29
Date:
2026-04-23 06:45:11 UTC
From:
To:
Control: severity -1 minor

Indeed, thanks Martin.