You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@xbc.nu> on 2005/08/27 20:00:36 UTC

Pytnon biindings build hoesd on Windows

The Python bindings on HEAD of trunk don't compile on windows. Part of 
this seems to be a bug in the runtime generator:

Compiling...
swigutil_py.c
..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1313) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'
..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1319) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'


This is the relevamt bit in swig_python_external_runtime.swg:

#else

SWIGRUNTIMEINLINE swig_type_info *
SWIG_TypeQuery(const char *name) {
  swig_module_info *module = SWIG_GetModule();
  return SWIG_TypeQueryModule(module, module, name);
}

SWIGRUNTIMEINLINE swig_type_info *
SWIG_MangledTypeQuery(const char *name) {
  swig_module_info *module = SWIG_GetModule();
  return SWIG_MangledTypeQueryModule(module, module, name);
}

#endif



The other issue seems to be s SWIG problem:

Performing Custom Build Step on ..\..\..\subversion\bindings\swig\core.i
C:\Home\brane\src\svn\httpd-2.0.54\srclib\apr\include\apr.h(326): Error: Syntax error in input.


This is the offending line in apr.h:

typedef  unsigned __int64  apr_uint64_t;




-- Brane


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

Re: [PATCH] Fix non-portable use of filehandles in Perl bindings

Posted by Branko Čibej <br...@xbc.nu>.
David James wrote:

>On 8/29/05, David James <ja...@gmail.com> wrote:
>  
>
>>Good catch! I've upgraded the Perl bindings to use _get_os_fhandle on
>>Win32. I believe this construct is more portable -- the python
>>bindings use this technique. A new patch is attached.
>>
>>portable_filehandles_patch.txt:
>>[[[
>>
>>Fix non-portable use of filehandles in the Perl bindings.
>>
>>* swig/perl/libsvn_swig_perl/swigutil_pl.c
>>  (svn_swig_pl_make_file): On Win32, use _get_os_fhandle to convert
>>  Perl file numbers into Windows file handles.
>>
>>]]]
>>
>>missing_svn_time_header_patch.txt:
>>[[[
>>
>>* swig/include/svn_global.swg:
>> Include svn_time.h, so that the return type of svn_parse_date will
>> be defined.
>>
>>]]]
>>    
>>
>
>Oops -- my original pprtable filehandles patch was missing an #ifdef.
>See attached file, portable_filehandles_patch_v2.txt, for an updated
>version.
>  
>
Thanks. Committed in r15975. Now we've only two fixable warnings left in 
the Perl and Python bindings builds -- the ones about "not enough actual 
parameters for macro 'SWIG_GetModule'".

-- Brane


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

Re: [PATCH] Fix non-portable use of filehandles in Perl bindings (was: [PATCH] Fix warnings in the Windows build of the Perl bindings)

Posted by David James <ja...@gmail.com>.
On 8/29/05, David James <ja...@gmail.com> wrote:
> Good catch! I've upgraded the Perl bindings to use _get_os_fhandle on
> Win32. I believe this construct is more portable -- the python
> bindings use this technique. A new patch is attached.
> 
> portable_filehandles_patch.txt:
> [[[
> 
> Fix non-portable use of filehandles in the Perl bindings.
> 
> * swig/perl/libsvn_swig_perl/swigutil_pl.c
>   (svn_swig_pl_make_file): On Win32, use _get_os_fhandle to convert
>   Perl file numbers into Windows file handles.
> 
> ]]]
> 
> missing_svn_time_header_patch.txt:
> [[[
> 
> * swig/include/svn_global.swg:
>  Include svn_time.h, so that the return type of svn_parse_date will
>  be defined.
> 
> ]]]

Oops -- my original pprtable filehandles patch was missing an #ifdef.
See attached file, portable_filehandles_patch_v2.txt, for an updated
version.

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

[PATCH] Fix non-portable use of filehandles in Perl bindings (was: [PATCH] Fix warnings in the Windows build of the Perl bindings)

