You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexey Neyman <st...@att.net> on 2014/08/21 02:29:35 UTC

r1619122 (stsp) broke 'make swig-py'

The new fields added in svn_wc.h cause the following errors:

subversion/bindings/swig/python/svn_wc.c: In function 
‘_wrap_svn_wc_conflict_description2_t_prop_value_base_set’:
subversion/bindings/swig/python/svn_wc.c:8798: error: ‘_global_pool’ 
undeclared (first use in this function)
subversion/bindings/swig/python/svn_wc.c:8798: error: (Each undeclared 
identifier is reported only once
subversion/bindings/swig/python/svn_wc.c:8798: error: for each function it 
appears in.)
subversion/bindings/swig/python/svn_wc.c: In function 
‘_wrap_svn_wc_conflict_description2_t_prop_value_working_set’:
subversion/bindings/swig/python/svn_wc.c:8859: error: ‘_global_pool’ 
undeclared (first use in this function)
subversion/bindings/swig/python/svn_wc.c: In function 
‘_wrap_svn_wc_conflict_description2_t_prop_value_incoming_old_set’:
subversion/bindings/swig/python/svn_wc.c:8920: error: ‘_global_pool’ 
undeclared (first use in this function)
subversion/bindings/swig/python/svn_wc.c: In function 
‘_wrap_svn_wc_conflict_description2_t_prop_value_incoming_new_set’:
subversion/bindings/swig/python/svn_wc.c:8981: error: ‘_global_pool’ 
undeclared (first use in this function)

because the memberin typemaps for svn_string_t assume they are used in 
functions that also receive the pool argument. Trivial fix (ignoring the 
offending structure in bindings) is attached.

A better fix would probably be fix the memberin typemaps for svn_string_t, but 
I do not know the specifics of pool usage in SWIG to do that.


Regards,
Alexey.

Re: r1619122 (stsp) broke 'make swig-py'

Posted by Ben Reser <be...@reser.org>.
On 8/21/14 9:39 AM, Ben Reser wrote:
> I have the "correct" fix but in so much as it makes things compile.  But I
> don't know that it makes the svn_wc_conflict_description2_t setters do anything
> useful.  Writing a test now, so I should have it fixed shortly.

I think this is the right fix for the memberin typmap for svn_string_t but
wrapping the svn_wc_conflict_resolver_func2_t is more bother than I'm willing
to go to to find out if this is correct (I know it compiles, but don't know if
you can actually use the struct).  The patch should make it so it'll work with
the syntax of:
struct.string = foo
  and
struct.string_set(foo)
  and
struct.string_set(foo, pool)

[[[
Index: include/svn_string.swg
===================================================================
--- include/svn_string.swg      (revision 1619137)
+++ include/svn_string.swg      (working copy)
@@ -210,6 +210,16 @@
    svn_string_t structure on the heap. */
 #ifdef SWIGPYTHON
 %typemap(memberin) const svn_string_t * {
+    apr_pool_t *_global_pool = NULL;
+    PyObject *_global_py_pool = NULL;
+
+    if (_global_pool == NULL)
+    {
+      if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
+                                      &_global_py_pool, &_global_pool))
+        SWIG_fail;
+    }
+
     $1 = svn_string_dup($input, _global_pool);
 }
 #endif
]]]

So while posting the above to preserve for posterity.  I'm just going to remove
the memberin typemap for svn_string_t and apply Alexey's patch.


Re: r1619122 (stsp) broke 'make swig-py'

Posted by Ben Reser <be...@reser.org>.
On 8/21/14 1:29 AM, Alexey Neyman wrote:
> The new fields added in svn_wc.h cause the following errors:
> 
> subversion/bindings/swig/python/svn_wc.c: In function 
> ‘_wrap_svn_wc_conflict_description2_t_prop_value_base_set’:
> subversion/bindings/swig/python/svn_wc.c:8798: error: ‘_global_pool’ 
> undeclared (first use in this function)
> subversion/bindings/swig/python/svn_wc.c:8798: error: (Each undeclared 
> identifier is reported only once
> subversion/bindings/swig/python/svn_wc.c:8798: error: for each function it 
> appears in.)
> subversion/bindings/swig/python/svn_wc.c: In function 
> ‘_wrap_svn_wc_conflict_description2_t_prop_value_working_set’:
> subversion/bindings/swig/python/svn_wc.c:8859: error: ‘_global_pool’ 
> undeclared (first use in this function)
> subversion/bindings/swig/python/svn_wc.c: In function 
> ‘_wrap_svn_wc_conflict_description2_t_prop_value_incoming_old_set’:
> subversion/bindings/swig/python/svn_wc.c:8920: error: ‘_global_pool’ 
> undeclared (first use in this function)
> subversion/bindings/swig/python/svn_wc.c: In function 
> ‘_wrap_svn_wc_conflict_description2_t_prop_value_incoming_new_set’:
> subversion/bindings/swig/python/svn_wc.c:8981: error: ‘_global_pool’ 
> undeclared (first use in this function)
> 
> because the memberin typemaps for svn_string_t assume they are used in 
> functions that also receive the pool argument. Trivial fix (ignoring the 
> offending structure in bindings) is attached.
> 
> A better fix would probably be fix the memberin typemaps for svn_string_t, but 
> I do not know the specifics of pool usage in SWIG to do that.

I have the "correct" fix but in so much as it makes things compile.  But I
don't know that it makes the svn_wc_conflict_description2_t setters do anything
useful.  Writing a test now, so I should have it fixed shortly.