Re: [Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2809: Support building with system libevent

2010-02-01 Thread Kristian Nielsen
Sergei Golubchik  writes:

>> Then I also need to decide what to do for packages when system
>> libevent is too old. I checked, and Debian 4+5 and Ubuntu up to 9.04
>> have only libevent 1.3. Ubuntu >= 9.10 has libevent 1.4.
>> 
>> I think the best is to use bundled libevent on those older distros. We
>> will then still suffer from
>> https://bugs.launchpad.net/maria/+bug/509521 on those, but hopefully
>> most people using plugins which require libevent will build mariadb
>> themselves and/or use a newer distro.
>
> What about specifying a deb dependency that mariadb needs
> libevent >= 1.4 ?
>
> Then package manager will handle the rest

I don't understand what you mean?

On Ubuntu 9.10 and up specifying a dependency on libevent >=1.4 will work,
yes.

But on Debian <= 5 and Ubuntu <= 9.04, a dependency on libevent >= 1.4 would
make the package uninstallable, as libevent 1.4 is not available in those
distros. Or did you mean we should provide libevent 1.4 as a package in the
OurDelta repository?

I think using system libevent on Ubuntu >= 9.10 and bundled on Ubuntu <= 9.04
and Debian should work ok. Most people installing something like the Pinba
storage engine (which uses libevent) will probably in any case recompile
mariadb. Whatever packages do will not affect them, so the important thing is
that with your patch, they can now get MariaDB to use libevent 1.4 if they
install it.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2809: Support building with system libevent

2010-01-30 Thread Kristian Nielsen
Kristian Nielsen  writes:

> I guess the solution is to check for system libevent version also, and if too
> old treat it the same way as not present. Seems we can check for the presense
> of the evutil_socketpair() function, which was added in libevent 1.4.

Looks like something like this works:

=== modified file 'config/ac-macros/libevent.m4'
--- config/ac-macros/libevent.m42010-01-29 20:35:56 +
+++ config/ac-macros/libevent.m42010-01-30 11:53:39 +
@@ -54,7 +54,7 @@ AC_DEFUN([MYSQL_CHECK_LIBEVENT], [
 "" | "yes")
   libevent_includes=""
   libevent_libs="-levent"
-  AC_CHECK_LIB(event, event_get_version,[with_libevent=system],
+  AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=system],
[with_libevent=bundled])
   AC_CHECK_HEADER(event.h,,[with_libevent=bundled])
   if test "$with_libevent" = "bundled"; then

Any objections?

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2809: Support building with system libevent

2010-01-30 Thread Kristian Nielsen
nore...@launchpad.net writes:

> 
> revno: 2809
> committer: Sergei Golubchik 
> branch nick: maria-5.1
> timestamp: Fri 2010-01-29 21:35:56 +0100
> message:
>   Support building with system libevent
> modified:
>   config/ac-macros/libevent.m4

Thanks!

Unfortunately, I was a bit too optimistic about using system libevent. It
turns out that the thread scheduler code needs libevent 1.4, but lots of our
build systems have only libevent 1.3 in their distros.

So we get build failures like this when libevent-dev 1.3 is installed:

  scheduler.cc: In function ‘bool init_socketpair(int*)’:
  scheduler.cc:146: error: ‘evutil_socketpair’ was not declared in this scope
  scheduler.cc:147: error: ‘evutil_make_socket_nonblocking’ was not declared in 
this scope
  scheduler.cc: In function ‘void close_socketpair(int*)’:
  scheduler.cc:154: error: ‘EVUTIL_CLOSESOCKET’ was not declared in this scope
  scheduler.cc:156: error: ‘EVUTIL_CLOSESOCKET’ was not declared in this scope

I guess the solution is to check for system libevent version also, and if too
old treat it the same way as not present. Seems we can check for the presense
of the evutil_socketpair() function, which was added in libevent 1.4.

Then I also need to decide what to do for packages when system libevent is too
old. I checked, and Debian 4+5 and Ubuntu up to 9.04 have only libevent
1.3. Ubuntu >= 9.10 has libevent 1.4.

I think the best is to use bundled libevent on those older distros. We will
then still suffer from https://bugs.launchpad.net/maria/+bug/509521 on those,
but hopefully most people using plugins which require libevent will build
mariadb themselves and/or use a newer distro.

Alternatively, we can disable pool-of-threads on those older distros.

(A different alternative would be to see if we can modify the pool-of-threads
code to work with libevent 1.3. Not too keen to spend time on this though.)

Opinions?

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


[Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2809: Support building with system libevent

2010-01-29 Thread noreply

revno: 2809
committer: Sergei Golubchik 
branch nick: maria-5.1
timestamp: Fri 2010-01-29 21:35:56 +0100
message:
  Support building with system libevent
modified:
  config/ac-macros/libevent.m4


--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1

Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to 
https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.
=== modified file 'config/ac-macros/libevent.m4'
--- config/ac-macros/libevent.m4	2009-09-29 23:36:15 +
+++ config/ac-macros/libevent.m4	2010-01-29 20:35:56 +
@@ -14,13 +14,6 @@
 
   libevent_libs="\$(top_builddir)/extra/libevent/libevent.a"
   libevent_includes="-I\$(top_srcdir)/extra/libevent"
-  libevent_test_option="--mysqld=--thread-handling=pool-of-threads"
-  AC_SUBST(libevent_libs)
-  AC_SUBST(libevent_includes)
-  AC_SUBST(libevent_test_option)
-
-  AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
-  AC_MSG_RESULT([using bundled libevent])
 
   dnl Get the upstream file with the original libevent configure macros.
   dnl Use builtin include for this, to work around path problems in old versions of aclocal.
@@ -39,17 +32,64 @@
 
   AC_CONFIG_FILES(extra/libevent/Makefile)
 
+  AC_MSG_NOTICE([checking what libevent library to use])
+
+  AC_ARG_WITH([libevent],
+  AC_HELP_STRING([--with-libevent=yes|no|bundled|DIR],
+ [Use libevent and have connection pooling.
+  A location of libevent library can be specified.
+  Given DIR, libevent library is 
+  assumed to be in $DIR/lib and header files
+  in $DIR/include.]),
+  [with_libevent=${withval}],
+  [with_libevent=no])
+
+  case "$with_libevent" in
+"no")
+  with_libevent=disabled
+  ;;
+"bundled")
+  MYSQL_USE_BUNDLED_LIBEVENT
+  ;;
+"" | "yes")
+  libevent_includes=""
+  libevent_libs="-levent"
+  AC_CHECK_LIB(event, event_get_version,[with_libevent=system],
+   [with_libevent=bundled])
+  AC_CHECK_HEADER(event.h,,[with_libevent=bundled])
+  if test "$with_libevent" = "bundled"; then
+MYSQL_USE_BUNDLED_LIBEVENT
+  fi
+  ;;
+*)
+  # Test for libevent using all known library file endings
+  if test \( -f "$with_libevent/lib/libevent.a"  -o \
+ -f "$with_libevent/lib/libevent.so" -o \
+ -f "$with_libevent/lib/libevent.sl" -o \
+ -f "$with_libevent/lib/libevent.dylib" \) \
+  -a -f "$with_libevent/include/event.h"; then
+libevent_includes="-I$with_libevent/include"
+libevent_libs="-L$with_libevent/lib -levent"
+AC_CHECK_LIB(event, event_get_version,[with_libevent=$with_libevent],
+ [with_libevent=no], [$libevent_libs])
+  else
+with_libevent=no
+  fi
+  if test "$with_libevent" = "no"; then 
+AC_MSG_ERROR([libevent headers or binaries were not found])
+  fi
+  ;;
+  esac
   AC_MSG_CHECKING(for libevent)
-  AC_ARG_WITH([libevent],
-  [  --with-libevent use libevent and have connection pooling],
-  [with_libevent=$withval],
-  [with_libevent=no]
-  )
+  AC_MSG_RESULT([$with_libevent])
 
-  if test "$with_libevent" != "no"; then
-MYSQL_USE_BUNDLED_LIBEVENT
-  else
-AC_MSG_RESULT([disabled])
+  if test "$with_libevent" != "disabled"; then
+libevent_test_option="--mysqld=--thread-handling=pool-of-threads"
+AC_SUBST(libevent_libs)
+AC_SUBST(libevent_includes)
+AC_SUBST(libevent_test_option)
+AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
   fi
-  AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "no" ])
+  AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "disabled" ])
 ])
+

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp