Package: asio
Version: 1.3.1-1
Severity: normal
Tags: patch

        Hi there,

 If libc6-dev supports eventfd (which is the in experimental) but the
 buildd's kernel or the developer's kernel doesn't, asio fails to build
 in the test suite; see e.g.:
 
http://launchpadlibrarian.net/20538394/buildlog_ubuntu-jaunty-i386.asio_1.3.1-1_FAILEDTOBUILD.txt.gz

 There are actually two problems with this:
 1) asio's build will differ depending on the libc6-dev used to build
    the package; as some arches lag, or when developers upload binary
    packages in general, this might cause surprizes; it would be
    reasonnable to force disabling eventfd support for now
    (-DASIO_DISABLE_EVENTFD) and revert this while adding a libc6-dev
    build-dep when it's available with libc6-dev support on all arches;
    this is also useful for e.g. backports.  Consider that packages
    build-depending on asio will also be able to use this information to
    build-dep on an asio with eventfd support reliably.

 2) the package actually failing to pass the testsuite in some cases.
    I'd recommend detecting eventfd support at runtime in the testsuite
    and providing macros to do this for programs using the lib.

 3) There's another unrelated problem: eventfd support is assumed
    starting with a particular kernel version, but it's configurable and
    can be backported to an older kernel as well; asio shouldn't use
    kernel versions as proxies, but check at build and runtime for this
    support.


 For 1), the attached debdiff sets ASIO_DISABLE_EVENTFD in CXXFLAGS
 during check and documents this in README.Debian.  For 2 and 3), I'd
 recommend:
 - changing include/asio/detail/select_interrupter.hpp into a real class
   which would detect which select_interrupter implementation to use at
   runtime
 - checking for eventfd in the system headers at build time and using
   the result in the installed headers (instead of requiring all users
   to test for it)
 but it would be too error prone for me to implement the first part and
 setting ASIO_DISABLE_EVENTFD is a good workaround in the mean time.  :-P

   Cheers,

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.27-1-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- 
Loïc Minier
diff -u asio-1.3.1/debian/changelog asio-1.3.1/debian/changelog
--- asio-1.3.1/debian/changelog
+++ asio-1.3.1/debian/changelog
@@ -1,3 +1,14 @@
+asio (1.3.1-1.1) unstable; urgency=low
+
+  * Add a README.Debian to document that building programs using asio against
+    an eventfd-aware libc6-dev will introduce a runtime dependency on a kernel
+    with CONFIG_EVENTFD set.
+  * Define ASIO_DISABLE_EVENTFD in CXXFLAGS when running make check as
+    otherwise it fails to build with recent libc6-dev and older kernel
+    (typical on buildds running stable but building e.g. experimental).
+
+ -- Loic Minier <[email protected]>  Sat, 20 Dec 2008 16:09:22 +0100
+
 asio (1.3.1-1) unstable; urgency=low
 
   * New upstream release
diff -u asio-1.3.1/debian/rules asio-1.3.1/debian/rules
--- asio-1.3.1/debian/rules
+++ asio-1.3.1/debian/rules
@@ -2,7 +2,7 @@
 
 #export DH_VERBOSE=1
 
-CXXFLAGS = -W -Wall -g -pipe
+CXXFLAGS = -W -Wall -g -pipe -DASIO_DISABLE_EVENTFD
 
 configure: configure.ac
 	aclocal-1.10
only in patch2:
unchanged:
--- asio-1.3.1.orig/debian/README.Debian
+++ asio-1.3.1/debian/README.Debian
@@ -0,0 +1,12 @@
+eventfd() support
+=================
+
+The current asio headers will turn on eventfd support at build time if
+your libc6-dev supports it, disregarding support in the runtime kernel.
+
+In other words, if you build programs using asio against a recent libc6-dev,
+they require a kernel with CONFIG_EVENTFD to run.  You can define
+ASIO_DISABLE_EVENTFD via CXXFLAGS to forcibly disable eventfd support.
+
+eventfd was included in linux 2.6.22.
+

Reply via email to