[PR PATCH] Try to extrapolate PYTHON_SO_ABI_FLAG from the SOABI Python config variable

Lukas Slebodnik lslebodn at redhat.com
Tue Nov 28 09:24:07 UTC 2017


On (28/11/17 01:23), Timur I. Bakeyev wrote:
>Hi, guys!
>
>We were trying to build Samba 4.7.* on FreeBSD with the Python3 bindings
>enabled, but it was failing OOTB
>due clash of the build targets for Python2 and Python3 module names.
>
>With the help of Andreas on IRC we figured out that the issue lays in the
>way how PYTHON_SO_ABI_FLAG
>is determined by the WAF. For Linux it seems to OK to use value of the "SO"
>Python configuration variable
>to determine the SO ABI extension. One can be derived from another. FreeBSD
>ports compile Python with
>different settings and "SO" value is merely ".so", so there is nothing you
>can derive from it. But, Python has
>a separate variable, "SOABI", which is defined for both OSes and contains
>the extension value in way usable
>directly. So,
>on Linux:
># python3 -c "import sysconfig; print(sysconfig.get_config_var('SO'))"
>.cpython-35m-x86_64-linux-gnu.so
># python3 -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"
>cpython-35m-x86_64-linux-gnu
>
>On FreeBSD:
># python3 -c "import sysconfig; print(sysconfig.get_config_var('SO'))"
>.so
># python3 -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"
>cpython-36m
>
>Of course the easiest way would be to add "SOABI" to the list of extracted
>configuration variables in the
>wafadmin/Tools/python.py, but as it's a third parity code for Samba we need
>to work around it and extract
>this value in buildtools/wafsamba/samba_python.py.
>
>Here is the patch that tries to solve this issue for FreeBSD, keeping
>compatibility with the original way
>of deriving PYTHON_SO_ABI_FLAG. For convenience ability to define this
>variable through the ENV
>is also added.
>
>Please review this patch and if possible add it or it's derivatives to your
>branch as well.
>

Have you tried patches from thread  [1] ?

I know I need to do some changes which Andrew requested.
But I was busy with other tasks at that time and then partially forgot
about them :-)

[1] https://lists.samba.org/archive/samba-technical/2017-September/123028.html

LS



More information about the samba-technical mailing list