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

Re: Python bindings build seems broken

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Thu, 02 Oct 2008 10:42:31 -0400

David James wrote:
> On Wed, Oct 1, 2008 at 8:38 PM, C. Michael Pilato <cmpilato_at_red-bean.com> wrote:
>> I don't have the Gnome or KWallet keyring stuff configured in my Subversion
>> build, but that appears to not be preventing my Python SWIG bindings from
>> trying to link against such. Shouldn't our headers files (which are what
>> SWIG is parsing, IIUC) be conditionally defining those interfaces based on
>> the presence of #defines like these (from svn_private_config.h):
>>
>> /* Is GNOME Keyring support enabled? */
>> /* #undef SVN_HAVE_GNOME_KEYRING */
>>
>> /* Is Mac OS KeyChain support enabled? */
>> /* #undef SVN_HAVE_KEYCHAIN_SERVICES */
>>
>> /* Is KWallet support enabled? */
>> /* #undef SVN_HAVE_KWALLET */
>
> Hi Mike,
>
> This is a tricky issue. Since we ship the C files generated by SWIG in
> the Subversion tarball, our generated files must be
> platform-independent. Unfortunately, if we hide functions from SWIG,
> our generated C files won't be platform-independent anymore.
>
> I can see three ways to resolve this issue:
> 1. Teach SWIG to add the necessary "#if" statements to the generated
> C file, so that our generated C files continue to be platform
> independent. This is the route that I took with the ctypes python
> bindings.
> 2. Give up on shipping platform-independent C files, and instead
> just add the necessary #if statements to the header files. In this
> case, we will also need to update our build scripts so that we don't
> include the generated C files in our tarball anymore.
> 3. Bypass the whole issue by just teaching SWIG to ignore all of our
> platform-specific functions.
>
> If you do add #if statements to the header files, please make sure
> that all platform-specific functions are defined when CTYPESGEN macro
> is present. This is necessary so that ctypesgen can generate
> definitions for the platform-specific functions in a
> platform-independent manner. For example:
> #if defined(SVN_HAVE_GNOME_KEYRING) || defined(DOXYGEN) || defined(CTYPESGEN)
> ...

Is this another option:

  4. Don't have platform-specific visibility for APIs in Subversion at all.
      Instead, move the #defines that toggle the availability down into the
      functions/structures themselves so that on platforms where the
      functionality is not available, a not-implemented error is thrown?

?

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-10-02 16:42:52 CEST

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

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