Package: src:xapian-bindings
Version: 1.4.31-2
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the python version
3.15rc1 we found that xapian-bindings fails to build from source [1].

Here python 3.15 detects an error in the way the mutex lock is handled
in a swig generated file (python3/xapian_wrap.cc), the bug itself is a
bug in swig, fixed in swig 4.4.0, but this file was generated with swig
4.3.0.

I'm attaching a patch that just updates the xapian_wrap.cc files, but it
would be better to regenerate these files.

Please consider adding this or a similar patch in future uploads, also,
these files aren't the preferred form of modification, so they aren't
really source, it might be worth producing them either as part of the
packaging and including them as patches or as part of the build
procedure.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/work-request/995348/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Fix inverted calls to PyThread_free_lock and PyThread_release_lock in Swig::Mutex
 This is an upstream bug in SWIG (introduced in SWIG 21f1c923c, fixed in SWIG 4.4.0
 via commit 892be2b802.
Origin: upstream, https://github.com/swig/swig/commit/892be2b8024d391dbc78028a2e99b7800db2ea99
Forwarded: not-needed
Index: xapian-bindings-1.4.31/python/xapian_wrap.cc
===================================================================
--- xapian-bindings-1.4.31.orig/python/xapian_wrap.cc
+++ xapian-bindings-1.4.31/python/xapian_wrap.cc
@@ -3597,7 +3597,7 @@ namespace Swig {
        }
 
        ~Mutex() {
-           PyThread_release_lock(mutex_);
+           PyThread_free_lock(mutex_);
        }
 
    private:
@@ -3606,7 +3606,7 @@ namespace Swig {
        }
 
        void Unlock() {
-           PyThread_free_lock(mutex_);
+           PyThread_release_lock(mutex_);
        }
 
        PyThread_type_lock mutex_;
Index: xapian-bindings-1.4.31/python3/xapian_wrap.cc
===================================================================
--- xapian-bindings-1.4.31.orig/python3/xapian_wrap.cc
+++ xapian-bindings-1.4.31/python3/xapian_wrap.cc
@@ -3612,7 +3612,7 @@ namespace Swig {
        }
 
        ~Mutex() {
-           PyThread_release_lock(mutex_);
+           PyThread_free_lock(mutex_);
        }
 
    private:
@@ -3621,7 +3621,7 @@ namespace Swig {
        }
 
        void Unlock() {
-           PyThread_free_lock(mutex_);
+           PyThread_release_lock(mutex_);
        }
 
        PyThread_type_lock mutex_;

Reply via email to