James Aylett | 4 Jun 18:00

Patch to enable python bindings in absence of docs build

As discussed on IRC. The naming conventions aren't ideal, but the
intent feels right and it works for me.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james <at> tartarus.org                               uncertaintydivision.org
Index: python/util.i
===================================================================
--- python/util.i	(revision 8794)
+++ python/util.i	(working copy)
@@ -25,7 +25,9 @@
 %}

 /* Include the documentation comments extracted from doxygen output. */
+#ifdef DOCCOMMENTS_I_SOURCES
 %include "doccomments.i"
+#endif

 /* Include overrides for the documentation comments. */
 %include "extracomments.i"
Index: python/Makefile.am
===================================================================
--- python/Makefile.am	(revision 8794)
+++ python/Makefile.am	(working copy)
@@ -9,7 +9,12 @@
(Continue reading)

Daniel Ménard | 11 Jun 20:11
Picon

Re: [Xapian-discuss] Xapian 1.0.1 released

(the original message was on the discuss list, but I thought it was 
better to switch on devel)

Olly Betts a écrit :
> I've now uploaded Xapian 1.0.1, which you can download from the usual
> place:
>   
Olly, you're working to fast for me!

I had collected some remarks I got after testing 1.0.0, but I did not 
send them fast enough.
Most of them are very minor points. Here they are:

1. In xapian.php (php5), class XapianQuery, constants OP_AND and 
OP_ELITE_SET are defined as integers (0 and 10) and not as aliases of 
"flat constants" (query_OP_AND, query_OP_ELITE_SET) like others do.

2. On windows, from the php bindings, I can't use SimpleStopper (apache 
hangs).
Defining the stopper works fine:
XapianQueryParser->setStopper($simpleStopper)
but then if I try to parse a query, apache hangs the first time it 
access the stopper.
I guess it is very windows specific, perhaps something similar to the 
strings allocation problem we got with join(get_matching_terms()) in the 
past.
I don't use the queryparser anymore but please let me know if I can help 
debugging this one...

3. I was surprised by the precedence of the "NOT" operator:
(Continue reading)

Olly Betts | 11 Jun 21:11
Favicon
Gravatar

Re: Re: [Xapian-discuss] Xapian 1.0.1 released

On Mon, Jun 11, 2007 at 08:11:11PM +0200, Daniel M?nard wrote:
> 1. In xapian.php (php5), class XapianQuery, constants OP_AND and 
> OP_ELITE_SET are defined as integers (0 and 10) and not as aliases of 
> "flat constants" (query_OP_AND, query_OP_ELITE_SET) like others do.

I think that's just because the code in SWIG which generates that file
uses SWIG's parse tree which knows that OP_AND is 0 (because it's first)
and OP_ELITE_SET is 10 (because it is explicitly set to that).  The
parse tree doesn't have explicit values for enum values allocated
sequentially.

So while this looks odd, it's harmless really.  Currently we don't parse
xapian-core's query.h (the long term aim is to just parse xapian-core
headers in all cases, with SWIG directives in the master file to ignore
things we don't want to wrap), so xapian.i currently duplicates the enum
from query.h, but we can't change these values without breaking the C++
ABI anyway.

> 2. On windows, from the php bindings, I can't use SimpleStopper (apache 
> hangs).
> Defining the stopper works fine:
> XapianQueryParser->setStopper($simpleStopper)
> but then if I try to parse a query, apache hangs the first time it 
> access the stopper.
> I guess it is very windows specific, perhaps something similar to the 
> strings allocation problem we got with join(get_matching_terms()) in the 
> past.
> I don't use the queryparser anymore but please let me know if I can help 
> debugging this one...

(Continue reading)

Daniel Ménard | 12 Jun 17:10
Picon

Re: Re: [Xapian-discuss] Xapian 1.0.1 released

Olly Betts a écrit :
> On Mon, Jun 11, 2007 at 08:11:11PM +0200, Daniel M?nard wrote:
>   
>> 1. In xapian.php (php5), class XapianQuery, constants OP_AND and 
>> OP_ELITE_SET are defined as integers (0 and 10)
>>     
> So while this looks odd, it's harmless really (...)
>   
that's ok for me,
>> 2. On windows, from the php bindings, I can't use SimpleStopper (apache 
>> hangs).
> Do you have a complete (but ideally not too large) script which
> demonstrates this?
>   
Trying to reproduce the bug, I think I found where it comes from...
Here is a simple script to reproduce the problem (I hope it's OK to post 
here, if not, please tell me about other ways):

---[start]---
require_once dirname(__FILE__) . '/lib/xapian/xapian.php'; // the php5 
OO wrapper
class Test
{
    private $parser=null;

