Bug#1023529: subversion: FTBFS: segfault in Python tests with SWIG 4.1.0

2022-11-08 Thread Manuel A. Fernandez Montecelo
Package: subversion
Followup-For: Bug #1023529
X-Debbugs-Cc: m...@debian.org, 1023529-submit...@bugs.debian.org

Hi,

I built a version of the package with the mentioned patch (debdiff attached), it
built correctly and passed all tests.

This was in riscv64, where the problem was detected, but I expect that it would
apply to all arches.

Hope that helps.

--
Manuel A. Fernandez Montecelo 
diff -Nru subversion-1.14.2/debian/changelog subversion-1.14.2/debian/changelog
--- subversion-1.14.2/debian/changelog  2022-07-12 16:03:54.0 +0200
+++ subversion-1.14.2/debian/changelog  2022-11-08 10:57:37.0 +0100
@@ -1,3 +1,10 @@
+subversion (1.14.2-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Patch to fix "FTBFS: segfault in Python tests with SWIG 4.1.0" (Closes: 
#1023529)
+
+ -- Manuel A. Fernandez Montecelo   Tue, 08 Nov 2022 09:57:37 
+
+
 subversion (1.14.2-3) unstable; urgency=medium
 
   * Re-enable the ability to store plaintext passwords (Closes: #995692)
diff -Nru 
subversion-1.14.2/debian/patches/8ff4cfd06ce554e9df31a088c9d09f45278c6de4.patch 
subversion-1.14.2/debian/patches/8ff4cfd06ce554e9df31a088c9d09f45278c6de4.patch
--- 
subversion-1.14.2/debian/patches/8ff4cfd06ce554e9df31a088c9d09f45278c6de4.patch 
1970-01-01 01:00:00.0 +0100
+++ 
subversion-1.14.2/debian/patches/8ff4cfd06ce554e9df31a088c9d09f45278c6de4.patch 
2022-11-08 10:57:37.0 +0100
@@ -0,0 +1,61 @@
+From 8ff4cfd06ce554e9df31a088c9d09f45278c6de4 Mon Sep 17 00:00:00 2001
+From: Yasuhito Futatsuki 
+Date: Tue, 20 Sep 2022 12:57:06 +
+Subject: [PATCH] swig-py: Fix conditionals by SWIG version and by Python
+ version for proxy code.
+
+We are using different code for proxy object, by Python version and by SWIG
+version.  The distinguish between Python 2 and Python 3 was done by SWIG
+macro "SWIGPYTHON_PY3".  However, the macro was dropped since SWIG commit
+a343b7e[1], between SWIG 4.0.2 release and upcoming SWIG 4.1.0 release.
+
+As we already dropped support for the combination of SWIG >= 4.0 and Python 2,
+we should detect Python 2 only in SWIG < 4.0 case. So we can rely on the macro
+only in the case.
+
+* subversion/bindings/swig/include/proxy.swg ():
+  Reorder the conditionals distinguish SWIG versions and Python versions,
+  as described above.
+
+Found by: Jitka Plesnikova (jplesnik {_AT_} redhat.com)
+
+Suggested by: Julien Schueller (schueller {_AT_} phimeca.com) [2]
+
+[1] 
https://github.com/swig/swig/commit/a343b7e254567a64761bc1be7dc55b7b7424ec52
+[2] https://github.com/swig/swig/issues/2373#issuecomment-1250997124
+
+
+git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1904167 
13f79535-47bb-0310-9956-ffa450edef68
+---
+ subversion/bindings/swig/include/proxy.swg | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+Index: subversion-1.14.2/subversion/bindings/swig/include/proxy.swg
+===
+--- subversion-1.14.2.orig/subversion/bindings/swig/include/proxy.swg
 subversion-1.14.2/subversion/bindings/swig/include/proxy.swg
+@@ -66,7 +66,6 @@
+ fn()
+ 
+ %}
+-#if defined(SWIGPYTHON_PY3)
+ #if SWIG_VERSION >= 0x04
+ %pythoncode %{
+   # -classic and -modern options have been dropped and this variable
+@@ -76,7 +75,7 @@
+   _set_instance_attr = 
_swig_setattr_nondynamic_instance_variable(object.__setattr__)
+ 
+ %}
+-#else
++#elif defined(SWIGPYTHON_PY3)
+ %pythoncode %{
+   # SWIG classes generated with -modern do not define this variable
+   try:
+@@ -90,7 +89,6 @@
+   _set_instance_attr = _swig_setattr_nondynamic_method(object.__setattr__)
+ 
+ %}
+-#endif
+ #else
+ %pythoncode %{
+   # SWIG classes generated with -classic do not define this variable,
diff -Nru subversion-1.14.2/debian/patches/series 
subversion-1.14.2/debian/patches/series
--- subversion-1.14.2/debian/patches/series 2022-07-12 16:03:54.0 
+0200
+++ subversion-1.14.2/debian/patches/series 2022-11-08 10:57:37.0 
+0100
@@ -10,3 +10,4 @@
 examples-compile-instructions
 workaround_EINVAL_on_kfreebsd
 use-python3-as-the-interpreter-now-for-tests-not-python.patch
+8ff4cfd06ce554e9df31a088c9d09f45278c6de4.patch


Bug#1023529: subversion: FTBFS: segfault in Python tests with SWIG 4.1.0

2022-11-05 Thread Paul Wise
Source: subversion
Version: 1.14.2-3
Severity: serious
Tags: ftbfs patch fixed-upstream
Forwarded: https://github.com/swig/swig/issues/2373 
https://github.com/apache/subversion/commit/8ff4cfd06ce554e9df31a088c9d09f45278c6de4
 https://svn.apache.org/repos/asf/subversion/trunk@1904167

subversion FTBFS in sid (on all arches, but detected below on amd64 and
by the buildds on riscv64) due to a segfault in the Python tests when
building with SWIG 4.1.0. The issue has been fixed upstream in the
subversion git/svn repos, see the URLs above.

   pabs@barriere:~$ dd-schroot-cmd -y -c $sessionid apt-get build-dep subversion
   ...
   Get:286 https://deb.debian.org/debian sid/main amd64 swig4.0 amd64 4.1.0-0.1 
[1387 kB]
   Get:287 https://deb.debian.org/debian sid/main amd64 swig all 4.1.0-0.1 [321 
kB]
   ...
   Selecting previously unselected package swig4.0.
   Preparing to unpack .../285-swig4.0_4.1.0-0.1_amd64.deb ...
   Unpacking swig4.0 (4.1.0-0.1) ...
   Selecting previously unselected package swig.
   Preparing to unpack .../286-swig_4.1.0-0.1_all.deb ...
   Unpacking swig (4.1.0-0.1) ...
   ...
   Setting up swig4.0 (4.1.0-0.1) ...
   ...
   Setting up swig (4.1.0-0.1) ...
   ...
   pabs@barriere:~$ schroot -r -c $sessionid
   (sid_amd64-dchroot)pabs@barriere:~$ apt source subversion
   ...
   (sid_amd64-dchroot)pabs@barriere:~$ cd subversion-*/
   (sid_amd64-dchroot)pabs@barriere:~/subversion-1.14.2$ debuild -J10
   ...
   finished...
   make[2]: Leaving directory '/home/pabs/subversion-1.14.2/BUILD'
   make[1]: Leaving directory '/home/pabs/subversion-1.14.2'
  debian/rules override_dh_auto_test-arch
   make[1]: Entering directory '/home/pabs/subversion-1.14.2'
   /usr/bin/make -f debian/rules check-swig-py check-swig-pl check-swig-rb 
check-javahl check
   make[2]: Entering directory '/home/pabs/subversion-1.14.2'
   make[2]: warning: -j10 forced in makefile: resetting jobserver mode.
   set -e; for v in 3.10; do rm -f 
/home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python; ln -sfT 
python$v /home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python; 
pyinc=$(python$v-config --includes); pylib=$(python$v -c 'from distutils import 
sysconfig; print(sysconfig.get_python_lib())');  /usr/bin/make -C 
/home/pabs/subversion-1.14.2/BUILD LTFLAGS="--tag=CC --verbose" 
LTCXXFLAGS="--tag=CXX --verbose" check-swig-py PYTHON=python$v PYVER=$v 
CLEANUP=1 LC_ALL=C; ln -sfT python3.10 
/home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python; done
   :1: DeprecationWarning: The distutils package is deprecated and 
slated for removal in Python 3.12. Use setuptools or check PEP 632 for 
potential alternatives
   :1: DeprecationWarning: The distutils.sysconfig module is 
deprecated, use sysconfig instead
   make[3]: Entering directory '/home/pabs/subversion-1.14.2'
   make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.
   mkdir 
/home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python/libsvn
   if [ "LD_LIBRARY_PATH" = "DYLD_LIBRARY_PATH" ]; then for d in 
/home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python/libsvn_swig_py
 
/home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python/../../../libsvn_*;
 do if [ -n "$DYLD_LIBRARY_PATH" ]; then 
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$d/.libs"; else LD_LIBRARY_PATH="$d/.libs"; 
fi; done; export LD_LIBRARY_PATH; fi; \
   cd /home/pabs/subversion-1.14.2/BUILD/subversion/bindings/swig/python; \
 python3.10 
/home/pabs/subversion-1.14.2/BUILD/../subversion/bindings/swig/python/tests/run_all.py
   make[3]: *** [Makefile:944: check-swig-py] Segmentation fault
   make[3]: Leaving directory '/home/pabs/subversion-1.14.2/BUILD'
   make[2]: *** [debian/rules:252: check-swig-py] Error 2
   make[2]: Leaving directory '/home/pabs/subversion-1.14.2'
   make[1]: *** [debian/rules:232: override_dh_auto_test-arch] Error 2
   make[1]: Leaving directory '/home/pabs/subversion-1.14.2'
   make: *** [debian/rules:197: binary] Error 2
   dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
status 2
   debuild: fatal error at line 1182:
   dpkg-buildpackage -us -uc -ui -J10 failed

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part