Re: Building python extensions with meson

2022-12-17 Thread Cyril Brulebois
Ciao,

Enrico Zini  (2022-12-17):
> The package builds fine on bullseye and bookworm, but fails to build
> on sid. On sid, meson tries to install the Python extension under
> /usr/local instead of /usr.
> 
> I do not understand what has changed, nor how to fix it.
[…]
> Did something break between bookworm and sid, in the interaction
> between meson and Python?

As far as I know, get_path()'s implemented in meson's python.py module
(not the python3.py one), and the code path is the same there (no if
branch taken, value returned via the last return statement); also, both
have the same install_env (prefix).

The main difference is that in testing:

rel_path: lib/python3/dist-packages

while in unstable:

rel_path: local/lib/python3.10/dist-packages

This comes from setuptools 65.5.0-1.1 (NMUer cc'd):

   * Install distutils-precedence.pth, to avoid packages need to hack import
 order in setup.py. Closes: #1025216

which is consistent with the aforementioned rel_path's being derived
from a specific item in a list:
  
https://sources.debian.org/src/meson/0.64.1-1.1/mesonbuild/modules/python.py/#L452-L453

No idea how to best fix or work around this though. Good luck.


Cheers,
-- 
Cyril Brulebois (k...@debian.org)
D-I release manager -- Release team member -- Freelance Consultant


signature.asc
Description: PGP signature


Building python extensions with meson

2022-12-17 Thread Enrico Zini
Hello,

I maintain wreport[1], which is a simple C++ library with Python
bindings.

The package builds fine on bullseye and bookworm, but fails to build on
sid. On sid, meson tries to install the Python extension under
/usr/local instead of /usr.

I do not understand what has changed, nor how to fix it. I looked on
sources.debian.net[3] for other packages containing 
`python.get_install_dir(pure : false)
but I only found pycairo and pygobject, which however can also use
setup.py to build.

Or xraylib. xraylib doesn't build the python bindings in Debian, but if
I try to make it do that, as I'm supposed to, I get in the same
situation as wreport.

Did something break between bookworm and sid, in the interaction between
meson and Python?

Adding --buildsystem=pybuild to wreport's debian/rules didn't help, and
indeed, at least according to grep, pybuild doesn't seem to know about
meson.

This[3] meson issue has a lot of discussion, but I can't tell how much
of it is relevant.

Can anyone help me understand what is going on?


[1] https://tracker.debian.org/pkg/wreport
[2] https://codesearch.debian.net/search?q=python.get_install_dir
[3] https://github.com/mesonbuild/meson/issues/8739

Enrico

-- 
GPG key: 4096R/634F4BD1E7AD5568 2009-05-08 Enrico Zini 


signature.asc
Description: PGP signature