    public function setup()
    {
        $this->parser=new XapianQueryParser();
        $stopper=new XapianSimpleStopper(); // no need to add stopwords 
to reproduce the bug
(Continue reading)

Olly Betts | 12 Jun 17:53
Favicon
Gravatar

Re: Re: [Xapian-discuss] Xapian 1.0.1 released

On Tue, Jun 12, 2007 at 05:10:07PM +0200, Daniel M?nard wrote:
> Here is my guess about what happens:
> 
> The important point is that in setup(), $stopper is a local variable.
> At the end of setup() the variable is deleted which, I think, causes 
> Xapian to free the underlying c++ object

Yes, that's probably right - there are a few issues like this we need
to address.

> Is-it a bug? My scenario is probably not the common usage (setting up 
> the query parser in one function, using it in another one).
> On the other hand, the internal stopper should not be deleted if another 
> object still uses it, no?

It is a bug.

> >Perhaps that's wrong - it seems like NOT should probably bind more
> >tightly (...)
> >
> >So either most people don't notice (or care), or it's working as most
> >people expect.  I suspect the former, so it's probably OK to change
> >this.
>
> I also think that "not" should be given higher precedence, even if I was 
> not able to find doc from google/yahoo/others stating explicitly on that 
> point.

Did you try some queries to see what precendence they give it?

(Continue reading)

Daniel Ménard | 13 Jun 16:22
Picon

Compiling 1.0.1 on windows : version.h

I tried to compile xapian 1.0.1 under windows but the new 
/msvc/version.h file has #undef XAPIAN_HAS_REMOTE_BACKEND which prevents 
/backends/dbfactory_remote.cc to be built.

The old (hand-written) version.h.win32 had it defined to 1.
Everything build fine if I replace #undef with #define in version.h.

Cheers,
--

-- 

Daniel Ménard
Charlie Hull | 13 Jun 17:18

Re: Compiling 1.0.1 on windows : version.h

Daniel Ménard wrote:
> I tried to compile xapian 1.0.1 under windows but the new 
> /msvc/version.h file has #undef XAPIAN_HAS_REMOTE_BACKEND which prevents 
> /backends/dbfactory_remote.cc to be built.
> 
> The old (hand-written) version.h.win32 had it defined to 1.
> Everything build fine if I replace #undef with #define in version.h.
> 
> Cheers,

A related issue; the current SVN-HEAD build files don't copy in 
version.h correctly (there's no configure on Windows remember). Anyway, 
the following patch to \win32msvc\Makefile fixes it.

Cheers

Charlie

Index: Makefile
===================================================================
--- Makefile	(revision 8907)
+++ Makefile	(working copy)
@@ -92,7 +92,7 @@
  # Copy mak files to the right folders
  COPYMAKFILES:
     copy config.h.win32 ..\config.h
-   copy ..\msvc\version.h ..\include\xapian\version.h
+   copy ..\msvc\version.h.in ..\include\xapian\version.h
     copy  win32_api.mak ..\api\Makefile
     copy  win32_backends.mak ..\backends\Makefile
(Continue reading)

Daniel Ménard | 13 Jun 17:40
Picon

Re: Compiling 1.0.1 on windows : version.h

Charlie Hull a écrit :
> -   copy ..\msvc\version.h ..\include\xapian\version.h
> +   copy ..\msvc\version.h.in ..\include\xapian\version.h

I have problems if I do that:
.\version.cc(27) : error C2018: unknown char '0x40'
.\version.cc(27) : error C2018: unknown char '0x40'
.\version.cc(27) : error C2065: 'MAJOR_VERSION' : ident not declared
and so on

cheers,

--

-- 

Daniel Ménard
Olly Betts | 13 Jun 17:46
Favicon
Gravatar

Re: Compiling 1.0.1 on windows : version.h

On Wed, Jun 13, 2007 at 04:18:44PM +0100, Charlie Hull wrote:
> A related issue; the current SVN-HEAD build files don't copy in 
> version.h correctly (there's no configure on Windows remember).

There doesn't need to be a configure, since msvc/version.h is shipped in
the tarball:

-rw-r--r-- 1019/1019      1398 2007-05-18 00:00:12 xapian-core-1.0.0/msvc/version.h

> Anyway, the following patch to \win32msvc\Makefile fixes it.

That copies in the file without the values substituted, so it won't
work.

Cheers,
    Olly
Olly Betts | 13 Jun 17:49
Favicon
Gravatar

Re: Compiling 1.0.1 on windows : version.h

On Wed, Jun 13, 2007 at 04:22:21PM +0200, Daniel M?nard wrote:
> I tried to compile xapian 1.0.1 under windows but the new 
> /msvc/version.h file has #undef XAPIAN_HAS_REMOTE_BACKEND which prevents 
> /backends/dbfactory_remote.cc to be built.

Fixed in SVN (that #undef is a remnant from before Mark Hammond got the
remote backend to work on Windows).

Cheers,
    Olly

Gmane