Bug 220376 - sysutils/rsyslog8 8.28 missing linux/types.h
Summary: sysutils/rsyslog8 8.28 missing linux/types.h
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Matthew Seaman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-30 06:21 UTC by dewayne
Modified: 2017-08-04 13:37 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (matthew)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2017-06-30 06:21:03 UTC
"make package" for rsyslog 8.28
Build terminates with error, missing linux/types.h

# uname -aKU;make -C /usr/ports/sysutils/rsyslog8 -DUSE_K8 showconfig | grep =on
FreeBSD b2.hs 11.1-BETA3 FreeBSD 11.1-BETA3 #0 r320255M: Fri Jun 23 22:42:06 AEST 2017     root@hathor:/110007/D/K8/hqdev-amd64-smp-vga      amd64 1100514 1100514

     DOCS=on: Build and/or install documentation
     GCRYPT=on: Enable support for encrypted logfiles
     GNUTLS=on: GNUTLS module for rsyslog
     RELP=on: RELP input/output module for rsyslog
Comment 1 Matthew Seaman freebsd_committer freebsd_triage 2017-06-30 06:50:06 UTC
I cannot reproduce this problem.  Builds fine for me with exactly the same options settings on 11.0 and 10.3.

How are you building rsyslog?  Can you show me 'poudriere testport' or similar output?
Comment 2 dewayne 2017-06-30 20:26:59 UTC
(In reply to Matthew Seaman from comment #1)
For rsyslog8 8.27.0_1 - successfully builds on FreeBSD 11.1 Beta3

b2# find /var/ports/usr/ports/sysutils/rsyslog8/work/rsyslog-8.27.0/ -name \*.c | xargs grep linux/types.h
b2#


rsyslog8 8.28 on same machine:

The error
/bin/sh ../../libtool  --tag=CC   --mode=compile /usr/local/libexec/ccache/cc -DHAVE_CONFIG_H -I. -I.
libtool: compile:  /usr/local/libexec/ccache/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -pthread -I../../
imfile.c:41:10: fatal error: 'linux/types.h' file not found
#include <linux/types.h>
         ^~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

So do we have linux/types.h?

# find /usr/include/ -name types.h
/usr/include/rpc/types.h
/usr/include/sys/types.h

b2# find /usr/local/include/ -name types.h
/usr/local/include/dns/types.h
/usr/local/include/irs/types.h
/usr/local/include/isc/types.h
/usr/local/include/isccc/types.h
/usr/local/include/webp/types.h
/usr/local/include/libhashkit-1.0/types.h
/usr/local/include/libmemcached-1.0/types.h
/usr/local/include/opkele/types.h
/usr/local/include/libwmf/types.h
/usr/local/include/net-snmp/library/types.h
/usr/local/include/net-snmp/types.h
/usr/local/include/ntfs-3g/types.h

No.

Is it required?
b2# find /var/ports/usr/ports/sysutils/rsyslog8/work/rsyslog-8.28.0/ -name \*.c | xargs grep linux/types.h
/var/ports/usr/ports/sysutils/rsyslog8/work/rsyslog-8.28.0/plugins/imfile/imfile.c:#include <linux/types.h>

Yes.

It appears that you may have unwittingly added the requirement for linux compat into rsyslog8 during your platform's build, or 

~# find /usr/src/ -name types.h
/usr/src/sys/dev/isci/types.h
/usr/src/sys/cddl/compat/opensolaris/sys/types.h
/usr/src/sys/sys/types.h
/usr/src/sys/compat/linuxkpi/common/include/linux/types.h
/usr/src/sys/compat/linuxkpi/common/include/asm/types.h
/usr/src/sys/rpc/types.h
/usr/src/lib/libnetbsd/sys/types.h
/usr/src/crypto/heimdal/appl/telnet/telnet/types.h
/usr/src/contrib/telnet/telnet/types.h
/usr/src/contrib/ntp/lib/isc/include/isc/types.h
/usr/src/contrib/sendmail/include/sm/types.h
/usr/src/contrib/ofed/include/infiniband/types.h

Perhaps poudriere doesn't provide the clean environment that's often touted... ;)
Comment 3 Matthew Seaman freebsd_committer freebsd_triage 2017-06-30 21:54:10 UTC
Inclusion of <linux/types.h> is conditional on having inotify installed:
```
#ifdef HAVE_SYS_INOTIFY_H
#include <sys/inotify.h>
#include <linux/types.h>
#endif
```

rsyslog cannot use inotify on FreeBSD, but there is no configure option
to completely disable it.  Simply having it installed will break the build of rsyslog.  This is why we recommend using a clean-room build system like poudriere.

I shall add a CONFLICTS_BUILD setting.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-06-30 22:03:21 UTC
A commit references this bug:

Author: matthew
Date: Fri Jun 30 22:02:24 UTC 2017
New revision: 444784
URL: https://svnweb.freebsd.org/changeset/ports/444784

Log:
  rsyslog cannot use the Inotify emulation provided by the
  devel/libinotify port -- the kqueue based emulation does not persist
  over forking, unlike the genuine linux inotify.

  However, the presence of certain header files will cause rsyslog to
  attempt to unconditionally compile in Inotify support, and this breaks
  the build.

  Use CONFLICTS_BUILD to mark the incompatibility.

  PR:		220376
  Submitted by:	dewayne@heuristicsystems.com.au

Changes:
  head/sysutils/rsyslog8/Makefile
Comment 5 dewayne 2017-06-30 23:46:16 UTC
(In reply to commit-hook from comment #4)
Thanks Matthew.  I appreciate your explanation.

For the time-being I've changed the build sequence order (in my env) moving rsyslog8 before samba46 (with File Alteration Monitor).  Clearly the right course is to feedback to samba-technical that there is more efficient solution for *BSD.  Also seems that I should reconsider poudriere.
Comment 6 Matthew Seaman freebsd_committer freebsd_triage 2017-08-04 13:37:26 UTC
This should have been closed weeks ago.