On 2023-05-03 04 h 06, Jerome Kieffer wrote:1a0/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
Dear Debian Packager
I am the upstream developer of a few debian packages (fabio, pyfai...) and those packages used to rely on numpy.distutils. Since setuptools 60,
this is not more possible so I changed the build system to use mesonpy (pep517 compliant).
I found it easy to tell the debian packaging helper pybuild to use the `pyproject.toml` file to build the software instead of the `setup.py`:
`export PYBUILD_SYSTEM=pyproject` in the debian/rules file.
But later on, the meson configuration finds cython as cython3 but complains the compiler was not found:
```
dh build --with python3,sphinxdoc --buildsystem=pybuild
dh_update_autotools_config -O--buildsystem=pybuild
dh_autoreconf -O--buildsystem=pybuild
dh_auto_configure -O--buildsystem=pybuild
pybuild --configure -i python{version} -p 3.11
dh_auto_build -O--buildsystem=pybuild
pybuild --build -i python{version} -p 3.11
I: pybuild plugin_pyproject:107: Building wheel for python3.11 with "build" module
I: pybuild base:240: python3.11 -m build --skip-dependency-check --no-isolation --wheel --outdir /home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.1a0/.pybuild/cpython3_3.11_pyfai
* Building wheel...
+ meson setup --prefix=/usr /home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.1a0 /home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.1a0/.mesonpy-0rgp966m/build --native-file=/home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.
The Meson build system
Version: 1.0.1
Source dir: /home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.1a0 Build dir: /home/kieffer/workspace/pyFAI/build/debian12/pyFAI-2023.5.1a0/.mesonpy-0rgp966m/build
Build type: native build
Project name: pyFAI
Project version: 2023.5.1a0
C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
C linker for the host machine: cc ld.bfd 2.40
Cython compiler for the host machine: cython3 (cython 0.29.32)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program cython found: NO
../../meson.build:17:0: ERROR: Program 'cython' not found or not executable
```
I had a similar problem for python3 and it was solved by installing `python-is-python3`. But there is no such trick for cython ...
Nota: `sudo ln -s /usr/bin/cython3 /usr/bin/cython` addresses the bug but I am looking for a solution which is compliant with debian packaging !
Thanks for your help.
Jerome
Hi,
It's hard to help you without seeing what the /debian dir looks like.
In theory, you don't need to specify `PYBUILD_SYSTEM=pyproject` for
pybuild to use the pyproject.toml file.
As per the pybuild manpage, you need to have the
`pybuild-plugin-pyproject` package as a build-dependency and the
package you use as the build system, in your case, `python3-mesonpy`.
As for your cython problem, it doesn't seem like you are building in
a clean environment. I would highly recommend you use something like
sbuild to do so:
https://wiki.debian.org/sbuild
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 349 |
Nodes: | 16 (2 / 14) |
Uptime: | 108:16:33 |
Calls: | 7,612 |
Calls today: | 3 |
Files: | 12,786 |
Messages: | 5,683,108 |
Posted today: | 2 |