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

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
There is a new pull request by b-a-t against master on the Samba Samba Github repository

https://github.com/b-a-t/samba python3-freebsd
https://github.com/samba-team/samba/pull/110

Try to extrapolate PYTHON_SO_ABI_FLAG  from the SOABI Python config variable
Python3 configuration handling (ab)uses "SO" configuration variable to
extract SO ABI extension. It happens to work on Linux as this variable
contains not only binary module extension, but also ABI part, like in
.cpython-34m.so or in .cpython-35m-x86_64-linux-gnu.so. In FreeBSD this
variable contains only .so. The SO ABI extension in fact, is stored in
the "SOABI" variable and should be taken from there directly, without
relying on the content of SO variable. For Linux it contains
"cpython-34m" and "cpython-35m-x86_64-linux-gnu" respectivelly, for
FreeBSD it is "cpython-36m".

We are trying to set PYTHON_SO_ABI_FLAG based on the value of SOABI and
only if it's not available - fall back to the old method of guessing it
from the SO configuration variable.

A patch file from https://github.com/samba-team/samba/pull/110.patch is attached

github-pr-python3-freebsd-110.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
There is an updated pull request by b-a-t against master on the Samba Samba Github repository

https://github.com/b-a-t/samba python3-freebsd
https://github.com/samba-team/samba/pull/110

Try to extrapolate PYTHON_SO_ABI_FLAG  from the SOABI Python config variable
Python3 configuration handling (ab)uses "SO" configuration variable to
extract SO ABI extension. It happens to work on Linux as this variable
contains not only binary module extension, but also ABI part, like in
.cpython-34m.so or in .cpython-35m-x86_64-linux-gnu.so. In FreeBSD this
variable contains only .so. The SO ABI extension in fact, is stored in
the "SOABI" variable and should be taken from there directly, without
relying on the content of SO variable. For Linux it contains
"cpython-34m" and "cpython-35m-x86_64-linux-gnu" respectivelly, for
FreeBSD it is "cpython-36m".

We are trying to set PYTHON_SO_ABI_FLAG based on the value of SOABI and
only if it's not available - fall back to the old method of guessing it
from the SO configuration variable.

A patch file from https://github.com/samba-team/samba/pull/110.patch is attached

github-pr-python3-freebsd-110.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Try to extrapolate PYTHON_SO_ABI_FLAG from the SOABI Python config variable

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
New comment by abartlet on Samba Github repository

https://github.com/samba-team/samba/pull/110#issuecomment-347072741
Comment:
Can you work with the Red Hat folks doing the python3 stuff who also want to change stuff there?  
Reply | Threaded
Open this post in threaded view
|

Re: Try to extrapolate PYTHON_SO_ABI_FLAG from the SOABI Python config variable

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
New comment by b-a-t on Samba Github repository

https://github.com/samba-team/samba/pull/110#issuecomment-347078111
Comment:
Sure, if you can point me to the involved persons, whom to approach.

Reply | Threaded
Open this post in threaded view
|

Re: Try to extrapolate PYTHON_SO_ABI_FLAG from the SOABI Python config variable

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
New comment by abartlet on Samba Github repository

https://github.com/samba-team/samba/pull/110#issuecomment-347345098
Comment:
Petr Viktorin <[hidden email]>, Lukas Slebodnik <[hidden email]>, Lumir Balhar <[hidden email]> and Andreas Schneider <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
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.

With best regards,
Timur Bakeyev
iXsystems Inc.


On Mon, Nov 27, 2017 at 4:34 AM, Github bot account via samba-technical <
[hidden email]> wrote:

> There is a new pull request by b-a-t against master on the Samba Samba
> Github repository
>
> https://github.com/b-a-t/samba python3-freebsd
> https://github.com/samba-team/samba/pull/110
>
> Try to extrapolate PYTHON_SO_ABI_FLAG  from the SOABI Python config
> variable
> Python3 configuration handling (ab)uses "SO" configuration variable to
> extract SO ABI extension. It happens to work on Linux as this variable
> contains not only binary module extension, but also ABI part, like in
> .cpython-34m.so or in .cpython-35m-x86_64-linux-gnu.so. In FreeBSD this
> variable contains only .so. The SO ABI extension in fact, is stored in
> the "SOABI" variable and should be taken from there directly, without
> relying on the content of SO variable. For Linux it contains
> "cpython-34m" and "cpython-35m-x86_64-linux-gnu" respectively, for
> FreeBSD it is "cpython-36m".
>
> We are trying to set PYTHON_SO_ABI_FLAG based on the value of SOABI and
> only if it's not available - fall back to the old method of guessing it
> from the SO configuration variable.
>
> A patch file from https://github.com/samba-team/samba/pull/110.patch is
> attached

110.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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