[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Ctypes Python Bindings Errors

From: Justin Johnson <justin_at_honesthacker.com>
Date: Thu, 19 Nov 2009 19:15:06 -0600

>>> Hi,
>>>
>>> I'm trying to get the new ctypes python bindings working.  I have built them
>>> successfully, but when I run the tests I get errors like the following.
>>>
>>> $ make check-ctypes-python
>>> cd /svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python; \
>>>   /bin/bash /svn/inst/build/subversion-1.6.5/libtool --tag=CC --silent
>>> --mode=execute `for f in /svn/inst/build/subversion-1.6.5/subversion/*/*.la;
>>> do echo -dlopen $f; done` /svn/inst/python/bin/python setup.py build
>>> --subversion="/svn/inst" \
>>>   --apr="/svn/inst/apache2.2" --apr-util="/svn/inst/apache2.2" \
>>>   --ctypesgen="/svn/inst/python/bin/ctypesgen.py"
>>> --svn-headers="/svn/inst/build/subversion-1.6.5/subversion/include" \
>>>   --cppflags="-DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
>>> -D_LARGEFILE64_SOURCE " --ldflags=""
>>> running build
>>> csvn/core/functions.py was not regenerated (output up-to-date)
>>> running build_py
>>> copying csvn/repos.py -> build/lib/csvn
>>> cd /svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python; \
>>>   /bin/bash /svn/inst/build/subversion-1.6.5/libtool --tag=CC --silent
>>> --mode=execute `for f in /svn/inst/build/subversion-1.6.5/subversion/*/*.la;
>>> do echo -dlopen $f; done` /svn/inst/python/bin/python test/run_all.py
>>> EEEEEEEEEEEEEEEEEEEEEEEE.E
>>> ======================================================================
>>> ERROR: test_local_check_path (localrepos.LocalRepositoryTestCase)
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>>   File
>>> "/svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python/test/localrepos.py",
>>> line 22, in setUp
>>>     self.repos = LocalRepository(repos_location, create=True)
>>>   File
>>> "/svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python/csvn/repos.py",
>>> line 376, in __init__
>>>     None, None, None, None, self.pool)
>>>   File
>>> "/svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python/csvn/core/functions.py",
>>> line 47, in SVN_ERR
>>>     raise SubversionException(err)
>>> SubversionException: Repository creation failed
>>> Could not create top-level directory
>>> '.' exists and is non-empty
>>>
>>> ...
>>>
>>> A similar error occurs for 25 of the 26 tests.  The directory /tmp exists
>>> and is writable.  I'm running Subversion 1.6.5, Apache 2.2.11, ctypesgen
>>> from trunk @ r83 in their svn repository since they have no releases, and
>>> Python 2.6.4 on Solaris 10.
>>>
>>> If I try to access an existing local repository I get the error below.
>>>
>>>>>> import csvn.core
>>>>>> from csvn.repos import *
>>>>>> from csvn.auth import User
>>>>>> import os
>>>>>> csvn.core.svn_cmdline_init("", csvn.core.stderr)
>>> 0
>>>>>> user=User(username="svnuser")
>>>>>> repos=LocalRepository("/svn/repos/testrepo")
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>>   File "/svn/inst/python/lib/python2.6/site-packages/csvn/repos.py", line
>>> 378, in __init__
>>>     svn_repos_open(byref(self._as_parameter_), path, self.pool)
>>>   File
>>> "/svn/inst/python/lib/python2.6/site-packages/csvn/core/functions.py", line
>>> 47, in SVN_ERR
>>>     raise SubversionException(err)
>>> csvn.core.functions.SubversionException: Can't open file 'format': No such
>>> file or directory
>>>
>>>
>>> Does anyone know what I'm doing wrong?
>>>
>>> Thanks.
>>> Justin
>>>
>>
>> Has anyone successfully used the ctypes python bindings on Solaris?
>>
>
> I went back to rebuild ctypes-python and noticed there is one error in
> the output.
>
> Error: /svn/inst/include/lber.h:61: Syntax error at '\n'
>
> The full context of the error is below.
>
> $ make ctypes-python
> cd /svn/inst/build/subversion-1.6.5/subversion/bindings/ctypes-python; \
>  /bin/bash /svn/inst/build/subversion-1.6.5/libtool --tag=CC --silent
> --mode=execute `for f in
> /svn/inst/build/subversion-1.6.5/subversion/*/*.la; do echo -dlopen
> $f; done` /svn/inst/python/bin/python setup.py build
> --subversion="/svn/inst" \
>  --apr="/svn/inst/apache2.2" --apr-util="/svn/inst/apache2.2" \
>  --ctypesgen="/svn/inst/python/bin/ctypesgen.py"
> --svn-headers="/svn/inst/build/subversion-1.6.5/subversion/include" \
>  --cppflags="-DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE " --ldflags=""
> running build
> /svn/inst/python/bin/python /svn/inst/python/bin/ctypesgen.py --cpp
> 'gcc -E -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE  -I/svn/inst/apache2.2/include/apr-1
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I/svn/inst/apache2.2/include/apr-1
> -I/svn/inst/include -Isubversion/include' -L/svn/inst/apache2.2/lib
> -lapr-1 -L/svn/inst/lib -L/svn/inst/apache2.2/lib -laprutil-1
> -L/svn/inst/lib -lsvn_subr-1 -lsvn_diff-1 -lsvn_delta-1 -lsvn_fs-1
> -lsvn_repos-1 -lsvn_wc-1 -lsvn_ra-1 -lsvn_client-1
> subversion/include/svn_*.h
> /svn/inst/apache2.2/include/apr-1/ap[ru]_*.h -o
> subversion/bindings/ctypes-python/svn_all.py --no-macro-warnings
> --strip-build-path=/svn/inst/build/subversion-1.6.5
> Status: Preprocessing /tmp/tmpumh2rV.h
> Status: gcc -E -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE  -I/svn/inst/apache2.2/include/apr-1
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I/svn/inst/apache2.2/include/apr-1
> -I/svn/inst/include -Isubversion/include -U __GNUC__ -dD "-Dinline="
> "-D__inline__=" "-D__extension__=" "-D_Bool=uint8_t" "-D__const=const"
> "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" /tmp/tmpumh2rV.h
> Status: Parsing /tmp/tmpumh2rV.h
> Error: /svn/inst/include/lber.h:61: Syntax error at '\n'
> Status: Processing description list.
> Warning: Member "in" of Struct "apr_proc_t" has been renamed to "_in"
> because it has the same name as a Python keyword.
> Status: Writing to subversion/bindings/ctypes-python/svn_all.py.
> Status: Wrapping complete.
> cat csvn/core/functions.py.in svn_all2.py > csvn/core/functions.py
> Generated csvn/core/functions.py successfully
> running build_py
> creating build
> creating build/lib
> creating build/lib/csvn
> copying csvn/repos.py -> build/lib/csvn
> copying csvn/txn.py -> build/lib/csvn
> copying csvn/wc.py -> build/lib/csvn
> copying csvn/__init__.py -> build/lib/csvn
> copying csvn/auth.py -> build/lib/csvn
> copying csvn/types.py -> build/lib/csvn
> creating build/lib/csvn/core
> copying csvn/core/functions.py -> build/lib/csvn/core
> copying csvn/core/__init__.py -> build/lib/csvn/core
> creating build/lib/csvn/ext
> copying csvn/ext/__init__.py -> build/lib/csvn/ext
> copying csvn/ext/callback_receiver.py -> build/lib/csvn/ext
> copying csvn/ext/listmixin.py -> build/lib/csvn/ext
>
>
> Any ideas on why this error is occurring?  I saw a similar error and
> discussion at http://svn.haxx.se/dev/archive-2008-07/0045.shtml but
> I'm not sure if it's relevant to my error.

I spoke with Tim Maxwell from ctypesgen about this error and it sounds
like it doesn't explain why the bindings are failing for me. Here's
his comment.

"""
The problem that ctypesgen reports seems to be caused by the macro
LBER_INVALID at line 71. The parentheses are unbalanced. For some
reason the wrong line number is reported.

However, this probably is not the cause of your Subversion problem,
because ctypesgen emits everything correctly except for the
LBER_INVALID macro. I don't know anything about the Subversion Python
bindings; I'm only involved with with ctypesgen itself.
"""

Does anyone have any other insight into this?

Thanks.
Justin

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420354

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-20 02:15:56 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.