tcpdump
tcpdump copied to clipboard
CMake 3.27 emits a deprecation warning
The build matrix runs CMake with -Werror=dev by default. On netbsd-mips64 this works with CMake 3.26.4, but fails with CMake 3.27.6:
$ cmake -Werror=dev -DWITH_CRYPTO=no -DENABLE_SMB=no -DEXTRA_CFLAGS=-Werror -DCMAKE_INSTALL_PREFIX=/tmp/tcpdump_build_matrix.CeCq5oXq ..
Re-run cmake no build system arguments
CMake Deprecation Error at CMakeLists.txt:20 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Checking C compiler flag -std=gnu99
-- Checking for one of the modules 'libpcap'
-- Found pcap-config
-- Could NOT find SMI (missing: SMI_INCLUDE_DIR SMI_LIBRARY)
-- Checking C compiler flag -W
-- Checking C compiler flag -Wall
-- Checking C compiler flag -Wassign-enum
-- Checking C compiler flag -Wcast-qual
-- Checking C compiler flag -Wmissing-prototypes
-- Checking C compiler flag -Wmissing-variable-declarations
-- Checking C compiler flag -Wold-style-definition
-- Checking C compiler flag -Wpedantic
-- Checking C compiler flag -Wpointer-arith
-- Checking C compiler flag -Wpointer-sign
-- Checking C compiler flag -Wshadow
-- Checking C compiler flag -Wsign-compare
-- Checking C compiler flag -Wstrict-prototypes
-- Checking C compiler flag -Wunreachable-code-return
-- Checking C compiler flag -Wused-but-marked-unused
-- Checking C compiler flag -Wwrite-strings
-- Checking C compiler flag -Werror
-- Added extra compile options (-Werror)
-- Found perl at /usr/pkg/bin/perl
-- Configuring incomplete, errors occurred!
Exporting TCPDUMP_CMAKE_TAINTED=yes and thus removing -Werror=dev allows the build to work as expected with CMake 3.27.6. The line 20 is this in the non-Windows branch:
cmake_minimum_required(VERSION 2.8.12)
This will likely need a review of the oldest supported CMake version at some point and possibly some porting/cleanup work. libpcap will likely need similar moves.
The same now applies to the CMake package in OpenBSD 7.4 ports.
The same now stands for the most recent CMake port in Haiku.
Same for cfarm91.cfarm.net. Debian GNU/Linux trixie/sid Linux cfarm91 5.18.11-starfive #1 SMP Sun Sep 4 12:09:06 CEST 2022 riscv64 GNU/Linux
the-tcpdump-group/libpcap#1237 appears to work around this problem in libpcap; I'll propagate that change to tcpdump and tcpslice.
We should still figure out what version of CMake we should require on UN*Xes. (For older UN*Xes, we could say "either get a new CMake or use autotools to configure".)
Thank you. Autoconf seems a reasonable last-resort baseline to me.
We should still figure out what version of CMake we should require on UN*Xes.
Repology is your friend - https://repology.org/project/cmake/versions.
CentOS 6 and 7 still offer CMake 2.8.12.2, so I'm guessing the same is true for RHEL 6 and 7. (I don't know why Repology doesn't show RHEL; perhaps they can't robot-monitor it.)
RHEL 6 is out of support, and RHEL 7 reaches end-of-support in June 2024.
The only places that offer 3.0.x/3.1.x/3.2.x/3.4.x also appear to offer later versions.
My inclination is maybe to keep 2.8.12 as the minimum for 1.10.x, and switch to 3.5 as the minimum for 1.11.x, with the configure script as a fallback for Proudly Trailing-Edge Enterprise Distributions.
Back-ported the workaround to libpcap-1.10, now both the master and the stable branches of both tcpdump and libpcap have it. Removed TCPDUMP_CMAKE_TAINTED and LIBPCAP_CMAKE_TAINTED from the Buildbot environment and confirmed libpcap-1.10 passes the build using CMake 3.27 on NetBSD and OpenBSD. Closing as resolved, thank you for solving the problem.