You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2020/03/26 23:24:54 UTC

svn commit: r1875742 - /subversion/trunk/build/generator/gen_make.py

Author: stsp
Date: Thu Mar 26 23:24:54 2020
New Revision: 1875742

URL: http://svn.apache.org/viewvc?rev=1875742&view=rev
Log:
Fix autogen.sh SWIG python bindings generation in --release mode.

This was accidentally broken in r1869354 (merge swig-py3 branch to trunk).

* build/generator/gen_make.py: When generating autogen-standlone.mk, set
  SWIG_PY_OPTS to "-python". Otherwise swig gets invoked without any
  language options and SWIGPYTHON ends up being undefined. Swig is then
  unable to parse subversion/bindings/swig/include/svn_containers.swg
  because that file relies on the macro definition "hash_argout_typemap"
  which only takes effect if SWIGPYTHON is defined by swig.

Modified:
    subversion/trunk/build/generator/gen_make.py

Modified: subversion/trunk/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_make.py?rev=1875742&r1=1875741&r2=1875742&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_make.py (original)
+++ subversion/trunk/build/generator/gen_make.py Thu Mar 26 23:24:54 2020
@@ -511,6 +511,7 @@ class Generator(gen_base.GeneratorBase):
     standalone.write('top_srcdir = .\n')
     standalone.write('top_builddir = .\n')
     standalone.write('SWIG = swig\n')
+    standalone.write('SWIG_PY_OPTS = -python\n')
     standalone.write('PYTHON = ' + sys.executable + '\n')
     standalone.write('\n')
     standalone.write(open("build-outputs.mk","r").read())



Re: SWIG_PY_OPTS question (Re: svn commit: r1875742 - /subversion/trunk/build/generator/gen_make.py)

Posted by Stefan Sperling <st...@apache.org>.
On Fri, Mar 27, 2020 at 11:55:16AM +0900, Yasuhito FUTATSUKI wrote:
> On 2020/03/27 8:55, Stefan Sperling wrote:
> > Can anyone tell whether we need to pass additional options to
> > swig via SWIG_PY_OPTS at this stage? Do we need -py3 for example?
> 
> If we use 3.0.10 <= SWIG < 4.0.0 in release process and want to
> generate code for Python 3:
> 
>   SWIG_PY_OPTS="-python -py3 -nofastunpack -modern"
> 
> If we use SWIG >= 4.0.0 and want to generate code for Python 3:
>   
>   SWIG_PY_OPTS="-python -py3 -nofastunpack"
> 
> If we want to generate code for Python 2, use 1.3.24 <= SWIG < 4.0.0 and
> 
>   SWIG_PY_OPTS="-python -classic"

Our release tooling currently uses swig 3.0.12.
This version is set in the file tools/dist/release-lines.yml.

> We can't bundle code for Python 3 and Python 2 at the same time.

Then we should obviously go for Python 3.

I have switched to "-python -py3 -nofastunpack -modern" in r1875762.
Thank you for your advice :)

Re: SWIG_PY_OPTS question (Re: svn commit: r1875742 - /subversion/trunk/build/generator/gen_make.py)

Posted by Yasuhito FUTATSUKI <fu...@poem.co.jp>.
On 2020/03/27 8:55, Stefan Sperling wrote:
> Can anyone tell whether we need to pass additional options to
> swig via SWIG_PY_OPTS at this stage? Do we need -py3 for example?

If we use 3.0.10 <= SWIG < 4.0.0 in release process and want to
generate code for Python 3:

  SWIG_PY_OPTS="-python -py3 -nofastunpack -modern"

If we use SWIG >= 4.0.0 and want to generate code for Python 3:
  
  SWIG_PY_OPTS="-python -py3 -nofastunpack"

If we want to generate code for Python 2, use 1.3.24 <= SWIG < 4.0.0 and

  SWIG_PY_OPTS="-python -classic"

We can't bundle code for Python 3 and Python 2 at the same time.

Cheers,
-- 
Yasuhito FUTATSUKI <fu...@yf.bsdclub.org> / <fu...@poem.co.jp>

SWIG_PY_OPTS question (Re: svn commit: r1875742 - /subversion/trunk/build/generator/gen_make.py)

Posted by Stefan Sperling <st...@apache.org>.
Can anyone tell whether we need to pass additional options to
swig via SWIG_PY_OPTS at this stage? Do we need -py3 for example?

On Thu, Mar 26, 2020 at 11:24:54PM -0000, stsp@apache.org wrote:
> Author: stsp
> Date: Thu Mar 26 23:24:54 2020
> New Revision: 1875742
> 
> URL: http://svn.apache.org/viewvc?rev=1875742&view=rev
> Log:
> Fix autogen.sh SWIG python bindings generation in --release mode.
> 
> This was accidentally broken in r1869354 (merge swig-py3 branch to trunk).
> 
> * build/generator/gen_make.py: When generating autogen-standlone.mk, set
>   SWIG_PY_OPTS to "-python". Otherwise swig gets invoked without any
>   language options and SWIGPYTHON ends up being undefined. Swig is then
>   unable to parse subversion/bindings/swig/include/svn_containers.swg
>   because that file relies on the macro definition "hash_argout_typemap"
>   which only takes effect if SWIGPYTHON is defined by swig.
> 
> Modified:
>     subversion/trunk/build/generator/gen_make.py
> 
> Modified: subversion/trunk/build/generator/gen_make.py
> URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_make.py?rev=1875742&r1=1875741&r2=1875742&view=diff
> ==============================================================================
> --- subversion/trunk/build/generator/gen_make.py (original)
> +++ subversion/trunk/build/generator/gen_make.py Thu Mar 26 23:24:54 2020
> @@ -511,6 +511,7 @@ class Generator(gen_base.GeneratorBase):
>      standalone.write('top_srcdir = .\n')
>      standalone.write('top_builddir = .\n')
>      standalone.write('SWIG = swig\n')
> +    standalone.write('SWIG_PY_OPTS = -python\n')
>      standalone.write('PYTHON = ' + sys.executable + '\n')
>      standalone.write('\n')
>      standalone.write(open("build-outputs.mk","r").read())
> 
> 
>