[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bug in DebHelper or pybuild when deteting the plugin system.



Hello, I am working in order to solve the bitshuffle FTBFS.

I took the liberty to modernize the package in my NMU.

But once I added pybuild-plugin-pyproject

the build failed with this error message

dh_auto_clean -- -v
	pybuild --clean -i python{version} -p "3.12 3.11" -v
D: pybuild pybuild:614: version: 6.20231204
D: pybuild pybuild:615: ['/usr/bin/pybuild', '--clean', '-i', 'python{version}', '-p', '3.12 3.11', '-v']
D: pybuild pybuild:39: cfg: Namespace(verbose=True, quiet=False, really_quiet=False, detect_only=False, clean_only=True, configure_only=False, build_only=False, install_only=False, test_only=False, autopkgtest_only=False, list_systems=False, print_args=None, before_clean=None, clean_args=None, after_clean=None, before_configure=None, configure_args=None, after_configure=None, before_build=None, build_args=None, after_build=None, before_install=None, install_args=None, after_install=None, before_test=None, test_args=None, after_test=None, test_nose=False, test_nose2=False, test_pytest=False, test_tox=False, test_custom=False, dir='/home/picca/debian/picca/bitshuffle', destdir='debian/tmp', ext_destdir=None, ext_pattern='\\.so(\\.[^/]*)?$', ext_sub_pattern=None, ext_sub_repl=None, install_dir=None, name='bitshuffle', system=None, versions=['3.12', '3.11'], interpreter=['python{version}'], disable=None, custom_tests=False)
D: pybuild tools:232: invoking: /usr/bin/dpkg-architecture
D: pybuild debhelper:183: source=bitshuffle, binary packages=['bitshuffle']
E: pybuild pybuild:122: unrecognized build system: pyproject	
dh_auto_clean: error: pybuild --clean -i python{version} -p "3.12 3.11" -v returned exit code 10

So I instrumented a bit the pybuild code with some print...


    # Selected by build_dep?                                                                                                                                                                                                                   
    if not selected_plugin:
        dh = DebHelper(build_options())
        for build_dep in dh.build_depends:
            if build_dep.startswith('pybuild-plugin-'):
                print(f"'{build_dep}'")
                print()
                selected_plugin = build_dep.split('-', 2)[2]
                break

    if selected_plugin:
        certainty = 99
	print()
        print(f'"{selected_plugin}"')
	print()
        print(build.plugins)
	print()
        Plugin = build.plugins.get(selected_plugin)
        print(Plugin)
	print()
        if not Plugin:
            log.error('unrecognized build system: %s', selected_plugin)
            exit(10)
        plugin = Plugin(cfg)
        context = {'ENV': env, 'args': {}, 'dir': cfg.dir}
        plugin.detect(context)

And I discoverd this

---
dh clean --buildsystem=pybuild
   debian/rules override_dh_auto_clean
make[1] : on entre dans le répertoire « /home/picca/debian/picca/bitshuffle »
rm -rf lzf/lzf
rm -rf lz4
dh_auto_clean -- -v
	pybuild --clean -i python{version} -p "3.12 3.11" -v
D: pybuild pybuild:614: version: 6.20231204
D: pybuild pybuild:615: ['/usr/bin/pybuild', '--clean', '-i', 'python{version}', '-p', '3.12 3.11', '-v']
D: pybuild pybuild:39: cfg: Namespace(verbose=True, quiet=False, really_quiet=False, detect_only=False, clean_only=True, configure_only=False, build_only=False, install_only=False, test_only=False, autopkgtest_only=False, list_systems=False, print_args=None, before_clean=None, clean_args=None, after_clean=None, before_configure=None, configure_args=None, after_configure=None, before_build=None, build_args=None, after_build=None, before_install=None, install_args=None, after_install=None, before_test=None, test_args=None, after_test=None, test_nose=False, test_nose2=False, test_pytest=False, test_tox=False, test_custom=False, dir='/home/picca/debian/picca/bitshuffle', destdir='debian/tmp', ext_destdir=None, ext_pattern='\\.so(\\.[^/]*)?$', ext_sub_pattern=None, ext_sub_repl=None, install_dir=None, name='bitshuffle', system=None, versions=['3.12', '3.11'], interpreter=['python{version}'], disable=None, custom_tests=False)
D: pybuild tools:232: invoking: /usr/bin/dpkg-architecture
D: pybuild debhelper:183: source=bitshuffle, binary packages=['bitshuffle']
'pybuild-plugin-pyproject	'


"pyproject	"

{'autopkgtest': <class 'dhpython.build.plugin_autopkgtest.BuildSystem'>, 'cmake': <class 'dhpython.build.plugin_cmake.BuildSystem'>, 'custom': <class 'dhpython.build.plugin_custom.BuildSystem'>, 'distutils': <class 'dhpython.build.plugin_distutils.BuildSystem'>, 'flit': <class 'dhpython.build.plugin_flit.BuildSystem'>, 'meson': <class 'dhpython.build.plugin_meson.BuildSystem'>, 'pyproject': <class 'dhpython.build.plugin_pyproject.BuildSystem'>}

None

E: pybuild pybuild:122: unrecognized build system: pyproject	
---

So the detected plugin is 'pyproject      ' with trailling whitespaces.


And this comes strait from the DebHelper build_dep parsing 'pybuild-plugin-pyproject         '

This is due to the peticular organisation of the Build-Depends of the Maintainer.

Build-Depends: debhelper-compat (= 13)
        , dh-exec
        , dh-python
        , dh-sequence-numpy3
	, dh-sequence-python3
        , pybuild-plugin-pyproject
	, python3-all-dev
	, python3-numpy
        , libhdf5-serial-dev
	, libhdf5-openmpi-dev
#	, libopenmpi-dev
	, openmpi-bin
	, python3-setuptools
	, python3-h5py-mpi
        , quilt
	, pkg-config
	, cython3
        , liblzf-dev
        , liblz4-dev


It is easy for me to solve this  (wrap-and-sort), but I would let you know that the plugin detection has some flaw.

I do not know if this is a problem in the parsing of the dependecies of the way pybuild extract the plugin name information from these dependecies.

I also do not know how many packages are affected by this issue...

Cheers

Fred.

I am ok to fill a bug against dh-python once we decided is this is an issue in the parsing or in pybuild.

Thanks for your attention 

Fred


Reply to: