Author: svn-role Date: Wed Apr 8 04:00:41 2020 New Revision: 1876264 URL: http://svn.apache.org/viewvc?rev=1876264&view=rev Log: Merge the r1876016 group from trunk:
* r1876016, r1876050 Explain SWIG is needed for building Python 2 bindings. Justification: Target of Python bindings SWIG-generated source code in the distribution tarballs will switch to Python 3 in 1.14.0, however we still allow to build bindings for Python 2 Votes: +1: futatuki, hartmannathan, jamessan Modified: subversion/branches/1.14.x/ (props changed) subversion/branches/1.14.x/STATUS subversion/branches/1.14.x/subversion/bindings/swig/INSTALL Propchange: subversion/branches/1.14.x/ ------------------------------------------------------------------------------ Merged /subversion/trunk:r1876016,1876050 Modified: subversion/branches/1.14.x/STATUS URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/STATUS?rev=1876264&r1=1876263&r2=1876264&view=diff ============================================================================== --- subversion/branches/1.14.x/STATUS (original) +++ subversion/branches/1.14.x/STATUS Wed Apr 8 04:00:41 2020 @@ -21,15 +21,6 @@ Veto-blocked changes: Approved changes: ================= - * r1876016, r1876050 - Explain SWIG is needed for building Python 2 bindings. - Justification: - Target of Python bindings SWIG-generated source code in the distribution - tarballs will switch to Python 3 in 1.14.0, however we still allow to - build bindings for Python 2 - Votes: - +1: futatuki, hartmannathan, jamessan - * r1876020 Fix Proc.new warnings in Ruby bindings with Ruby >= 2.7 Justification: Modified: subversion/branches/1.14.x/subversion/bindings/swig/INSTALL URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/INSTALL?rev=1876264&r1=1876263&r2=1876264&view=diff ============================================================================== --- subversion/branches/1.14.x/subversion/bindings/swig/INSTALL (original) +++ subversion/branches/1.14.x/subversion/bindings/swig/INSTALL Wed Apr 8 04:00:41 2020 @@ -5,7 +5,12 @@ STATUS OF THE SWIG BINDINGS * Python The Python bindings are fairly well developed, although there are some - missing parts. + 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.) @@ -67,11 +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 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, or if - you want to regenerate the SWIG language bindings. + 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: @@ -128,7 +135,7 @@ Step 1a: Install py3c library if buildin * This is a header-only library, so no configuring or compiling is necessary, simply 'make install'. - + Step 2: Build and Install Subversion. @@ -141,7 +148,7 @@ Step 2: Build and Install Subversion. python executable you used to configure SWIG as above. If it does not then you can specify the correct path by adding PYTHON=/path/to/python or PERL=/path/to/perl onto the command line for configure. For example: - ./configure PYTHON=/usr/bin/python2.7 PERL=/usr/bin/perl5.8.0 + ./configure PYTHON=/usr/bin/python3.7 PERL=/usr/bin/perl5.28.2 If Subversion's ./configure finds a SWIG that it's happy with, then it will build special glue libraries to link svn to the swig bindings: @@ -153,17 +160,24 @@ Step 3: Install Specific Language Bindi * Python - 1. Run 'make swig-py' from the top of the Subversion build tree, + 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. (This will invoke SWIG on the *.i files, resulting in a collection of .c source files. It will then compile and link those .c files into Python libraries.) - 2. Run 'make check-swig-py' from the top of the Subversion build - tree, to test the bindings + 3. Run 'make check-swig-py' from the top of the Subversion build + tree, to test the bindings - 3. Run 'make install-swig-py' (as root, typically) + 4. Run 'make install-swig-py' (as root, typically) from the top of the Subversion build tree. This will copy your new Python libraries into the appropriate system location. @@ -177,14 +191,14 @@ Step 3: Install Specific Language Bindi example of doing this for building rpms looks like 'make install-swig-py DESTDIR=$RPM_BUILD_ROOT/usr'. - 4. Make sure that whatever directory the bindings got installed in + 5. Make sure that whatever directory the bindings got installed in is in your Python search path. That directory depends on how you installed; a typical location is /usr/local/lib/svn-python/. There are several ways to do this. See Python's documentation for 'sys.path' and 'PYTHONPATH'. A nice way to do this is: $ echo /usr/local/lib/svn-python \ - > /usr/lib/python2.x/site-packages/subversion.pth + > /usr/lib/python3.x/site-packages/subversion.pth You may also need to update your operating system's dynamic linker configuration to enable Python to load these new libraries. On some @@ -202,7 +216,7 @@ Step 3: Install Specific Language Bindi 1. Run `make swig-pl' from the top of the Subversion build tree. 2. Run `make check-swig-pl' from the top of the Subversion build - tree, to test the bindings + tree, to test the bindings 3. to install run `make install-swig-pl' from the top of the Subversion build tree. @@ -214,9 +228,9 @@ Step 3: Install Specific Language Bindi 2. Run `make install-swig-pl-lib' - 3. cd subversion/bindings/swig/perl/native + 3. cd subversion/bindings/swig/perl/native - 4. Run `perl Makefile.PL EXTRAOPTIONSHERE` + 4. Run `perl Makefile.PL EXTRAOPTIONSHERE` 5. Run `make install' @@ -226,21 +240,21 @@ Step 3: Install Specific Language Bindi * Ruby - + 1. Run `make swig-rb' from the top of the Subversion build tree, to build the bindings. 2. Run `make check-swig-rb' from the top of the Subversion build tree, to test the bindings. - 3. To install, run `make install-swig-rb' from the top of the + 3. To install, run `make install-swig-rb' from the top of the Subversion build tree. - You can specify the ruby binary by passing RUBY=/path/to/ruby as part - of the configure command in the top level of the Subversion source - tree. Make sure that the Ruby version used is the same one that you - configured SWIG to run against during the SWIG configure (see above). - + You can specify the ruby binary by passing RUBY=/path/to/ruby as part + of the configure command in the top level of the Subversion source + tree. Make sure that the Ruby version used is the same one that you + configured SWIG to run against during the SWIG configure (see above). + BUILDING SWIG BINDINGS FOR SVN ON WINDOWS @@ -260,7 +274,7 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW If you plan to build python bindings, you will also need to download and extract the py3c library from https://github.com/encukou/py3c/releases. - + NOTE: Our Python SWIG bindings will currently NOT compile in Debug mode unless you have python24_d.lib (which binary distributions of Python do not contain). Therefore, the Python bindings will only @@ -276,9 +290,9 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW Example: > gen-make.py <other options> --with-swig="C:\Program Files\SWIG-2.0.2" - + If you are building python bindings, point to the py3c directory as well: - + > gen-make.py <other options> --with-swig="C:\Program Files\SWIG-2.0.2" \ --with-py3c="C:\SVN\py3c" @@ -364,12 +378,12 @@ TESTING SWIG BINDINGS * Perl The Perl bindings are using the standard module testing facilities - to do regression tests. Simply run 'make check-swig-pl' as described in + to do regression tests. Simply run 'make check-swig-pl' as described in the install section. * Ruby - To test the Ruby bindings, simply run `make check-swig-rb' as described + To test the Ruby bindings, simply run `make check-swig-rb' as described in the install section.