Good morning futatuki@,

futat...@apache.org wrote on Wed, 01 Apr 2020 21:07 -0000:
> Explain SWIG is needed for building Python 2 bindings.
> 
> Since Subversion distibution 1.14.0 and later will ship with SWIG Python
> bindings *.c source code for Python 3, clarify *.c source files for Python 2
> and Python 3 are different and incompatible, and describe how to clear
> incompatible intermediate files.
> 
> * subversion/bindings/swig/INSTALL
>  (STATUS OF THE SWIG BINDINGS):
>   Add explanation about supported Python version and distribution tarball.
>  (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 1):
>   Add new case that SWIG is needed for Python 2 bindings.
>  (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 2):
>   Update Python and perl version in commadline example. 
>  (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 3):
>   Insert optional step to clear intermediate files previously generated.
>  (everywhere) Strip trailing white space in the end of line.

Thanks for this.  May I propose a few tweaks?  Patch attached, as well
as its wdiff for review purposes.  The changes are mainly:

- Use passive voice

- Rearrange information to put the common case first and rarer cases
  nearer the end

Let me know if I missed anything.

Furthermore, since this documentation is for 1.14.0, I assume it should
be backported to branches/1.14.x?  If that is the case, feel free to go
ahead and add it to branches/1.14.x/STATUS.  (You can automate editing
and committing the STATUS file by running «tools/dist/nominate.pl
r1876016 "hello world"» in a working copy of branches/1.14.x.)

Apologies in advance but I'll not be online much in the next few days,
so I may be slow to respond.

Cheers,

Daniel
Index: subversion/bindings/swig/INSTALL
===================================================================
--- subversion/bindings/swig/INSTALL	(revision 1876016)
+++ subversion/bindings/swig/INSTALL	(working copy)
@@ -5,12 +5,12 @@ STATUS OF THE SWIG BINDINGS
 * Python
 
   The Python bindings are fairly well developed, although there are some
-  missing parts. We support both of Python 2.7 and Python 3.x, but you
-  can't install SWIG Python bindings for multiple version of Python
-  in the same environment, because they need to install mutually
-  incompatible C shared library in same name.  We are now shipping
-  distribution tarball with C source files for Python 3 bindings
-  generated by SWIG.
+  missing parts. We support both of Python 2.7 and Python 3.x; however,
+  SWIG Python bindings for different versions of Python cannot be
+  simultaneously installed in the same environment, because they need to
+  install mutually incompatible C shared libraries under the same name.  The
+  distribution tarballs are shipped with SWIG-generated C source files for
+  Python 3.x.
 
   (N.B. As discussed below, they will not compile in Debug mode on Windows.)
 
@@ -72,13 +72,13 @@ BUILDING SWIG BINDINGS FOR SVN ON UNIX
 Step 1: [Optional] Install a suitable version of SWIG
 
     * SWIG installation is optional.  You do not need to install SWIG
-      if you are using a Subversion distribution tarball except Python
-      bindings for Python 2 because it already contains the source files
-      generated by SWIG.  The Python bindings source file in the distribution
-      tarball is only for Python 3.  You will need a suitable version of
-      SWIG if you are using a working copy of Subversion's sources checked
-      out from the repository, or if you want to generate the SWIG
-      language bindings C source files by yourself.
+      if you are using a Subversion distribution tarball because it already
+      contains the source files generated by SWIG.  You will need a suitable
+      version of SWIG if you are using a working copy of Subversion's sources
+      checked out from the repository; if you want to generate the SWIG
+      language bindings C source files by yourself; or if you want to build
+      Python 2.x bindings (since the SWIG-generated C source files in the
+      distribution tarballs target Python 3.x).
 
     * We currently support SWIG versions 2.0.0 and later, with the
       following notes:
@@ -160,12 +160,12 @@ Step 3:  Install Specific Language Bindings
 
 *  Python
 
-   1.  (Optional) If you want to build Python bindings for other version of
-       Python than target of previously built bindings C sources (e.g.
-       using Subversion distribution tarball but want to build Python 2
-       bindings), run 'make clean-swig-py' from the top of the Subversion
-       build tree, to ensure not to use incompatible version of bindings
-       source files.
+   1.  (Optional) If you want to build Python bindings for a version of
+       Python than other than that the prebuilt bindings C sources target
+       (e.g., if you use the Subversion distribution tarball but want to build
+       Python 2 bindings), run 'make clean-swig-py' from the top of the
+       Subversion build tree, to ensure not to use incompatible version of
+       bindings source files.
 
    2.  Run 'make swig-py' from the top of the Subversion build tree,
        to build the bindings.

Attachment: swig-py-docs.wdiff
Description: Binary data

Reply via email to