You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mats Nilsson <ma...@xware.se> on 2002/10/30 09:37:35 UTC

swig problems on win32

I'm trying to build the swig bindings on win2k, so that I can try the 
cvs2svn.py script on our converted MKS Source Integrity repository (MKS SI 
is based on an extended RCS file format).

I'm using svn r3575, latest cvs versions of apr-XXX, prebuilt win32 version 
of swig-1.3.16. I also tried both ActivePython 2.2.1-222 and cygwin python 
2.2.1-#1.

Trying to mimic what's in Makefile.in, I try the following command. Does 
anyone know why it stops swigging the first file? I realize that the 
command might need additional -L switches, but I'll get there eventually.

Also, this is my first adventure with swig, so I'm not really familiar with 
how it works.

Thanks
Mats


C:\temp\svn\subversion\bindings\swig\python>python setup.py -I 
c:/temp/svn/subversion/bindings/swig -I c:/temp/svn/subversion/include -I 
c:/temp/svn/apr/include -S c:/temp/svn/subversion/bindings/swig -L 
c:/temp/svn/apr/libR  -s c:/temp/swig-1.3.16/swig.exe build 
--build-base=c:/temp/svn/subversion/bindings/swig/python/build

running build
running build_py
creating c:\temp\svn\subversion\bindings\swig\python\build
creating c:\temp\svn\subversion\bindings\swig\python\build\lib.win32-2.2
creating c:\temp\svn\subversion\bindings\swig\python\build\lib.win32-2.2\svn
copying svn\client.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\delta.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\fs.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\ra.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\repos.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\util.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\wc.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
copying svn\__init__.py -> 
c:/temp/svn/subversion/bindings/swig/python/build\lib.win32-2.2\svn
running build_ext
building '_client' extension
swigging c:/temp/svn/subversion/bindings/swig/svn_client.i to 
c:/temp/svn/subversion/bindings/swig/python/build\svn_client.c
c:/temp/swig-1.3.16/swig.exe -c -python -noproxy 
-Ic:/temp/svn/subversion/bindings/swig -Ic:/temp/svn/subversion/include 
-Ic:/temp/svn/apr/include -IC:\Python22\include -o 
c:/temp/svn/subversion/bindings/swig/python/build\svn_client.c 
c:/temp/svn/subversion/bindings/swig/svn_client.i
c:/temp/svn/subversion/bindings/swig/apr.i:62: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/apr.i:84: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/apr.i:91: Can't copy typemap.
c:/temp/svn/subversion/bindings/swig/apr.i:112: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/svn_types.i:33: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/svn_string.i:68: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/svn_string.i:104: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/svn_client.i:92: Warning(119): 
%typemap(ignore) has been replaced by %typemap(in,numinputs=0).
c:/temp/svn/subversion/bindings/swig/svn_client.i:146: Can't copy typemap.
error: command 'c:/temp/swig-1.3.16/swig.exe' failed with exit status 2


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: swig problems on win32

Posted by Mats Nilsson <ma...@xware.se>.
At 14:06 2002-10-30, Mats Nilsson wrote:
>I've built a static lib around swigutil_py.c and I've almost
>completed the dll corresponding to svn_client.i.
>
>The only thing I'm missing right now is the swigpy.lib to resolve some
>references to _SWIG_ConvertPtr and others.

Which turned out to have a simple quick'n-dirty fix. I added a file to my 
swigutil_py project that #includes various parts of the SWIG distro.

After some more modifications to the .i files, I've finally managed to 
build all the .pyd files. But, cvs2svn crashes during pass 4, so I gather 
my changes were not entirely correct :-)

For one thing, the following snippet from apr.i seems wrong for windows/msvc:
         %apply long long { apr_time_t };

This causes the incompilable code to be emitted when processing util.i

On the other hand,
         %apply long *OUTPUT { apr_off_t * };
causes warnings during compilation of code generated from svn_fs.i, since 
on windows, apr_off_t is an __int64.

