You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Cooke, Mark" <ma...@siemens.com> on 2014/10/09 14:32:03 UTC

Compiling python bindings (VS2012, Windows 7)

Dear list,

I thought I had subversion compiled OK, all the tests appear to be passing, but when I went looking for the python bindings they were missing.  Looking at the VS2012 solution file, the __SWIG_PYTHON__ project seems to be empty and does nothing when rebuilt.

So I have re-built the following [Libraries > Swig] projects:
- libsvn_swig_py
- swig_python_core
- swig_python_client
- swig_python_delta
- swig_python_diff
- swig_python_fs
- swig_python_ra
- swig_python_repos
- swig_python_wc

All appear to build OK (although with plenty of warnings) and I end up with a collection of pyd files in D:\svn\src\Release\subversion\bindings\swig\python
...plus
D:\svn\src\Release\subversion\bindings\swig\python\libsvn_swig_py\libsvn_swig_py-1.dll

I copied the files following the instructions here:

[1] http://www.lejordet.com/2009/03/compiling-subversion-python-bindings-on-windows/

...creating `svn` and `libsvn` folders, then copied those to my python install [Lib\site-packages].

However, I still get the dreaded "ImportError: DLL load failed: The specified module could not be found."

I tried copying the three APR DLLs to libsvn in case but that does not seem to have helped.

Should I compile subversion with the "--disable-shared" option?

Or, there is a comment at [1] concerning the _USE_32BIT_TIME_T preprocessor definition for APR and Swig, is this still an issue for subversion 1.8.10 builds?

Thanks for any pointers...

~ Mark C

Sources used:-
apr-1.5.1-win32-src.zip
apr-iconv-1.2.1-win32-src-r2.zip
apr-util-1.5.4-win32-src.zip
httpd-2.4.10.tar.gz
openssl-1.0.1i.tar.gz
pcre-8.36.tar.bz2
serf-1.3.7.zip
sqlite-amalgamation-3080600.zip
subversion-1.8.10.zip
zlib128.zip


RE: Compiling python bindings (VS2012, Windows 7)

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Cooke, Mark [mailto:mark.cooke@siemens.com]
> Sent: donderdag 9 oktober 2014 14:32
> To: users@subversion.apache.org
> Subject: Compiling python bindings (VS2012, Windows 7)
> 
> Dear list,
> 
> I thought I had subversion compiled OK, all the tests appear to be
passing,
> but when I went looking for the python bindings they were missing.
Looking
> at the VS2012 solution file, the __SWIG_PYTHON__ project seems to be
> empty and does nothing when rebuilt.
> 
> So I have re-built the following [Libraries > Swig] projects:
> - libsvn_swig_py
> - swig_python_core
> - swig_python_client
> - swig_python_delta
> - swig_python_diff
> - swig_python_fs
> - swig_python_ra
> - swig_python_repos
> - swig_python_wc
> 
> All appear to build OK (although with plenty of warnings) and I end up
with a
> collection of pyd files in
> D:\svn\src\Release\subversion\bindings\swig\python
> ...plus
> D:\svn\src\Release\subversion\bindings\swig\python\libsvn_swig_py\libsvn
> _swig_py-1.dll
> 
> I copied the files following the instructions here:
> 
> [1] http://www.lejordet.com/2009/03/compiling-subversion-python-
> bindings-on-windows/
> 
> ...creating `svn` and `libsvn` folders, then copied those to my python
install
> [Lib\site-packages].
> 
> However, I still get the dreaded "ImportError: DLL load failed: The
specified
> module could not be found."
> 
> I tried copying the three APR DLLs to libsvn in case but that does not
seem to
> have helped.
> 
> Should I compile subversion with the "--disable-shared" option?
> 
> Or, there is a comment at [1] concerning the _USE_32BIT_TIME_T
> preprocessor definition for APR and Swig, is this still an issue for
subversion
> 1.8.10 builds?
> 
> Thanks for any pointers...

On the buildbot I use two scripts for running the python tests:

For trunk/1.9 I use:
################
python win-tests.py -r -f fsfs --swig=python "%TESTDIR%\tests"
(The actual script is in win-tests.py)

For older versions:
################
    IF EXIST "%TESTDIR%\swig" rmdir /s /q "%TESTDIR%\swig"
    mkdir "%TESTDIR%\swig\py-release\libsvn"
    mkdir "%TESTDIR%\swig\py-release\svn"

    xcopy "release\subversion\bindings\swig\python\*.pyd"
"%TESTDIR%\swig\py-release\libsvn\*.pyd" > nul:
    xcopy "release\subversion\bindings\swig\python\libsvn_swig_py\*.dll"
"%TESTDIR%\swig\py-release\libsvn\*.dll" > nul:
    xcopy "subversion\bindings\swig\python\*.py"
"%TESTDIR%\swig\py-release\libsvn\*.py" > nul:
    xcopy "subversion\bindings\swig\python\svn\*.py"
"%TESTDIR%\swig\py-release\svn\*.py" > nul:

    SET PYTHONPATH=%TESTDIR%\swig\py-release

    python subversion\bindings\swig\python\tests\run_all.py



I'm not sure if this really follows recommended practice, but it does allow
me to run the python tests on Windows as a non admin.


	Bert