Skip to content

Tests fail to compile with OpenSSH-10

When building libssh-0.11.1 against newly-released OpenSSH 10, I see:

FAILED: [code=1] tests/CMakeFiles/torture.dir/torture.c.o
/usr/bin/x86_64-pc-linux-gnu-gcc -m32 -mfpmath=sse  -I/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/tests -I/var/tmp/portage/net-libs/libssh-0.11.1-r
1/work/libssh-0.11.1/tests -I/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/include -I/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_bu
ild-abi_x86_32.x86 -I/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/src -I/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/include  -O3 -march=native -mtls-di
alect=gnu2 -flto=jobserver -fno-semantic-interposition -g1 -pipe -fcf-protection=none -fdiagnostics-color=always -fdiagnostics-urls=never -frecord-gcc-switches -fdiagnostics-details -fdi
agnostics-set-output=text:experimental-nesting=yes -Wa,-O2 -Wa,-mtune=znver2 -Warray-bounds --param=ggc-min-expand=150  -Wstrict-aliasing -Wfree-nonheap-object -Wuninitialized -Wmaybe-un
initialized -Wreturn-type -Wbuiltin-declaration-mismatch -Wtautological-compare -Wformat -Werror=format-security -fPIC -fdiagnostics-color=always -DSSH_PING_EXECUTABLE=\"/var/tmp/portage
/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/tests/ssh_ping\" -MD -MT tests/CMakeFiles/torture.dir/torture.c.o -MF tests/CMakeFiles/torture.dir/torture.c.o.d -o tes
ts/CMakeFiles/torture.dir/torture.c.o -c /var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c
In file included from /var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.h:40,
                 from /var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c:46:
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c: In function ‘torture_setup_create_sshd_config’:
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/tests/tests_config.h:3:41: error: missing binary operator before token ‘.0p2’
    3 | #define OPENSSH_VERSION_MAJOR OpenSSH_10.0p2, OpenSSL 3.5.0 8 Apr 2025
      |                                         ^~~~
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c:760:5: note: in expansion of macro ‘OPENSSH_VERSION_MAJOR’
  760 | #if OPENSSH_VERSION_MAJOR == 8 && OPENSSH_VERSION_MINOR >= 2
      |     ^~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/tests/tests_config.h:3:41: error: missing binary operator before token ‘.0p2’
    3 | #define OPENSSH_VERSION_MAJOR OpenSSH_10.0p2, OpenSSL 3.5.0 8 Apr 2025
      |                                         ^~~~
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c:763:6: note: in expansion of macro ‘OPENSSH_VERSION_MAJOR’
  763 | #if (OPENSSH_VERSION_MAJOR == 9 && OPENSSH_VERSION_MINOR >= 8) || OPENSSH_VERSION_MAJOR > 9
      |      ^~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1_build-abi_x86_32.x86/tests/tests_config.h:3:41: error: missing binary operator before token ‘.0p2’
    3 | #define OPENSSH_VERSION_MAJOR OpenSSH_10.0p2, OpenSSL 3.5.0 8 Apr 2025
      |                                         ^~~~
/var/tmp/portage/net-libs/libssh-0.11.1-r1/work/libssh-0.11.1/tests/torture.c:796:6: note: in expansion of macro ‘OPENSSH_VERSION_MAJOR’
  796 | #if (OPENSSH_VERSION_MAJOR == 9 && OPENSSH_VERSION_MINOR >= 8) || OPENSSH_VERSION_MAJOR > 9
      |      ^~~~~~~~~~~~~~~~~~~~~

Looks like the parsing at https://gitlab.com/libssh/libssh-mirror/-/blob/master/tests/CMakeLists.txt#L107 and https://gitlab.com/libssh/libssh-mirror/-/blob/master/tests/CMakeLists.txt#L213 needs adjusting.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information