grosjo / fts-xapian

Dovecot FTS plugin based on Xapian
GNU Lesser General Public License v2.1
91 stars 19 forks source link

1.5.1 fails to build on Debian 10.11 (Buster), 1.5.0 builds but crashes with Dovecot 2.3.17 #110

Closed frittentheke closed 2 years ago

frittentheke commented 2 years ago

When trying to build fts-xapian 1.5.1 against Dovecot 2.3.17 I first see a few warnings on configure

configure.ac:26: the top level
configure.ac:26: warning: gl_UNKNOWN_WARNINGS_ARE_ERRORS is m4_require'd but not m4_defun'd

but then when trying a make this is thrown:

fts-xapian-plugin.c: In function ‘fts_xapian_mail_user_created’:
fts-xapian-plugin.c:104:13: error: operator '>' has no left operand
 #if DOVEAPI > 203016
             ^
fts-xapian-plugin.c:107:6: error: too few arguments to function ‘fts_mail_user_init’
  if (fts_mail_user_init(user, &error) < 0)
      ^~~~~~~~~~~~~~~~~~
In file included from fts-xapian-plugin.h:10,
                 from fts-xapian-plugin.c:4:
/usr/local/src/dovecot-2.3.17/src/plugins/fts/fts-user.h:23:5: note: declared here
 int fts_mail_user_init(struct mail_user *user, bool initialize_libfts,
     ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:564: fts-xapian-plugin.lo] Error 1
