Commit Graph

26 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
a03bb3e8e5 build_matrix.sh: Add a "| cat" at the end of a git command
This can avoid a display pause problem with "less -S" as a git pager.

This is a folow-up to 2f0fc907b4.

[skip ci]
2024-10-25 10:38:31 +02:00
Francois-Xavier Le Bail
2f0fc907b4 build_matrix.sh: Run "git show --oneline -s"
It is used to identify the git HEAD.
2024-10-23 14:02:14 +02:00
Francois-Xavier Le Bail
9fcec3cada build_matrix.sh: Use the local libpcap before the system one
This means we'll catch any "make check" errors sooner.
("make check" is not run with system libpcap.)
2024-09-20 05:40:07 +00:00
Francois-Xavier Le Bail
96529eac25 build_matrix.sh: Print "CC=$CC" first in the SETUP message
Use the order of variables in for loops.

This is a follow-up to d3312a6438.
2023-12-13 14:11:27 +01:00
Francois-Xavier Le Bail
aa3fd98b0d build_matrix.sh: Fix a shellcheck note
The note was:
Double quote to prevent globbing and word splitting. [SC2086]

[skip ci]
2023-12-03 17:35:41 +01:00
Francois-Xavier Le Bail
15e642a9cd autoconf: Add autogen.sh, remove configure and config.h.in
Put autoconf-generated files in the release tarball.

The minimum required version of autoconf is currently 2.69.

If version 2.69 or later is already installed and there is no
autoconf default, it may be necessary to set the AUTORECONF
environment variable to enable the one to use, like:
AUTORECONF=autoreconf-2.69 ./autogen.sh
or
AUTORECONF=autoreconf-2.71 ./autogen.sh
2023-01-31 13:58:33 +01:00
Francois-Xavier Le Bail
625657ada8 CI: Introduce and use TCPDUMP_CMAKE_TAINTED
The new environment variable provides means to declare all or some libpcap
cmake run of a specific environment (CI or a working copy) as tainted.
Add explicit conditions to exempt the cmake run that emit warnings
now and request the compiler to treat warnings as errors *iff* the cmake
run is not tainted. This way if a cmake run that is warning-free now
degrades later, CI will fail it.

The treat warnings as errors cmake option used is:
-Werror=dev
       Make developer warnings errors.

       Make  warnings  that  are  meant  for  the  author of the CMake-
       Lists.txt files errors. By default this will also turn on depre-
       cated warnings as errors.
2022-11-30 12:05:58 +01:00
Denis Ovsienko
27b74a81ae CI: Disable shellcheck SC2006 in the Makefile. [skip ci]
Same as in tcpslice and libpcap.
2022-01-04 12:37:14 +00:00
Denis Ovsienko
4316f615c9 CI: Add MAKE_BIN to allow non-default makes. [skip ci]
This way parallel builds are simpler on Solaris and OpenIndiana.
2021-08-17 20:35:21 +01:00
Denis Ovsienko
ed0175cdda CI: Clean in ../libpcap only if present. [skip ci]
./build_matrix.sh[89]: cd: /export/home/denis/libpcap: [No such file or
  directory]
2021-08-17 17:20:32 +01:00
Denis Ovsienko
9b40c0b767 CI: Port recent improvements from tcpslice. [skip appveyor]
Introduce TCPDUMP_TAINTED, improve OS and compiler identification, print
matrix progress to stderr.
2021-07-30 10:33:35 +01:00
Denis Ovsienko
d3312a6438 CI: Make MATRIX_CC loop the outermost.
This way if an iteration includes a local libpcap, the latter is always
compiled with the same CC. This works around odd linking problems on
AIX 7 and Solaris 9 and 10 when one C compiler is GCC and the other is
the vendor's compiler, for example:

* GCC used for libpcap, XL C used for tcpdump:
ld: 0711-317 ERROR: Undefined symbol: .__udivdi3
ld: 0711-317 ERROR: Undefined symbol: .__umoddi3

* GCC used for libpcap, Sun C used for tcpdump:
Undefined                       first referenced
 symbol                             in file
__ctzsi2                            ../libpcap/libpcap.a(optimize.o)
__udivdi3                           ../libpcap/libpcap.a(sf-pcapng.o)
__umoddi3                           ../libpcap/libpcap.a(sf-pcapng.o)
ld: fatal: Symbol referencing errors. No output written to conftest

Similar issues associated with a mix of GCC and Clang had happened on
FreeBSD/AArch64 earlier (addressed in tcpslice commit 75b7771), and
still seem to happen on OpenBSD/AArch64. Hopefully removing the
toolchain mix from the problem space will make it easier to fix other
problems.
2021-07-26 16:31:51 +01:00
Denis Ovsienko
c8e8e57d05 CI: Add missing SC2006 squelch directives. [skip ci] 2021-07-23 14:05:18 +01:00
Denis Ovsienko
507a4c91b5 CI: Import recent build matrix improvements. [skip appveyor]
Start using build_common.sh, make default assignments early and
uniformly, use Solaris-compatible command substitution and exports,
install bc on linux-amd64, deduplicate and reformat some long commands.
Run "make -s" without CFLAGS=-Werror when warnings are expected.

This implements initial support for AIX and Solaris in the tcpdump build
matrix scripts.

