lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andi Vajda (Commented) (JIRA)" <>
Subject [jira] [Commented] (PYLUCENE-13) JArray not shared - TypeError
Date Sun, 04 Dec 2011 04:14:40 GMT


Andi Vajda commented on PYLUCENE-13:

I got this to work by relying on the implementation of JArray in the 'jcc' module.
This is broken, though, as jcc itself is not built shared. In other words, it does not link
to the libjcc shared library but links that code statically. This makes importing it at runtime
- to reuse its JArray implementation - broken currently because the libjcc code is loaded
twice, once static, once shared and sharing is defeated.

For this bug to be fixed, jcc itself has to be built shared.
For jcc to be built shared, the libjcc shared library has to be built and installed before
jcc itself is built.
Currently, there is a bit of a chicken/egg problem with this because libjcc is built at the
same time as jcc, in

If libjcc's build were moved to a regular configure; make; make install kind of build then
all the above problems would resolve
themselves and we'd be able to get rid of the setuptools patching hackery for this Library
build as well.

Another sizable benefit would be that shared mode would be supported everywhere and become
the default.

I don't see this happening for the 3.5 release, though.

> JArray not shared - TypeError
> -----------------------------
>                 Key: PYLUCENE-13
>                 URL:
>             Project: PyLucene
>          Issue Type: Bug
>            Reporter: roman
>              Labels: build, jcc, pylucene
> JCC has the option to build module in a shared mode. However JArray....objects are never
> This works when using only lucene, but fails when the other module is linked against
> # create array of string objects
> x = j.JArray_object(5)
> for i in range(5):
>   x[i] = j.JArray_string(['x', 'z'])
> In [7]: for i in range(5):
>   x[i] = j.JArray_string(['x', 'z'])
>   ...:
>   ...:
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
> /dvt/workspace/montysolr/src/python/<ipython console> in <module>()
> TypeError: JArray<string>[u'x', u'z']
> The JArray functions/objects are different:
> In [9]: id(lucene.JArray_string)
> Out[9]: 140313957671376
> In [10]: id(solr_java.JArray_string)
> Out[10]: 140313919877648
> In [11]: id(montysolr_java.JArray_string)
> Out[11]: 140313909254704
> In [12]: id(j.JArray_string)
> Out[12]: 140313909254704
> Other objects are shared:
> In [18]: id(lucene.Weight)
> Out[18]: 140313957203040
> In [19]: id(solr_java.Weight)
> Out[19]: 140313957203040
> In [20]: id(j.Weight)
> Out[20]: 140313957203040
> The module 'j' is built with:
> -m  jcc  --shared  --import  lucene  --import  solr_java  --package
> org.apache.solr.request  --classpath ...  --include
> ../build/jar/montysolr_java-0.1.jar  --python  montysolr_java  --build
>  --bdist

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message