[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#753144: net-snmp: FTBFS on kfreebsd-amd64 - 'struct kinfo_proc' has no member named 'kp_eproc'



On Sun, Jun 29, 2014 at 05:40:40PM +0200, Niels Thykier wrote:
> Source: net-snmp
> Version: 5.7.2.1~dfsg-6
> Severity: serious
 
> Your package FTBFS on kfreebsd-amd64 (but not kfreebsd-i386) with the following errors (see [LOG]):
 
> In file included from ../../include/net-snmp/net-snmp-config.h:2085:0,
>                  from host/data_access/swrun_kinfo.c:8:
> ../../include/net-snmp/system/kfreebsd.h:5:0: warning: "__FreeBSD_version" redefined
>  #define __FreeBSD_version __FreeBSD_kernel_version
>  ^
> In file included from /usr/include/sys/kern/param.h:1:0,
>                  from /usr/include/osreldate.h:1,
>                  from ../../include/net-snmp/system/kfreebsd.h:4,
>                  from ../../include/net-snmp/net-snmp-config.h:2085,
>                  from host/data_access/swrun_kinfo.c:8:
> /usr/include/sys/kglue/sys/param.h:67:0: note: this is the location of the previous definition
>  #define __FreeBSD_version 1000510 /* Master, propagated to newvers */
>  ^
> host/data_access/swrun_kinfo.c: In function 'netsnmp_arch_swrun_container_load':
> host/data_access/swrun_kinfo.c:168:32: error: 'struct kinfo_proc' has no member named 'kp_proc'
>          if ( 0 == proc_table[i].SWRUN_K_STAT )
[...]

> This FTBFS makes net-snmp unable to migrate to testing.

It also fails the same way in a current kfreebsd-i386 chroot.

The kfreebsd-i386 buildd had kfreebsd-kernel-headers_9.2~8 at the time
while the failing kfreebsd-amd64 one had kfreebsd-kernel-headers_10.0~5.
It looks like something happened with __FreeBSD_version and/or
__FreeBSD_kernel_version in between.

The attached naïve patch fixes it for me on the porter kfreebsd machines,
but then at the end I strangely get:

  libtool: install: /usr/bin/install -c .libs/snmpnetstat /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/bin/snmpnetstat
  installing snmpnetstat in /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/bin
  make[3]: Leaving directory '/home/ntyni/net-snmp-5.7.2.1~dfsg/apps/snmpnetstat'
  rm -f /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/bin/snmpinform
  ln -s snmptrap /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/bin/snmpinform
  libtool: install: /usr/bin/install -c -m 644 ./snmp_perl_trapd.pl /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/snmp/snmp_perl_trapd.pl
  install:  installed snmp_perl_trapd.pl in /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/snmp
  make[2]: Leaving directory '/home/ntyni/net-snmp-5.7.2.1~dfsg/apps'
  making install in /home/ntyni/net-snmp-5.7.2.1~dfsg/man
  make[2]: Entering directory '/home/ntyni/net-snmp-5.7.2.1~dfsg/man'
  mkdir /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/man
  mkdir /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/man/man1
  mkdir /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/man/man3
  mkdir /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/man/man5
  mkdir /home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp/usr/share/man/man8
  make[2]: *** No rule to make target 'snmpinform.1', needed by 'maninstall'.  Stop.
  make[2]: Leaving directory '/home/ntyni/net-snmp-5.7.2.1~dfsg/man'
  Makefile:950: recipe for target 'installsubdirs' failed
  make[1]: *** [installsubdirs] Error 1
  make[1]: Leaving directory '/home/ntyni/net-snmp-5.7.2.1~dfsg'
  dh_auto_install: make -j1 install DESTDIR=/home/ntyni/net-snmp-5.7.2.1~dfsg/debian/tmp AM_UPDATE_INFO_DIR=no returned exit code 2
  debian/rules:38: recipe for target 'binary' failed
  make: *** [binary] Error 2

which I haven't solved yet.

CC'ing the debian-bsd list. Maybe somebody can pick this up and/or at
least eyeball the patch. In case someone ends up doing an NMU, please
include the patch in #751918 too.
-- 
Niko Tyni   ntyni@debian.org
>From a2f2f610b56c7d6bce88a8dab54a1f09bcd6f5b7 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Wed, 16 Jul 2014 21:42:30 +0000
Subject: [PATCH] Fix kfreebsd builds with kernel headers >= 10

This fixes warnings like

In file included from ../../include/net-snmp/net-snmp-config.h:2085:0,
                 from host/data_access/swinst_apt.c:5:
../../include/net-snmp/system/kfreebsd.h:5:0: warning: "__FreeBSD_version" redefined [enabled by default]
 #define __FreeBSD_version __FreeBSD_kernel_version
 ^
In file included from /usr/include/sys/kern/param.h:1:0,
                 from /usr/include/osreldate.h:1,
                 from ../../include/net-snmp/system/kfreebsd.h:4,
                 from ../../include/net-snmp/net-snmp-config.h:2085,
                 from host/data_access/swinst_apt.c:5:
/usr/include/sys/kglue/sys/param.h:67:0: note: this is the location of the previous definition
 #define __FreeBSD_version 1000510 /* Master, propagated to newvers */

and makes agent/mibgroup/host/data_access/swrun_kinfo.c use the modern
kinfo_proc field names.

Bug-Debian: http://bugs.debian.org/753144
---
 include/net-snmp/system/kfreebsd.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/net-snmp/system/kfreebsd.h b/include/net-snmp/system/kfreebsd.h
index dbf7024..cb32758 100644
--- a/include/net-snmp/system/kfreebsd.h
+++ b/include/net-snmp/system/kfreebsd.h
@@ -2,7 +2,9 @@
 #define freebsd6 freebsd6
 
 #include <osreldate.h>
+#if defined(__FreeBSD_kernel_version) && !defined(__FreeBSD_version)
 #define __FreeBSD_version __FreeBSD_kernel_version
+#endif
 
 #include <sys/queue.h>
 #include <sys/_types.h>
-- 
1.7.10.4


Reply to: