Mark Hammond | 1 Apr 13:46
Picon
Favicon
Gravatar

RE: Re: [Xapian-commits] 7990: trunk/xapian-core/trunk/xapian-core/bin/ trunk/xapian-core/tests/harness/

Olly writes:
> And after some fettling it now builds under mingw too, though I'm
> cross-compiling so haven't tried running the testsuite yet.  Hopefully
> it still works with MSVC...

Its looking pretty good!  A socklen_t definition got lost, so we need:

+#ifdef _MSC_VER
+typedef int socklen_t;
+#endif

Added to safewinsock2.h.

And while we are on the topic :)  I believe its unrelated to the recent
patches, but debug builds with assertions enabled are failing for me with:

queryparser.cc
queryparser.cc(163) : error C2451: conditional expression of type
'Xapian::Internal::RefCntPtr<T>' is illegal
        with
        [
            T=Xapian::QueryParser::Internal
        ]
        No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called

I'm not experienced enough with std smart pointers to know what the correct
check is.

> The only real problem so far is that libtool can't see a DLL for
(Continue reading)

James Aylett | 1 Apr 14:32

Re: Error handling in the bindings

On Thu, Mar 08, 2007 at 06:57:20PM +0000, Olly Betts wrote:
> > 1. Is it okay to require Python for maintainer mode builds of Xapian-core?
> 
> If you're on Linux or FreeBSD or similar it's OK since chances are
> you'll have both installed already, but vendor Unix flavours often
> don't.  The sourceforge compile farm had perl everywhere but not
> python, for example.

+1 -- most of the most usable distros (including Mac OS X) come with
python installed, but a lot of more hard core ones don't. Solaris
still only guarantees Perl (and I doubt that will change), and I've
run into Debian-based distros (particularly for VMWare) that basically
give you netkit and let you install anything you want, so again you'll
just get Perl.

Perl does the job. It's bad enough having to have dot, which I've
always had difficulty installing...

J

--

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james <at> tartarus.org                               uncertaintydivision.org
Richard Boulton | 1 Apr 14:34

Re: Re: [Xapian-commits] 7990: trunk/xapian-core/trunk/xapian-core/bin/ trunk/xapian-core/tests/harness/

Mark Hammond wrote:
> Its looking pretty good!  A socklen_t definition got lost, so we need:
> 
> +#ifdef _MSC_VER
> +typedef int socklen_t;
> +#endif
> 
> Added to safewinsock2.h.

Done.

> And while we are on the topic :)  I believe its unrelated to the recent
> patches, but debug builds with assertions enabled are failing for me with:
> 
> queryparser.cc
> queryparser.cc(163) : error C2451: conditional expression of type
> 'Xapian::Internal::RefCntPtr<T>' is illegal
>         with
>         [
>             T=Xapian::QueryParser::Internal
>         ]
>         No user-defined-conversion operator available that can perform this
> conversion, or the operator cannot be called
> 
> I'm not experienced enough with std smart pointers to know what the correct
> check is.

The error message with GCC is:
/home/richard/private/Working/xapian/xapian-core/queryparser/queryparser.cc:163: 
error: could not convert 
(Continue reading)

Mark Hammond | 1 Apr 16:05
Picon
Favicon
Gravatar

RE: Re: [Xapian-commits]7990: trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

Richard writes:
> I've got everything working again on
> Linux - let us know how you do on windows.

It's all working fine for me - thanks!  I've a few outstanding patches from
xapian-maintainer-tools/win32msvc, but I'll add them to bugzilla over the
next few days.

Cheers,

Mark
Olly Betts | 1 Apr 16:30
Favicon
Gravatar

Re: Re: [Xapian-commits] 7990: trunk/xapian-core/trunk/xapian-core/bin/ trunk/xapian-core/tests/harness/

On Sun, Apr 01, 2007 at 01:34:46PM +0100, Richard Boulton wrote:
> Mark Hammond wrote:
> >Its looking pretty good!  A socklen_t definition got lost, so we need:
> >
> >+#ifdef _MSC_VER
> >+typedef int socklen_t;
> >+#endif
> >
> >Added to safewinsock2.h.
> 
> Done.