Posted by David James <ja...@gmail.com>.
On 8/29/05, Branko Čibej <br...@xbc.nu> wrote:
> David James wrote:
> 
> >Index: subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
> >===================================================================
> >--- subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c       (revision 15951)
> >+++ subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c       (working copy)
> >@@ -1370,7 +1370,8 @@
> >                     pool);
> >     } else if (SvROK(file) && SvTYPE(SvRV(file)) == SVt_PVGV) {
> >         apr_status_t status;
> >-        apr_os_file_t osfile = PerlIO_fileno(IoIFP(sv_2io(file)));
> >+        apr_os_file_t osfile = (apr_os_file_t)
> >+          PerlIO_fileno(IoIFP(sv_2io(file)));
> >
> >
> This won't work and can't work on Windows. PerlIO_fileno returns an int
> file descriptor. apr_os_file_t is a HANDLE, a completely different,
> totally incompatible beast.
Good catch! I've upgraded the Perl bindings to use _get_os_fhandle on
Win32. I believe this construct is more portable -- the python
bindings use this technique. A new patch is attached.

portable_filehandles_patch.txt:
[[[

Fix non-portable use of filehandles in the Perl bindings.

* swig/perl/libsvn_swig_perl/swigutil_pl.c
  (svn_swig_pl_make_file): On Win32, use _get_os_fhandle to convert
  Perl file numbers into Windows file handles.

]]]

missing_svn_time_header_patch.txt:
[[[

* swig/include/svn_global.swg:
 Include svn_time.h, so that the return type of svn_parse_date will
 be defined.

]]]



Cheers,

David




-- 
David James -- http://www.cs.toronto.edu/~james

Re: [PATCH] Fix warnings in the Windows build of the Perl bindings

Posted by Branko Čibej <br...@xbc.nu>.
David James wrote:

>Index: subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
>===================================================================
>--- subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c	(revision 15951)
>+++ subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c	(working copy)
>@@ -1370,7 +1370,8 @@
>                     pool);
>     } else if (SvROK(file) && SvTYPE(SvRV(file)) == SVt_PVGV) {
>         apr_status_t status;
>-        apr_os_file_t osfile = PerlIO_fileno(IoIFP(sv_2io(file)));
>+        apr_os_file_t osfile = (apr_os_file_t) 
>+          PerlIO_fileno(IoIFP(sv_2io(file)));
>  
>
This won't work and can't work on Windows. PerlIO_fileno returns an int 
file descriptor. apr_os_file_t is a HANDLE, a completely different, 
totally incompatible beast.

-- Brane


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

[PATCH] Fix warnings in the Windows build of the Perl bindings

Posted by David James <ja...@gmail.com>.
On 8/28/05, Branko Čibej <br...@xbc.nu> wrote:
> subversion\bindings\swig\perl\libsvn_swig_perl\swigutil_pl.c(1373) : warning C4047: 'initializing' : 'void *' differs in levels of indirection from 'int '
> subversion\bindings\swig\perl\native\svn_client.c(4495) : warning C4013: 'svn_parse_date' undefined; assuming extern returning int
> subversion\bindings\swig\perl\native\svn_client.c(4496) : warning C4047: '=' : 'struct svn_error_t *' differs in levels of indirection from 'int '
[ ... snip dozens more C4047 warnings from svn_client.c ... ]
> subversion\bindings\swig\perl\native\svn_client.c(13204) : warning C4047: '=' : 'struct svn_error_t *' differs in levels of indirection from 'int '
> subversion\bindings\swig\perl\native\svn_wc.c(2614) : warning C4013: 'svn_parse_date' undefined; assuming extern returning int
> subversion\bindings\swig\perl\native\svn_wc.c(2615) : warning C4047: '=' : 'struct svn_error_t *' differs in levels of indirection from 'int '

That's quite a few warnings! I've attached a patch, which should
hopefully greatly reduce the number of warnings in the Windows build
of the Perl bindings.

[[[

Fix warnings in the Windows build of Perl bindings.

* swig/perl/libsvn_swig_perl/swigutil_pl.c
  (svn_swig_pl_make_file): Cast the return value from PerlIO_fileno to
  apr_os_file_t, to avoid warnings in the windows build of the Perl
  bindings.
* swig/include/svn_global.swg:
  Include svn_time.h, so that the return type of svn_parse_date will
  be defined.

]]]

Cheers,

David



-- 
David James -- http://www.cs.toronto.edu/~james

Re: SWIG biindings build hosed on Windows

Posted by Branko Čibej <br...@xbc.nu>.
David James wrote:

>[[[
>
>* subversion/bindings/swig/include/apr.swg:
>  Define Perl typemaps for "long long" datatypes. Use apr_int64_t
>  and apr_uint64_t to convert datatypes.
>* subversion/bindings/swig/include/svn_types.swg
>  (svn_filesize_t): Use APR_INT64_FMT_T instead of hardcoded
>  long long format.
>* subversion/bindings/swig/proxy/apr_h.swg:
>  Workaround SWIG bug which means that SWIG cannot parse "__int64",
>  by defining "__int64" to be "long long".
>
>]]]
>  
>
O.K., this helps a bit. Both Perl and Python bindings now build on 
Windows. I've minimally tested Python, not tested Perl at all.

There are lots of warnings new in the Perl build, and a couple in the 
Python build. I'm attaching a list.

Anyway, I committed a slightly tweaked version of this patch in r15951 
-- even though the bindings aren't tested, they couldn't be more broken 
with the patch than they were without it. :)

-- Brane


Re: SWIG biindings build hosed on Windows

Posted by Branko Čibej <br...@xbc.nu>.
David James wrote:

