You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Erik Huelsmann <eh...@gmail.com> on 2005/04/20 16:22:31 UTC

Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

Having taken upon me the task to provide a Windows build for
Subversion, I run into a problem with the Ruby SWIG bindings. The
problem is with APR and Ruby Win32 header files though.

For those who don't know any of the terms used:
Subversion: the next generation of centralised version control
(http://www.tigris.org/; down until probably somewhere tomorrow)
SWIG: a plugin generator for programming languages (http://www.swig.org)
Ruby: a programming language (http://www.ruby-lang.org)
APR: the Apache Portable Runtime (http://apr.apache.org) upon which
Subversion has been built


Ok. So now for the real problem:

Windows does not define pid_t, gid_t or uid_t in any of the system
headers. Both APR and Ruby *do* define these 3 types:

in apr.hw (renamed to apr.h during windows build):

typedef int pid_t 
typedef int gid_t 
typedef int uid_t 

in win32.h from the ruby-mswin32-1.8.2 zip:

#define pid_t int
#define gid_t int
#define uid_t int

Normally I would resolve this problem by including apr.h first, then
followed by ruby.h; however, I use SWIG to generate the wrappers and
SWIG includes ruby.h first. Now the compiler is generating errors that
there are lines like this in the sources:

typedef int int 

which is ofcourse absolute non-sense.

Because I want to build to distribute, I don't want to modify any of
the headers involved. I do need some help getting out of this mess
though!


bye,

Erik.

Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

Posted by Branko Čibej <br...@xbc.nu>.
Erik Huelsmann wrote:

>On 4/22/05, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>  
>
>>At 05:23 PM 4/21/2005, Branko Cibej wrote:
>>    
>>
>>>This, I think, is a classic case of programmers' hubris. We should've defined apr_pid_t &co. on all platforms, not polluted the namespace with names that APR doesn't own (and that will clash with any Windows implementation of a POSIX-like API).
>>>      
>>>
>>++1.
>>
>>My last point about the patch to apr.hw to define FD_SETSIZE
>>suffers this exact same hubris.
>>
>>The quicker we (open source projects, collectively) stop trying
>>to enforce the 'one right way' to use posix/win32 etc, the sooner
>>these projects will compile (collectively) with one another.
>>    
>>
>
>I take that as a signal to go implement apr_pid_t and friends for all
>platforms (a patch for thrunk).  Do you have anything you want to
>stress before I start the work?
>  
>
Yes. Check if the APR code is actually using pid_t in public interfaces. 
I suspect that if it is, then apr_os_pid_t would be a more appropriate name.

-- Brane


Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

Posted by Erik Huelsmann <eh...@gmail.com>.
On 4/22/05, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
> At 05:23 PM 4/21/2005, Branko Cibej wrote:
> >This, I think, is a classic case of programmers' hubris. We should've defined apr_pid_t &co. on all platforms, not polluted the namespace with names that APR doesn't own (and that will clash with any Windows implementation of a POSIX-like API).
> 
> ++1.
> 
> My last point about the patch to apr.hw to define FD_SETSIZE
> suffers this exact same hubris.
> 
> The quicker we (open source projects, collectively) stop trying
> to enforce the 'one right way' to use posix/win32 etc, the sooner
> these projects will compile (collectively) with one another.

I take that as a signal to go implement apr_pid_t and friends for all
platforms (a patch for thrunk).  Do you have anything you want to
stress before I start the work?


bye,


Erik.

Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 05:23 PM 4/21/2005, Branko Čibej wrote:
>This, I think, is a classic case of programmers' hubris. We should've defined apr_pid_t &co. on all platforms, not polluted the namespace with names that APR doesn't own (and that will clash with any Windows implementation of a POSIX-like API).

++1.

My last point about the patch to apr.hw to define FD_SETSIZE
suffers this exact same hubris.

The quicker we (open source projects, collectively) stop trying 
to enforce the 'one right way' to use posix/win32 etc, the sooner
these projects will compile (collectively) with one another.




Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

Posted by Branko Čibej <br...@xbc.nu>.
Erik Huelsmann wrote:

>Having taken upon me the task to provide a Windows build for
>Subversion, I run into a problem with the Ruby SWIG bindings. The
>problem is with APR and Ruby Win32 header files though.
>
>For those who don't know any of the terms used:
>Subversion: the next generation of centralised version control
>(http://www.tigris.org/; down until probably somewhere tomorrow)
>SWIG: a plugin generator for programming languages (http://www.swig.org)
>Ruby: a programming language (http://www.ruby-lang.org)
>APR: the Apache Portable Runtime (http://apr.apache.org) upon which
>Subversion has been built
>
>
>Ok. So now for the real problem:
>
>Windows does not define pid_t, gid_t or uid_t in any of the system
>headers. Both APR and Ruby *do* define these 3 types:
>
>in apr.hw (renamed to apr.h during windows build):
>
>typedef int pid_t 
>typedef int gid_t 
>typedef int uid_t 
>  
>
This, I think, is a classic case of programmers' hubris. We should've 
defined apr_pid_t &co. on all platforms, not polluted the namespace with 
names that APR doesn't own (and that will clash with any Windows 
implementation of a POSIX-like API).


>in win32.h from the ruby-mswin32-1.8.2 zip:
>
>#define pid_t int
>#define gid_t int
>#define uid_t int
>  
>
But of course this is even worse. Both APR and Ruby should be fixed.

 
-- Brane