Fixes to allow Boost to build with Python 3#3293
Conversation
| patch('boost_11856.patch', when='@1.60.0%[email protected]') | ||
|
|
||
| # Patch fix from https://svn.boost.org/trac/boost/ticket/11120 | ||
| patch('python_jam.patch') |
There was a problem hiding this comment.
Ideally I would have specified an exact version range for which this patch works. However, either the Boost tarball is very large or my internet connection is slow today, so it took too long to download every version.
| } | ||
| } | ||
| + # Try to get python abiflags | ||
| + full-cmd = $(python-cmd)" -c \"from sys import abiflags; print(abiflags, end='')\"" ; |
There was a problem hiding this comment.
I don't know if this print syntax will work in Python 2.
There was a problem hiding this comment.
It won't work. But the following will:
full-cmd = $(python-cmd)" -c \"from __future__ import print_function; from sys import abiflags; print(abiflags, end='')\"" ;
There was a problem hiding this comment.
Confirmed that the patch doesn't work for Python 2. I decided it would be easier/safer to only apply the patch when we are building with Python 3. Now both the Python 2 and 3 builds of Boost work for me!
There was a problem hiding this comment.
Thanks for checking that python2 build still works.
| if '+python' in spec: | ||
| options.append('--with-python=%s' % | ||
| join_path(spec['python'].prefix.bin, 'python')) | ||
| options.append('--with-python=%s' % python_exe) |
There was a problem hiding this comment.
The executable in Python 3 is python3, not python. Better to let the python package handle this.
There was a problem hiding this comment.
This would be like the way MPI packages export stuff?
There was a problem hiding this comment.
Exactly. I need to use the same functionality in #3210 too, so it's a common need.
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
Fixes #3274.
Needs to be tested with Python 2.Tested with:
Both builds succeed now!