>It looks like SWIG can't handle the __int64 type. Perhaps we can fool
>SWIG by defining __int64 to "long long".
>
>Try this patch:
>
>[[[
>
>subversion/bindings/swig/proxy/apr_h.swg:
>  Workaround SWIG bug which means that SWIG cannot parse "__int64",
>  by defining "__int64" to be "long long".
>
>]]]
>  
>
Well, this certainly helps the Python bindings to compile (and work, as 
far as I can see), but it kills the Perl bindings:

subversion\bindings\swig\perl\native\core.c(1605) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(1723) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(2219) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(2385) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(3459) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(3517) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(3737) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(5768) : error C2632: 'long' followed by 'long' is illegal
subversion\bindings\swig\perl\native\core.c(9402) : error C2632: 'long' followed by 'long' is illegal


Note that *without* this patch, the Perl bindings build fails with the 
same error as the Python bindings build... that's a bit of a bummer.

-- Brane


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

Re: Pytnon biindings build hosed on Windows

Posted by Branko Čibej <br...@xbc.nu>.
David James wrote:

>On 8/27/05, Branko Čibej <br...@xbc.nu> wrote:
>  
>
>>The Python bindings on HEAD of trunk don't compile on windows. Part of
>>this seems to be a bug in the runtime generator:
>>
>>Compiling...
>>swigutil_py.c
>>..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1313) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'
>>..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1319) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'
>>    
>>
>
>These warnings look like they were caused by a SWIG bug. The
>SWIG_GetModule macro is defined as follows by SWIG 1.3.25 on my
>machine:
>   #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
>
>Later in the file, SWIG uses the SWIG_GetModule macro as a zero-argument macro:
>  swig_module_info *module = SWIG_GetModule();
>
>GCC parses the above as follows:
>  swig_module_info *module = SWIG_Python_GetModule();
>
>Can Microsoft Visual C++ handle the above code? You said that Visual
>C++ reports warnings; does the code still work? If not, I can modify
>our runtime generator to work around this SWIG bug.
>  
>
Well, they're warnings, so the code does compile. I've no idea if it 
works, though, since I can't compile the bindings. :)

I'd be much happier if we got rid of the warnings, even if they're benign.

>>The other issue seems to be s SWIG problem:
>>
>>Performing Custom Build Step on ..\..\..\subversion\bindings\swig\core.i
>>C:\Home\brane\src\svn\httpd-2.0.54\srclib\apr\include\apr.h(326): Error: Syntax error in input.
>>
>>
>>This is the offending line in apr.h:
>>
>>typedef  unsigned __int64  apr_uint64_t;
>>    
>>
>
>It looks like SWIG can't handle the __int64 type. Perhaps we can fool
>SWIG by defining __int64 to "long long".
>  
>
I though about this, but I was confused because the line _before_ that 
one in apr.h reads:

    typedef  __int64  apr_int64_t;

and SWIG doesn't complain about it.
i'll try your patch anyway, will let you know how it goes.

-- Brane


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

Re: Pytnon biindings build hoesd on Windows

Posted by David James <ja...@gmail.com>.
On 8/27/05, Branko Čibej <br...@xbc.nu> wrote:
> The Python bindings on HEAD of trunk don't compile on windows. Part of
> this seems to be a bug in the runtime generator:
> 
> Compiling...
> swigutil_py.c
> ..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1313) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'
> ..\..\..\subversion\bindings\swig\proxy\swig_python_external_runtime.swg(1319) : warning C4003: not enough actual parameters for macro 'SWIG_GetModule'

These warnings look like they were caused by a SWIG bug. The
SWIG_GetModule macro is defined as follows by SWIG 1.3.25 on my
machine:
   #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()

Later in the file, SWIG uses the SWIG_GetModule macro as a zero-argument macro:
  swig_module_info *module = SWIG_GetModule();

GCC parses the above as follows:
  swig_module_info *module = SWIG_Python_GetModule();

Can Microsoft Visual C++ handle the above code? You said that Visual
C++ reports warnings; does the code still work? If not, I can modify
our runtime generator to work around this SWIG bug.

> The other issue seems to be s SWIG problem:
> 
> Performing Custom Build Step on ..\..\..\subversion\bindings\swig\core.i
> C:\Home\brane\src\svn\httpd-2.0.54\srclib\apr\include\apr.h(326): Error: Syntax error in input.
> 
> 
> This is the offending line in apr.h:
> 
> typedef  unsigned __int64  apr_uint64_t;

It looks like SWIG can't handle the __int64 type. Perhaps we can fool
SWIG by defining __int64 to "long long".

Try this patch:

[[[

subversion/bindings/swig/proxy/apr_h.swg:
  Workaround SWIG bug which means that SWIG cannot parse "__int64",
  by defining "__int64" to be "long long".

]]]


Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james