Hello, I am packaging a python extension which use cmake as build systemdxtbx_flumpy.dir/boost_python/flumpy.cc.o /usr/lib/x86_64-linux-gnu/libboost_python310.so.1.74.0
here the repo
https://salsa.debian.org/science-team/dxtbx
I try to activate the test but this cause this kind of trouble
During handling of the above exception, another exception occurred: /usr/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level) tests/serialize/test_xds.py:8: in <module>
from dxtbx.imageset import ImageSetFactory
dxtbx/imageset.py:5: in <module>
import dxtbx.format.image # noqa: F401, import dependency for unpickling dxtbx/format/image.py:8: in <module>
from dxtbx_format_image_ext import * # type: ignore # isort:skip # noqa: F403
E ModuleNotFoundError: No module named 'dxtbx_format_image_ext'
Indeed the extension are build here.
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/dxtbx && /usr/bin/cmake -E cmake_link_script CMakeFiles/dxtbx_flumpy.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -flto -Wl,-z,relro -shared -o ../../lib/dxtbx_flumpy.cpython-310-x86_64-linux-gnu.so CMakeFiles/
lto-wrapper: warning: using serial compilation of 4 LTRANS jobsDoes the same happen when you run the test in the source tree manually?
lto-wrapper: note: see the ‘-flto’ option documentation for more information
[ 90%] Linking CXX shared module ../../lib/dxtbx_format_image_ext.so
so I need to add the /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/lib directory to the PYTHONPATH.
do you know how to do this ?
Does the same happen when you run the test in the source tree manually?
Hello AndreyWhen trying to run tests you should look how does the upstream intend to
Does the same happen when you run the test in the source tree manually?
I do not know
When trying to run tests you should look how does the upstream intend torun them.
When trying to run tests you should look how does the upstream intend torun them.
Yes they are building inplace the module like this
from https://github.com/dials/dxtbx/blob/main/.azure-pipelines/unix-build.yml
# Build dxtbxOh. In this case setting PYTHONPATH (if it works, and I'm not 100% sure it will) sounds like a better option.
- bash: |
set -e
. conda_base/bin/activate
set -ux
mkdir build
cd build
cmake ../modules/dxtbx
cmake --build . --target install
pip install ../modules/dxtbx
/usr/share/perl5/Debian/Debhelper/Buildsystem.pm to be just "obj-$DEB_HOST_GNU_TYPE".
Oh. In this case setting PYTHONPATH (if it works, and I'm not 100% sure it
will) sounds like a better option.
So, the cmake build path is, as far as I know, defined in /usr/share/perl5/Debian/Debhelper/Buildsystem.pm to be just obj-$DEB_HOST_GNU_TYPE".
/usr/share/perl5/Debian/Debhelper/Buildsystem.pm to be just "obj-$DEB_HOST_GNU_TYPE".
Thanks for the info, if I an not wrong during the build process we
can setup a new builddir. So is is possible to obtain the real
builddir during the build ?
cd build
cmake ../modules/dxtbx
cmake --build . --target install
pip install ../modules/dxtbx
export PYBUILD_AFTER_BUILD=make -C {build_dir}/lib
export PYBUILD_BEFORE_TEST=cp {build_dir}/lib/lib/*.so {build_dir}
export PYBUILD_BEFORE_INSTALL=cp {build_dir}/lib/lib/*.so {build_dir}; rm -rf {build_dir}/lib
it seem to work but I am am not really confident with the 'rm -rf {build_dir}/lib' during the install
If I do not remove these files, they got installed by pybuild.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 355 |
Nodes: | 16 (2 / 14) |
Uptime: | 08:48:40 |
Calls: | 7,656 |
Files: | 12,812 |
Messages: | 5,701,176 |