(I sent this message 40 hours ago, however it is not derivered yet,
so I send again ....)
On 2019/10/23 6:36, Yasuhito FUTATSUKI wrote:
I ran check-swig-{py|pl|rb} with some SWIG versions on swig-py3 branch.

Environment:
   OS: FreeBSD 11.2
   Python 2: 2.7.16
   Python 3: 3.7.3
   Perl: 5.28.2
   Ruby: 2.5.5p157

Results are below.

<snip>

SWIG 3.0.9:
   Python 2  ... can't import modules
                 (regression, fixed in SWIG 3.0.10)[2]
   Python 3  ... can't import modules
                 (regression, fixed in SWIG 3.0.10)[2]
   Perl      ... PASS
   Ruby      ... 100% passed


With patch against Makefile.in below, which makes install time module
hierarchy in  build/test directory by using symbolic link in
copy-swig-py target, 'make check-swig-py' passed with SWIG 3.0.9,
both with Python 2 and with Python 3.

[[[
Index: Makefile.in
===================================================================
--- Makefile.in (revision 1868723)
+++ Makefile.in (working copy)
@@ -934,6 +934,7 @@
          @for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
            ! [ -f "$$f" ] || cp -pf $$f $(SWIG_PY_DIR)/libsvn; \
          done
+       @cd $(SWIG_PY_DIR)/libsvn;ln -sf ../.libs/*.so .
          @touch $(SWIG_PY_DIR)/libsvn/__init__.py
swig-py: autogen-swig-py copy-swig-py
]]]

(On Windows, as far as I read win_tests.py, it copies modules
for test with same hierarchy as install time, so it doesn't
affect, I guess.)

So I think swig Python bindings has no problem with SWIG 3.0.9.

Cheers,
--
Yasuhito FUTATSUKI <futat...@yf.bsdclub.org>

--
Yasuhito FUTATSUKI <futat...@poem.co.jp>
On branch swig-py3: Restrict SWIG version for Python bindings

* Makefile.in (copy-swig-py:):
  Make symbolic links to C extension modules in build/test directory
  (for SWIG 3.0.9 and SWIG 4.0 or later)

* build/ac-macros/swig.m4:
  Add SWIG version check for Python 2 and Python 3 to check its version
  is suitable for Python bindings, and to set up appropriate SWIG option. 

* subversion/bindings/swig/INSTALL
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX, Step1):
 Update suitable SWIG version information per language bindings.
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX, Step1): Fold long line.

Index: Makefile.in
===================================================================
--- Makefile.in (revision 1868723)
+++ Makefile.in (working copy)
@@ -934,6 +934,7 @@
        @for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
          ! [ -f "$$f" ] || cp -pf $$f $(SWIG_PY_DIR)/libsvn; \
        done
+       @cd $(SWIG_PY_DIR)/libsvn;ln -sf ../.libs/*.so .
        @touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
 swig-py: autogen-swig-py copy-swig-py
Index: build/ac-macros/swig.m4
===================================================================
--- build/ac-macros/swig.m4     (revision 1868723)
+++ build/ac-macros/swig.m4     (working copy)
@@ -158,13 +158,26 @@
           ])
 
           if test "$ac_cv_python_is_py3" = "yes"; then
-             SWIG_PY_OPTS="-python -py3"
+            if test "$SWIG_VERSION" -ge "300009" -a "$SWIG_VERSION" -lt 
"400000"; then
+              SWIG_PY_OPTS="-python -py3"
+              dnl SWIG Python bindings successfully configured, clear the 
error message dnl
+              SWIG_PY_ERRMSG=""
+            else
+              SWIG_PY_OPTS="-python -py3 -nofastunpack"
+              SWIG_PY_ERRMSG="SWIG version is not suitable"
+              AC_MSG_WARN([Subversion Python bindings for Python 3 requires 
3.0.9 <= SWIG < 4.0.0])
+            fi
           else
-             SWIG_PY_OPTS="-python -classic"
+            if test "$SWIG_VERSION" -lt "400000"; then
+              SWIG_PY_OPTS="-python -classic"
+              dnl SWIG Python bindings successfully configured, clear the 
error message dnl
+              SWIG_PY_ERRMSG=""
+            else
+              SWIG_PY_OPTS="-python -nofastunpack"
+              SWIG_PY_ERRMSG="SWIG version is not suitable"
+              AC_MSG_WARN([Subversion Python bindings for Python 2 requires 
1.3.24 <= SWIG < 4.0.0])
+            fi
           fi
-
-          dnl SWIG Python bindings successfully configured, clear the error 
message
-          SWIG_PY_ERRMSG=""
         fi
             
       fi
Index: subversion/bindings/swig/INSTALL
===================================================================
--- subversion/bindings/swig/INSTALL    (revision 1868723)
+++ subversion/bindings/swig/INSTALL    (working copy)
@@ -64,15 +64,23 @@
 BUILDING SWIG BINDINGS FOR SVN ON UNIX
 
 
-Step 1:  Install a suitable version of SWIG (which is
-         currently SWIG version 1.3.24 or later).
+Step 1:  Install a suitable version of SWIG
 
+    * Currently supported SWIG version is 1.3.24 and later, however,
+      - Python bindings for Python 2 doesn't support SWIG 4.0.0 and later.
+      - Python 3 support for Python bindings requires SWIG 3.0.9 and later,
+        but SWIG 4.0.0 and later doesn't support (yet). 
+      - Ruby bindings doesn't support SWIG 3.0.8.
+      - Make sure language specific supported version of SWIG itself, e.g.
+        - Perl 5.16 and later requires SWIG 2.0.8 and later. 
+
     * Perhaps your distribution packages a suitable version - if it does
       install it, and skip to the last bullet point in this section.
 
     * Go to http://www.swig.org/, download the source tarball, and unpack.
 
-    * In the SWIG-1.3.xx directory, run ./configure.
+    * In the swig-x.y.z, directory, run ./configure (where x.y.z is
+      SWIG version, e.g. 3.0.12).
 
         If you plan to build the Python bindings, and have a system
         with more than one version of Python installed, you may need
@@ -95,13 +103,13 @@
         Run 'make && make install'
 
     * To verify you have SWIG installed correctly, run "swig -version"
-      from the command line. SWIG should report that it is version 1.3.24
-      or newer.
+      from the command line. SWIG should report that it is suitable version
+      mentioned above.
 
 Step 1a: Install py3c library if building Python SWIG bindings.
 
-    * Check your distribution packages first for a suitable version, and if 
found
-      install from there.
+    * Check your distribution packages first for a suitable version, and
+      if found install from there.
 
     * To install from source, download the latest release from
       https://github.com/encukou/py3c.

Reply via email to