Skip to content

mkdep does not detect compiler failures #1177

Open
@infrastation

Description

@infrastation

This problem stands for all instances of mkdep, but it manifests in tcpdump only (tcpdump-4.99 commit 0bdde63):

> ./build_matrix.sh 
Haiku haikudev 1 hrev57709 Apr 21 2024 06:35:41 x86_64 x86_64 Haiku
OS identification: Haiku-hrev57709
Mon Apr 22 14:16:31 BST 2024
PREFIX set to '/boot/system/var/shared_memory/tcpdump_build_matrix.HkmGySf3'
Use system libpcap
make: *** No rule to make target 'distclean'.  Stop.
(Ignoring the make error.)
===== SETUP 1: CC=gcc BUILD_LIBPCAP=no REMOTE=? CMAKE=no CRYPTO=no SMB=no =====
$ ./build.sh
gcc (2023_08_10) 13.2.0
[...]
./mkdep -c gcc -m -M -s . -DHAVE_CONFIG_H -I. -I/packages/libpcap-1.10.4-2/.self/develop/headers fptype.c tcpdump.c <libnetdissect src list>
In file included from ./addrtoname.c:101:
./getservent.h:42:2: error: #error netdb.h and getservent.h are incompatible
   42 | #error netdb.h and getservent.h are incompatible
      |  ^~~~~
$ make -s clean
$ make -s CFLAGS=-Werror
In file included from ./missing/getservent.c:42:
./getservent.h:42:2: error: #error netdb.h and getservent.h are incompatible
   42 | #error netdb.h and getservent.h are incompatible
(and many other errors)

The reason why the script does not detect the compiler failure is because it is not the last command of a pipe:

$CC $DEPENDENCY_CFLAG $flags $sources |
sed "
        s; \./; ;g
        $SED" >> $TMP

Because the -o pipefail shell option is a bashism, a portable solution could be replacing the pipe with two independent commands and an additional temporary file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions