Bug 8580 - inotify issues during configure
Summary: inotify issues during configure
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2011-11-05 17:13 UTC by Chris Smith
Modified: 2011-11-09 18:50 UTC (History)
2 users (show)

See Also:

requested config.log (3.59 MB, text/x-log)
2011-11-05 19:14 UTC, Chris Smith
no flags Details
proposed fix for bug 8580 (1.05 KB, patch)
2011-11-07 12:19 UTC, Björn Baumbach
no flags Details
Patches for v3-6-test (2.46 KB, patch)
2011-11-07 15:51 UTC, Stefan Metzmacher
bjacke: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2011-11-05 17:13:50 UTC
Can't build Samba with inotify support on Gentoo. Get warnings during configure:
configure: WARNING: linux/inotify.h: present but cannot be compiled
configure: WARNING: linux/inotify.h:     check for missing prerequisite headers?
configure: WARNING: linux/inotify.h: see the Autoconf documentation
configure: WARNING: linux/inotify.h:     section "Present But Cannot Be Compiled"
configure: WARNING: linux/inotify.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------------- ##
configure: WARNING:     ## Report this to samba-technical@samba.org ##
configure: WARNING:     ## ---------------------------------------- ##

First posted this problem to the mailing list on 3/13/2010 in reference to samba-3.5.1, it still exists today with samba-3.6.1.

The error points to this documentation:

I do not get the same error testing this under Ubuntu, but it does appear that inotify is working correctly for other applications.
Comment 1 Björn Jacke 2011-11-05 18:53:12 UTC
can you please attach your config.log that was created by the configure run?
Comment 2 Chris Smith 2011-11-05 19:14:22 UTC
Created attachment 7063 [details]
requested config.log

Same things happens on my Gentoo x86 installs as well and has been happening since at least March 2010 with various versions of Samba, glibc, gcc. As noted previously it doesn't occur with an Ubuntu 11.10 installation and have now tested with an out-of-date Gentoo box (with gcc-4.3 and glibc-2.7) and the error does not occur there either.

Not knowing where the problem may lie I also filed a Gentoo bug:
Comment 3 Björn Jacke 2011-11-05 19:16:54 UTC
we need a new resolved reason in Bugzilla: RESOLVED: GENTOO ;-)
Comment 4 Chris Smith 2011-11-05 20:30:12 UTC
(In reply to comment #3)
> we need a new resolved reason in Bugzilla: RESOLVED: GENTOO ;-)

Yes :)

Most definitely a Gentoo bug.
Comment 5 Mike Frysinger 2011-11-06 05:21:39 UTC
the samba code is slightly broken:

    # Check for inotify support
    conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h')
    if "HAVE_LINUX_INOTIFY_H" in conf.env and "HAVE_INOTIFY_INIT" in conf.env:
        conf.DEFINE('HAVE_INOTIFY', 1)

if sys/inotify.h exists, then linux/inotify.h is not necessary.  the source4 tree seems to have this fixed already:

Comment 6 Chris Smith 2011-11-06 15:28:42 UTC
reopening due to Mike's comment #5
Comment 7 Björn Jacke 2011-11-06 18:52:55 UTC
the waf build is officially not supported in s3, only in s4. Please only use the auto tools buildsystem for s3.

Günther, shall s3/waf issues be fixed at all, I guess not...(?)
Comment 8 Mike Frysinger 2011-11-06 22:52:10 UTC
the autotools code is broken in the same way

if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then
    AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support]) 

missing ac_cv_header_sys_inotify_h checking
Comment 9 Björn Baumbach 2011-11-07 12:19:10 UTC
Created attachment 7066 [details]
proposed fix for bug 8580

On my Gentoo I get a "redefinition of ‘struct f_owner_ex’" on the kernel inotify test. The sys inotify test is working fine.

My patch enables HAVE_INOTIFY if sys inotify OR kernel is working. It's working on my Gentoo with the broken kernel inotify test.

The patch is also working on a SLES10 with working kernel inotify.
Comment 10 Guenther Deschner 2011-11-07 12:36:53 UTC
(In reply to comment #7)
> the waf build is officially not supported in s3, only in s4. Please only use
> the auto tools buildsystem for s3.
> Günther, shall s3/waf issues be fixed at all, I guess not...(?)

For 3.6.x probably not but for master we definitely need to fix this for the waf build as well (as long as we want to have working inotify support in the final samba 4.0).
Comment 11 Stefan Metzmacher 2011-11-07 15:51:07 UTC
Created attachment 7070 [details]
Patches for v3-6-test
Comment 12 Björn Jacke 2011-11-07 16:11:15 UTC
Comment on attachment 7070 [details]
Patches for v3-6-test

looks good
Comment 13 Karolin Seeger 2011-11-09 18:50:54 UTC
Pushed to v3-6-test.
Closing out bug report.