make[2]: Leaving directory '/usr/local/src/fts-xapian-1.5.1/src'
make[1]: *** [Makefile:490: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/fts-xapian-1.5.1'
make: *** [Makefile:412: all] Error 2

Version 1.5.0 does throw the same warnings for the configure, but then it bulds fine. But after Dovecot started and imap connections come in they just crash with

Fatal: master: service(imap): child 15601 killed with signal 11

frittentheke commented 2 years ago

I found the issue ... the dovecot binary was simply not in the path for the configure run .... ./configure: line 12499: dovecot: command not found (I have mine in /opt/dovecot/sbin/)

After setting the PATH appropriately 1.5.1 build and runs just fine. Sorry for the noise - maybe an additional check if the binary is available makes sense?

grosjo commented 2 years ago

@frittentheke Have you tried with latest git ? The binary requirement has been removed

frittentheke commented 2 years ago

When using https://github.com/grosjo/fts-xapian/commit/34d14ef9d95edaa6f30ade5d8d04dfd606d6e7eb the configure run ends in:

checking for fts_mail_user_init... no
configure: error: fts_mail_user_init not found in
                              dovecot/fts-user.h, dovecot is not installed
                              correctly
slavkoja commented 2 years ago

dovecot-dev should be enough

symphorien commented 2 years ago

Maybe post the relevant part of config.log.

grosjo commented 2 years ago

I changed the error message, to make it more explicit

frittentheke commented 2 years ago

dovecot-dev should be enough @slavkoja , maybe but I build dovecot from sources, so there should be no -dev package required. The --with-dovecot certainly needs to tell the configure script for fts-xapian where to find my sources files though.

@grosjo

  1. I configured and built Dovecot in /usr/local/src/dovecot-2.3.17, which is where the corresponding dovecot-config is then available
  2. I then went to /usr/local/src/fts-xapian(pointing to https://github.com/grosjo/fts-xapian/commit/4495234f481801a7d0f15bb01764bdf9e21a5855) and ran./configure --with-dovecot=/usr/local/src/dovecot-2.3.17` which worked fine (now without setting any PATH)
  3. I then ran make for fts-xapian which stopped on this error:
make  all-recursive
make[1]: Entering directory '/usr/local/src/fts-xapian'
Making all in src
make[2]: Entering directory '/usr/local/src/fts-xapian/src'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -O2 -I/usr/local/src/dovecot-2.3.17 -I/usr/local/src/dovecot-2.3.17/src/lib -I/usr/local/src/dovecot-2.3.17/src/lib-dict -I/usr/local/src/dovecot-2.3.17/src/lib-dns -I/usr/local/src/dovecot-2.3.17/src/lib-http -I/usr/local/src/dovecot-2.3.17/src/lib-mail -I/usr/local/src/dovecot-2.3.17/src/lib-smtp -I/usr/local/src/dovecot-2.3.17/src/lib-imap -I/usr/local/src/dovecot-2.3.17/src/lib-fs -I/usr/local/src/dovecot-2.3.17/src/lib-charset -I/usr/local/src/dovecot-2.3.17/src/lib-auth -I/usr/local/src/dovecot-2.3.17/src/lib-master -I/usr/local/src/dovecot-2.3.17/src/lib-ssl-iostream -I/usr/local/src/dovecot-2.3.17/src/lib-compression -I/usr/local/src/dovecot-2.3.17/src/lib-settings -I/usr/local/src/dovecot-2.3.17/src/lib-test -I/usr/local/src/dovecot-2.3.17/src/lib-sasl -I/usr/local/src/dovecot-2.3.17/src/lib-old-stats -I/usr/local/src/dovecot-2.3.17/src/lib-dcrypt -I/usr/local/src/dovecot-2.3.17/src/lib-program-client -I/usr/local/src/dovecot-2.3.17/src/lib-index -I/usr/local/src/dovecot-2.3.17/src/lib-storage -I/usr/local/src/dovecot-2.3.17/src/lib-storage/list -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index/raw -I/usr/local/src/dovecot-2.3.17/src/lib-imap-storage -I/usr/local/src/dovecot-2.3.17/src/plugins/quota -I/usr/local/src/dovecot-2.3.17/src/doveadm -I/usr/local/src/dovecot-2.3.17/src/lib-fts -I/usr/local/src/dovecot-2.3.17/src/plugins/fts      -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2   -O2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c -o fts-xapian-plugin.lo fts-xapian-plugin.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O2 -I/usr/local/src/dovecot-2.3.17 -I/usr/local/src/dovecot-2.3.17/src/lib -I/usr/local/src/dovecot-2.3.17/src/lib-dict -I/usr/local/src/dovecot-2.3.17/src/lib-dns -I/usr/local/src/dovecot-2.3.17/src/lib-http -I/usr/local/src/dovecot-2.3.17/src/lib-mail -I/usr/local/src/dovecot-2.3.17/src/lib-smtp -I/usr/local/src/dovecot-2.3.17/src/lib-imap -I/usr/local/src/dovecot-2.3.17/src/lib-fs -I/usr/local/src/dovecot-2.3.17/src/lib-charset -I/usr/local/src/dovecot-2.3.17/src/lib-auth -I/usr/local/src/dovecot-2.3.17/src/lib-master -I/usr/local/src/dovecot-2.3.17/src/lib-ssl-iostream -I/usr/local/src/dovecot-2.3.17/src/lib-compression -I/usr/local/src/dovecot-2.3.17/src/lib-settings -I/usr/local/src/dovecot-2.3.17/src/lib-test -I/usr/local/src/dovecot-2.3.17/src/lib-sasl -I/usr/local/src/dovecot-2.3.17/src/lib-old-stats -I/usr/local/src/dovecot-2.3.17/src/lib-dcrypt -I/usr/local/src/dovecot-2.3.17/src/lib-program-client -I/usr/local/src/dovecot-2.3.17/src/lib-index -I/usr/local/src/dovecot-2.3.17/src/lib-storage -I/usr/local/src/dovecot-2.3.17/src/lib-storage/list -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index/raw -I/usr/local/src/dovecot-2.3.17/src/lib-imap-storage -I/usr/local/src/dovecot-2.3.17/src/plugins/quota -I/usr/local/src/dovecot-2.3.17/src/doveadm -I/usr/local/src/dovecot-2.3.17/src/lib-fts -I/usr/local/src/dovecot-2.3.17/src/plugins/fts -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c fts-xapian-plugin.c  -fPIC -DPIC -o .libs/fts-xapian-plugin.o
fts-xapian-plugin.c: In function ‘fts_xapian_mail_user_created’:
fts-xapian-plugin.c:107:6: error: too few arguments to function ‘fts_mail_user_init’
  107 |  if (fts_mail_user_init(user, &error) < 0)
      |      ^~~~~~~~~~~~~~~~~~
In file included from fts-xapian-plugin.h:10,
                 from fts-xapian-plugin.c:4:
/usr/local/src/dovecot-2.3.17/src/plugins/fts/fts-user.h:23:5: note: declared here
   23 | int fts_mail_user_init(struct mail_user *user, bool initialize_libfts,
      |     ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:563: fts-xapian-plugin.lo] Error 1
make[2]: Leaving directory '/usr/local/src/fts-xapian/src'
make[1]: *** [Makefile:492: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/fts-xapian'
make: *** [Makefile:414: all] Error 2
symphorien commented 2 years ago

can you share config.log ?

grosjo commented 2 years ago

dovecot-dev should be enough @slavkoja , maybe but I build dovecot from sources, so there should be no -dev package required. The --with-dovecot certainly needs to tell the configure script for fts-xapian where to find my sources files though.

@grosjo

  1. I configured and built Dovecot in /usr/local/src/dovecot-2.3.17, which is where the corresponding dovecot-config is then available
  2. I then went to /usr/local/src/fts-xapian(pointing to https://github.com/grosjo/fts-xapian/commit/4495234f481801a7d0f15bb01764bdf9e21a5855) and ran./configure --with-dovecot=/usr/local/src/dovecot-2.3.17` which worked fine (now without setting any PATH)
  3. I then ran make for fts-xapian which stopped on this error:
make  all-recursive
make[1]: Entering directory '/usr/local/src/fts-xapian'
Making all in src
make[2]: Entering directory '/usr/local/src/fts-xapian/src'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -O2 -I/usr/local/src/dovecot-2.3.17 -I/usr/local/src/dovecot-2.3.17/src/lib -I/usr/local/src/dovecot-2.3.17/src/lib-dict -I/usr/local/src/dovecot-2.3.17/src/lib-dns -I/usr/local/src/dovecot-2.3.17/src/lib-http -I/usr/local/src/dovecot-2.3.17/src/lib-mail -I/usr/local/src/dovecot-2.3.17/src/lib-smtp -I/usr/local/src/dovecot-2.3.17/src/lib-imap -I/usr/local/src/dovecot-2.3.17/src/lib-fs -I/usr/local/src/dovecot-2.3.17/src/lib-charset -I/usr/local/src/dovecot-2.3.17/src/lib-auth -I/usr/local/src/dovecot-2.3.17/src/lib-master -I/usr/local/src/dovecot-2.3.17/src/lib-ssl-iostream -I/usr/local/src/dovecot-2.3.17/src/lib-compression -I/usr/local/src/dovecot-2.3.17/src/lib-settings -I/usr/local/src/dovecot-2.3.17/src/lib-test -I/usr/local/src/dovecot-2.3.17/src/lib-sasl -I/usr/local/src/dovecot-2.3.17/src/lib-old-stats -I/usr/local/src/dovecot-2.3.17/src/lib-dcrypt -I/usr/local/src/dovecot-2.3.17/src/lib-program-client -I/usr/local/src/dovecot-2.3.17/src/lib-index -I/usr/local/src/dovecot-2.3.17/src/lib-storage -I/usr/local/src/dovecot-2.3.17/src/lib-storage/list -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index/raw -I/usr/local/src/dovecot-2.3.17/src/lib-imap-storage -I/usr/local/src/dovecot-2.3.17/src/plugins/quota -I/usr/local/src/dovecot-2.3.17/src/doveadm -I/usr/local/src/dovecot-2.3.17/src/lib-fts -I/usr/local/src/dovecot-2.3.17/src/plugins/fts      -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2   -O2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c -o fts-xapian-plugin.lo fts-xapian-plugin.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O2 -I/usr/local/src/dovecot-2.3.17 -I/usr/local/src/dovecot-2.3.17/src/lib -I/usr/local/src/dovecot-2.3.17/src/lib-dict -I/usr/local/src/dovecot-2.3.17/src/lib-dns -I/usr/local/src/dovecot-2.3.17/src/lib-http -I/usr/local/src/dovecot-2.3.17/src/lib-mail -I/usr/local/src/dovecot-2.3.17/src/lib-smtp -I/usr/local/src/dovecot-2.3.17/src/lib-imap -I/usr/local/src/dovecot-2.3.17/src/lib-fs -I/usr/local/src/dovecot-2.3.17/src/lib-charset -I/usr/local/src/dovecot-2.3.17/src/lib-auth -I/usr/local/src/dovecot-2.3.17/src/lib-master -I/usr/local/src/dovecot-2.3.17/src/lib-ssl-iostream -I/usr/local/src/dovecot-2.3.17/src/lib-compression -I/usr/local/src/dovecot-2.3.17/src/lib-settings -I/usr/local/src/dovecot-2.3.17/src/lib-test -I/usr/local/src/dovecot-2.3.17/src/lib-sasl -I/usr/local/src/dovecot-2.3.17/src/lib-old-stats -I/usr/local/src/dovecot-2.3.17/src/lib-dcrypt -I/usr/local/src/dovecot-2.3.17/src/lib-program-client -I/usr/local/src/dovecot-2.3.17/src/lib-index -I/usr/local/src/dovecot-2.3.17/src/lib-storage -I/usr/local/src/dovecot-2.3.17/src/lib-storage/list -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index -I/usr/local/src/dovecot-2.3.17/src/lib-storage/index/raw -I/usr/local/src/dovecot-2.3.17/src/lib-imap-storage -I/usr/local/src/dovecot-2.3.17/src/plugins/quota -I/usr/local/src/dovecot-2.3.17/src/doveadm -I/usr/local/src/dovecot-2.3.17/src/lib-fts -I/usr/local/src/dovecot-2.3.17/src/plugins/fts -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c fts-xapian-plugin.c  -fPIC -DPIC -o .libs/fts-xapian-plugin.o
fts-xapian-plugin.c: In function ‘fts_xapian_mail_user_created’:
fts-xapian-plugin.c:107:6: error: too few arguments to function ‘fts_mail_user_init’
  107 |  if (fts_mail_user_init(user, &error) < 0)
      |      ^~~~~~~~~~~~~~~~~~
In file included from fts-xapian-plugin.h:10,
                 from fts-xapian-plugin.c:4:
/usr/local/src/dovecot-2.3.17/src/plugins/fts/fts-user.h:23:5: note: declared here
   23 | int fts_mail_user_init(struct mail_user *user, bool initialize_libfts,
      |     ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:563: fts-xapian-plugin.lo] Error 1
make[2]: Leaving directory '/usr/local/src/fts-xapian/src'
make[1]: *** [Makefile:492: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/fts-xapian'
make: *** [Makefile:414: all] Error 2

Can you please "git clone" from github, run "autoreconf -vi" them configure

and share the config.log

frittentheke commented 2 years ago

@grosjo certainly, here you go: config.log

grosjo commented 2 years ago

@frittentheke Can you try with latest git ?

frittentheke commented 2 years ago

@frittentheke Can you try with latest git ?

Works fine now!

symphorien commented 2 years ago

0f354faf4021bd0eb28efc82785e03912ec1832d broke compilation with configure flag --without-dovecot-install-dirs, fyi