* AIX 7.1
M4='/opt/freeware/bin/m4' \
MATRIX_CC='gcc' \
MATRIX_CMAKE=no \
MATRIX_BUILD_LIBPCAP=yes \
./build_matrix.sh

* Solaris 9
MATRIX_CC=gcc \
MATRIX_CMAKE=no \
MATRIX_BUILD_LIBPCAP=no \
./build_matrix.sh

* Solaris 10 and 11
MATRIX_CC='gcc' \
MATRIX_CMAKE=no \
./build_matrix.sh
2021-07-23 01:52:50 +01:00
Denis Ovsienko
35a8fc576d CI: Lose the output folding props.
Same as in libpcap.
2021-07-05 12:09:59 +01:00
Denis Ovsienko
63ea6b5d47 CI: Switch from bash to POSIX shell.
Same as in libpcap.
2021-07-05 11:59:03 +01:00
Francois-Xavier Le Bail
815919247b build_matrix.sh: Fix a shellcheck warning
The warning was:
Use "${var:?}" to ensure this never expands to /* . [SC2115]
2021-05-31 15:04:09 +02:00
Denis Ovsienko
c30c64d0cc CI: Apply more cleanups. [skip appveyor]
Lose travis-conditions in the Travis CI script. Simplify libpcap
cloning. Dissolve choose_libpcap() as it just packed two separate
single-use functions into one, also lose a temporary variable. Fixup
indentation.
2021-03-21 12:18:35 +00:00
Denis Ovsienko
75e92bef00 CI: Refine the build matrix scripts. [skip appveyor]
Reproduce the recent improvements made in tcpslice and libpcap.
2021-03-21 00:32:50 +00:00
Denis Ovsienko
4073332712 CI: Use libpcap.a on MATRIX_BUILD_LIBPCAP=yes. [skip appveyor]
The only way to pass tests on OpenBSD is to link with the upstream
libpcap using ../libpcap/libpcap.a (hence not using CMake) because
-lpcap always results in linking with OpenBSD /usr/lib/libpcap.so
regardless of the libpcap.a and libpcap.so that build.sh installs under
/tmp/local/.

Work around by not cleaning in ../libpcap on MATRIX_BUILD_LIBPCAP=yes,
so Autoconf can pick the static library up. On MATRIX_BUILD_LIBPCAP=no
do the cleaning so it cannot.
2021-03-18 11:40:53 +00:00
Francois-Xavier Le Bail
fb8908c0ec build.sh, build_matrix.sh: Use more the PREFIX variable 2021-03-13 19:50:02 +01:00
Francois-Xavier Le Bail
40fa95e88a Restore the possibility of building when remote is enabled in libpcap
This change allows to test the build with HAVE_PCAP_FINDALLDEVS_EX and
HAVE_PCAP_OPEN enabled.

Some ways to run theses tests:

MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=no MATRIX_CC=gcc \
MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh
(configure should display:
checking for pcap_open... yes
checking for pcap_findalldevs_ex... yes)

MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=yes MATRIX_CC=gcc \
MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh
(cmake should display:
Looking for pcap_open - found
Looking for pcap_findalldevs_ex - found)

Don't enable the builds with REMOTE=yes by default.

This partially reverts commit 3861a41bfa.
"Remove the REMOTE dimension from the nested matrix."
2021-02-11 10:32:58 +01:00
Denis Ovsienko
3861a41bfa Remove the REMOTE dimension from the nested matrix. [skip appveyor]
Neither the build process nor the tests of tcpdump currently depend on
presence or absence of the libpcap remote feature, and there is already
the libpcap nested matrix to cover that dimension, thus in the tcpdump
nested matrix just leave this aspect of the local libpcap build
unspecified and reduce the total number of rounds from 48 to 32.
2021-02-10 14:20:33 +00:00
Francois-Xavier Le Bail
921910a8b2 build_matrix.sh: Update the SETUP line and the 'Build libpcap' printings 2021-02-10 14:49:18 +01:00
Francois-Xavier Le Bail
d21cad0039 build_matrix.sh: Fix typoes
For harmonization s/=/:/ between some keywords and values.
2021-02-10 14:06:53 +01:00
Francois-Xavier Le Bail
973e9c1c9c Add the build_matrix.sh and build.sh scripts
Use them with Travis CI to build with less builders and save CI runtime.
This will currently run five builders: amd64, arm64, ppc64le, s390x and osx.

The build_matrix.sh script executes the matrix loops, exclude tests and
cleaning.
It conditionally builds libpcap running the build.sh script of libpcap.
It calls the build.sh script which runs one build with setup environment
variables: BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
(default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
The matrix can be configured with environment variables
MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO
and MATRIX_SMB
(default: MATRIX_BUILD_LIBPCAP='no yes', MATRIX_REMOTE='no yes',
MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
MATRIX_SMB='no yes').

These scripts can easily be updated to run new tests (32 bits builds,
sanitizers, coverage, etc).

They can be used locally for build tests or used with other CI systems.

Run examples:
./build_matrix.sh
MATRIX_BUILD_LIBPCAP=yes ./build_matrix.sh
MATRIX_CC=clang ./build_matrix.sh
CC=clang ./build.sh
CMAKE=yes ./build.sh
CC=clang CMAKE=yes CRYPTO=yes ./build.sh

Moreover:
Remove the old workaround PATH=$PATH...
Update the install directory prefix to /tmp/local.
Use vim modeline in the two shell scripts.
2021-02-09 16:11:39 +01:00