So after fixing these problems by hand (apr_off_t -> long long in .i, and 
replacing "long long" with corresponding apr_off_t, or apr_time_t in the 
generated code), I run cvs2svn.py and get the following output.

C:\temp\svn\subversion\tools\cvs2svn>svnadmin create c:/temp/s1
C:\temp\svn\subversion\tools\cvs2svn>python cvs2svn.py -p 4 -s c:/temp/s1 
-v c:/temp/cvsrepos/
----- pass 4 -----
committing: Mon Oct 30 18:00:34 2002, over 30 seconds
     changing 1.1 : /trunk/foo\bar.cpp
     making dir: /trunk/foo
     changing 1.1 : /trunk/foo\bar.h
Traceback (most recent call last):
   File "cvs2svn.py", line 702, in ?
     main()
   File "cvs2svn.py", line 699, in main
     util.run_app(convert, ctx, start_pass=start_pass)
   File "svn\util.py", line 38, in run_app
     return apply(func, (pool,) + args, kw)
   File "cvs2svn.py", line 632, in convert
     _passes[i](ctx)
   File "cvs2svn.py", line 589, in pass4
     c.commit(t_fs, ctx)
   File "cvs2svn.py", line 439, in commit
     author, log, date = self.get_metadata(c_pool)
   File "cvs2svn.py", line 310, in get_metadata
     a_t = util.apr_time_ansi_put(self.t_max)[1]
TypeError: Type error. Expected _p_time_t


By chance, does anyone know what this is about?

Thanks,

Mats


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: swig problems on win32

Posted by Mats Nilsson <ma...@xware.se>.
At 10:56 2002-10-30, cmpilato@collab.net wrote:
>I wasn't seeing what you were seeing.  I didn't use setup.py, either,
>though.  I was just trying to use swig by hand (well, using a .BAT
>file) and I *was* able to get the .c files generated.  At that point,
>I realized I'd accomplished the easiest of several much harder steps,
>and decided to return to Linux-land for the rest of the night. :-)

Another try.

The offending lines in svn_client.i were commented out for now. At least 
this enables swig to generate a .c file that I can play with.

Next problem: running the process through setup.py will invoke the compiler 
without /DWIN32, thus making the body of apr.h be skipped altogether.

Rather than patching the core python files, or the apr.h header, I'm now 
taking a different approach: making .dsp:s from scratch for all the 
different stuff that needs to be built. This seems to work without too much 
effort. I've built a static lib around swigutil_py.c and I've almost 
completed the dll corresponding to svn_client.i.

The only thing I'm missing right now is the swigpy.lib to resolve some 
references to _SWIG_ConvertPtr and others.

However, no such lib is included in the swig-1.3.16.zip that I downloaded :-(

I guess I'll continue my swig journey tomorrow.

Mats signing off.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: swig problems on win32

Posted by cm...@collab.net.
Mats Nilsson <ma...@xware.se> writes:

> I'm trying to build the swig bindings on win2k, so that I can try the
> cvs2svn.py script on our converted MKS Source Integrity repository
> (MKS SI is based on an extended RCS file format).
> 
> I'm using svn r3575, latest cvs versions of apr-XXX, prebuilt win32
> version of swig-1.3.16. I also tried both ActivePython 2.2.1-222 and
> cygwin python 2.2.1-#1.

Heheh...I tried this for the first time earlier tonight, too!

> Trying to mimic what's in Makefile.in, I try the following
> command. Does anyone know why it stops swigging the first file? I
> realize that the command might need additional -L switches, but I'll
> get there eventually.
> 
> Also, this is my first adventure with swig, so I'm not really familiar
> with how it works.

I wasn't seeing what you were seeing.  I didn't use setup.py, either,
though.  I was just trying to use swig by hand (well, using a .BAT
file) and I *was* able to get the .c files generated.  At that point,
I realized I'd accomplished the easiest of several much harder steps,
and decided to return to Linux-land for the rest of the night. :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org