We already have a mechanism for this (`SOCKLEN_T') which should be used
instead.  On UNIX, configure probes and generates config.h with a #define
of SOCKLEN_T to `int' or `socklen_t' as appropriate.

The hand-written config.h.win32 erroneously had "#define SOCKLEN_T
socklen_t" (which previously didn't matter of course) so I had fixed
that and removed the typedef.  I suspect Mark hadn't updated to the new
config.h.win32.

I've doubled-checked that the SOCKLEN_T define is now correct and
reverted this change.  Mark: please make sure that you're using the
latest msvc build files and if the problem is still there let's work out
why this isn't working as intended...

> which is a little more helpful - I've fixed this error, and another one 
> which popped up in omdebug.cc.  I've got everything working again on 
> Linux - let us know how you do on windows.

(Continue reading)

Olly Betts | 1 Apr 16:50
Favicon
Gravatar

Re: Re: [Xapian-commits]7990: trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

On Mon, Apr 02, 2007 at 12:05:44AM +1000, Mark Hammond wrote:
> Richard writes:
> > I've got everything working again on
> > Linux - let us know how you do on windows.
> 
> It's all working fine for me - thanks!  I've a few outstanding patches from
> xapian-maintainer-tools/win32msvc, but I'll add them to bugzilla over the
> next few days.

Interesting - does "make check" currently pass for you under MSVC?

I found that the WinsockInitializer mechanism just didn't work as
it currently is in SVN for TcpClient because the TcpClient constructor
creates the socket and passes it to initialise the parent class which
happens before the winsock_initializer member is initialised.

I've fixed this in my working copy by making the WinsockInitializer a
base class of TcpClient (and listing it before RemoteDatabase) and then
winsock gets initialised as intended.

Perhaps MSVC has a different class construction order, though I thought
this was mandated by the C++ standard.  Anyway, the base class approach
should work for MSVC too.  Essentially WinsockInitializer is now a
"mixin" class.

The testsuite now sort of works for mingw (with various tweaks that I
still need to tidy up and check in).

The problem is that tests seem to randomly fail to connect to the remote
backend, which I think must be down to timing issues with starting
(Continue reading)

Olly Betts | 1 Apr 17:24
Favicon
Gravatar

Re: Re: [Xapian-commits] 7990: trunk/xapian-core/trunk/xapian-core/bin/ trunk/xapian-core/tests/harness/

On Sun, Apr 01, 2007 at 09:46:29PM +1000, Mark Hammond wrote:
> Olly writes:
> > The only real problem so far is that libtool can't see a DLL for
> > -lws2_32 so decides to statically link everything!  Is
> > winsock actually a DLL or a static library?
> 
> Its a DLL for me.  I've a 41k .lib file in the compiler/sdk 'lib' dir and a
> 83k dll in system32.  I'm surprised a static version of that library is
> available.

It may not be...

My Linux->mingw cross-compiler has:

/usr/i586-mingw32msvc/lib/libws2_32.a

But I'm not sure if that's "real" static library or just the import
library for the DLL (which of course I don't have on the compiling
system).  Actually, running "strings" on it I discover it contains
the string "WS2_32.DLL" so presumably it is the import library.

So I think libtool is getting this wrong - it sees a ".a" and can't
see a ".dll" so decides it only has a static version (under UNIX you
would just link against the ".dll" - there's no need to mess around
with import libraries).  Presumably a non-cross-build would see the
".dll" and be happy.  I'll report this to the libtool folks.

Cheers,
    Olly
(Continue reading)

Mark Hammond | 2 Apr 04:51
Picon
Favicon
Gravatar

RE: Re: [Xapian-commits] 7990:trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

Olly:
> We already have a mechanism for this (`SOCKLEN_T') which
> should be used
> instead.  On UNIX, configure probes and generates config.h
> with a #define
> of SOCKLEN_T to `int' or `socklen_t' as appropriate.
>
> The hand-written config.h.win32 erroneously had "#define SOCKLEN_T
> socklen_t" (which previously didn't matter of course) so I had fixed
> that and removed the typedef.  I suspect Mark hadn't updated
> to the new config.h.win32.

Oops - yes, my apologies, that is almost certainly what happened.  The trunk
now builds for me - thanks.

In my feeble defense though, the current win32 build process is fairly error
prone.  It requires you to manually copy files from one directory to
another, then start the build process, which itself then copies those files
into yet other directories.  This first manual step is easy to forget, and
would seem to work against a tinderbox type system working for windows
out-of-the-box.

Is there a reason for the intermediate 'xapian-core/win32' directory?  Is
there any reason we can't tweak the top-level makefile to copy the files
directly from xapian-maintainer-tools/win32msvc directory directly into the
xapian-core tree, and thereby allowing the make process to run directly from
the source of the makefiles?

And while on this topic, it did take me some time to work out how to get
started building on Windows.  I'd like to suggest a patch similar to the
(Continue reading)

Mark Hammond | 2 Apr 04:53
Picon
Favicon
Gravatar

RE: Re: [Xapian-commits]7990: trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

Olly writes:

> On Mon, Apr 02, 2007 at 12:05:44AM +1000, Mark Hammond wrote:
> > Richard writes:
> > > I've got everything working again on
> > > Linux - let us know how you do on windows.
> >
> > It's all working fine for me - thanks!  I've a few
> outstanding patches from
> > xapian-maintainer-tools/win32msvc, but I'll add them to
> bugzilla over the
> > next few days.
>
> Interesting - does "make check" currently pass for you under MSVC?
>
> I found that the WinsockInitializer mechanism just didn't work as
> it currently is in SVN for TcpClient because the TcpClient constructor
> creates the socket and passes it to initialise the parent class which
> happens before the winsock_initializer member is initialised.

It did work for me.  I'm a little confused by the above though - my patch
has the winsock initialization done via the construction of a static
module-level variable - the constructor initialized Winsock.  However, it
seems to me that TcpClient objects are always created via "new
TcpClient(...)", and the best I can tell, this is not done via the
initialization of a variable, but instead via code called via main() - so
its unclear to me how a TcpClient() was created before winsock was
initialized.

However, I really don't care enough to track this down :)  It *still* seems
(Continue reading)

Olly Betts | 2 Apr 05:01
Favicon
Gravatar

Re: Re: [Xapian-commits]7990: trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

On Sun, Apr 01, 2007 at 03:50:53PM +0100, Olly Betts wrote:
> On Mon, Apr 02, 2007 at 12:05:44AM +1000, Mark Hammond wrote:
> > It's all working fine for me - thanks!  I've a few outstanding patches from
> > xapian-maintainer-tools/win32msvc, but I'll add them to bugzilla over the
> > next few days.
> 
> Interesting - does "make check" currently pass for you under MSVC?

Still interested to know this!

> I found that the WinsockInitializer mechanism just didn't work as
> it currently is in SVN for TcpClient because the TcpClient constructor
> creates the socket and passes it to initialise the parent class which
> happens before the winsock_initializer member is initialised.
> 
> I've fixed this in my working copy by making the WinsockInitializer a
> base class of TcpClient (and listing it before RemoteDatabase) and then
> winsock gets initialised as intended.

This is now checked in.

> The problem is that tests seem to randomly fail to connect to the remote
> backend, which I think must be down to timing issues with starting
> xapian-tcpsrv versus trying to connect to it.  Under Unix we carefully
> wait until xapian-tcpsrv outputs "Listening" to avoid this problem.
> Perhaps adding a short "sleep" after starting xapian-tcpsrv will provide
> an acceptable workaround.

It doesn't appear to be timing issues.  It seems to be particular tests
which fail to connect.  The error isn't much help:
(Continue reading)


Gmane