ThomasHabets / arping

ARP Ping
http://www.habets.pp.se/synscan/programs.php
GNU General Public License v2.0
398 stars 62 forks source link

arping_test compile failure #39

Closed mbakke closed 3 years ago

mbakke commented 4 years ago

Hi!

I'm attempting to package arping for GNU Guix and am running into a failure upon make check:

starting phase `check'
Making check in src
make[1]: Entering directory '/tmp/guix-build-arping-2.21.drv-0/arping-2.21/src'
make  arping_test
make[2]: Entering directory '/tmp/guix-build-arping-2.21.drv-0/arping-2.21/src'
gcc -DHAVE_CONFIG_H -I. -I..   -D_DEFAULT_SOURCE=1  -g -O2  -MT arping_test.o -MD -MP -MF .deps/arping_test.Tpo -c -o arping_test.o arping_test.c
In file included from arping_test.c:29:0:
arping_test.c:239:8: error: ‘test_mkpacket’ redeclared as different kind of symbol
 MYTEST(test_mkpacket)
        ^
arping_test.c:239:1: note: in expansion of macro ‘MYTEST’
 MYTEST(test_mkpacket)
 ^~~~~~
arping_test.c:239:8: note: previous declaration of ‘test_mkpacket’ was here
 MYTEST(test_mkpacket)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:264:8: error: ‘pingip_uninteresting_packet’ redeclared as different kind of symbol
 MYTEST(pingip_uninteresting_packet)
        ^
arping_test.c:264:1: note: in expansion of macro ‘MYTEST’
 MYTEST(pingip_uninteresting_packet)
 ^~~~~~
arping_test.c:264:8: note: previous declaration of ‘pingip_uninteresting_packet’ was here
 MYTEST(pingip_uninteresting_packet)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:392:8: error: ‘pingip_interesting_packet’ redeclared as different kind of symbol
 MYTEST(pingip_interesting_packet)
        ^
arping_test.c:392:1: note: in expansion of macro ‘MYTEST’
 MYTEST(pingip_interesting_packet)
 ^~~~~~
arping_test.c:392:8: note: previous declaration of ‘pingip_interesting_packet’ was here
 MYTEST(pingip_interesting_packet)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:452:8: error: ‘strip_newline_test’ redeclared as different kind of symbol
 MYTEST(strip_newline_test)
        ^
arping_test.c:452:1: note: in expansion of macro ‘MYTEST’
 MYTEST(strip_newline_test)
 ^~~~~~
arping_test.c:452:8: note: previous declaration of ‘strip_newline_test’ was here
 MYTEST(strip_newline_test)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:472:8: error: ‘get_mac_addr_success’ redeclared as different kind of symbol
 MYTEST(get_mac_addr_success)
        ^
arping_test.c:472:1: note: in expansion of macro ‘MYTEST’
 MYTEST(get_mac_addr_success)
 ^~~~~~
arping_test.c:472:8: note: previous declaration of ‘get_mac_addr_success’ was here
 MYTEST(get_mac_addr_success)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:504:8: error: ‘get_mac_addr_fail’ redeclared as different kind of symbol
 MYTEST(get_mac_addr_fail)
        ^
arping_test.c:504:1: note: in expansion of macro ‘MYTEST’
 MYTEST(get_mac_addr_fail)
 ^~~~~~
arping_test.c:504:8: note: previous declaration of ‘get_mac_addr_fail’ was here
 MYTEST(get_mac_addr_fail)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:520:14: error: ‘libnet_init_bad_nolo’ redeclared as different kind of symbol
 MY_EXIT_TEST(libnet_init_bad_nolo)
              ^
arping_test.c:520:1: note: in expansion of macro ‘MY_EXIT_TEST’
 MY_EXIT_TEST(libnet_init_bad_nolo)
 ^~~~~~~~~~~~
arping_test.c:520:14: note: previous declaration of ‘libnet_init_bad_nolo’ was here
 MY_EXIT_TEST(libnet_init_bad_nolo)
              ^
arping_test.c:65:37: note: in definition of macro ‘MY_EXIT_TEST’
 #define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
                                     ^
In file included from arping_test.c:29:0:
arping_test.c:528:14: error: ‘libnet_init_null_nolo_nonull’ redeclared as different kind of symbol
 MY_EXIT_TEST(libnet_init_null_nolo_nonull)
              ^
arping_test.c:528:1: note: in expansion of macro ‘MY_EXIT_TEST’
 MY_EXIT_TEST(libnet_init_null_nolo_nonull)
 ^~~~~~~~~~~~
arping_test.c:528:14: note: previous declaration of ‘libnet_init_null_nolo_nonull’ was here
 MY_EXIT_TEST(libnet_init_null_nolo_nonull)
              ^
arping_test.c:65:37: note: in definition of macro ‘MY_EXIT_TEST’
 #define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
                                     ^
In file included from arping_test.c:29:0:
arping_test.c:535:8: error: ‘libnet_init_good’ redeclared as different kind of symbol
 MYTEST(libnet_init_good)
        ^
arping_test.c:535:1: note: in expansion of macro ‘MYTEST’
 MYTEST(libnet_init_good)
 ^~~~~~
arping_test.c:535:8: note: previous declaration of ‘libnet_init_good’ was here
 MYTEST(libnet_init_good)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
In file included from arping_test.c:29:0:
arping_test.c:542:8: error: ‘libnet_init_null_nolo’ redeclared as different kind of symbol
 MYTEST(libnet_init_null_nolo)
        ^
arping_test.c:542:1: note: in expansion of macro ‘MYTEST’
 MYTEST(libnet_init_null_nolo)
 ^~~~~~
arping_test.c:542:8: note: previous declaration of ‘libnet_init_null_nolo’ was here
 MYTEST(libnet_init_null_nolo)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:239:8: warning: ‘test_mkpacket’ used but never defined
 MYTEST(test_mkpacket)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:264:8: warning: ‘pingip_uninteresting_packet’ used but never defined
 MYTEST(pingip_uninteresting_packet)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:392:8: warning: ‘pingip_interesting_packet’ used but never defined
 MYTEST(pingip_interesting_packet)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:452:8: warning: ‘strip_newline_test’ used but never defined
 MYTEST(strip_newline_test)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:472:8: warning: ‘get_mac_addr_success’ used but never defined
 MYTEST(get_mac_addr_success)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:504:8: warning: ‘get_mac_addr_fail’ used but never defined
 MYTEST(get_mac_addr_fail)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:520:14: warning: ‘libnet_init_bad_nolo’ used but never defined
 MY_EXIT_TEST(libnet_init_bad_nolo)
              ^
arping_test.c:65:37: note: in definition of macro ‘MY_EXIT_TEST’
 #define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
                                     ^
arping_test.c:528:14: warning: ‘libnet_init_null_nolo_nonull’ used but never defined
 MY_EXIT_TEST(libnet_init_null_nolo_nonull)
              ^
arping_test.c:65:37: note: in definition of macro ‘MY_EXIT_TEST’
 #define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
                                     ^
arping_test.c:535:8: warning: ‘libnet_init_good’ used but never defined
 MYTEST(libnet_init_good)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
arping_test.c:542:8: warning: ‘libnet_init_null_nolo’ used but never defined
 MYTEST(libnet_init_null_nolo)
        ^
arping_test.c:58:31: note: in definition of macro ‘MYTEST’
 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
                               ^
make[2]: *** [Makefile:627: arping_test.o] Error 1

This is using GCC 7, check 0.14, libnet 1.2. I tried check 0.13 and libnet 1.1, but it made no difference. Any idea what I'm doing wrong?

ThomasHabets commented 4 years ago

Dunno. On Debian I use check 0.10. This looks like it could be some incompatability there.

carnil commented 3 years ago

@ThomasHabets it looks the same was now reported in Debian as well: https://bugs.debian.org/980595 .

Now given we had 2.21-1 and it did build fine so far, your suspect about check might be true. Only recently in Debian unstable it switched/moved from 0.12.0-0.2 to 0.15.2-1.

carnil commented 3 years ago

@ThomasHabets: I can confirm downgrading from 0.15.2-1 to 0.12.0-0.2 fixes the issue.

Who is at fault? arping or check?

carnil commented 3 years ago

Possibly related to https://github.com/libcheck/check/pull/158

ThomasHabets commented 3 years ago

A workaround is of course "don't run make check". But hopefully should be an easy fix.

ThomasHabets commented 3 years ago

Ah, I see it now. Gaaah. No, they made it impossible to create a test function registry. And also impossible to make it version agnostic.

ThomasHabets commented 3 years ago

Should be good at HEAD now.

Could you confirm, and I'll tag a new version tomorrow? There are no non-test changes since 2.21, so this would just be to remove need for upstream patches.

carnil commented 3 years ago

Should be good at HEAD now.

Could you confirm, and I'll tag a new version tomorrow? There are no non-test changes since 2.21, so this would just be to remove need for upstream patches.

I can confirm the commit fixes the issue!

Thanks for the fast fix!