[Debichem-devel] Bug#928363: gau2grid: FTBFS if build directory contains "-D"

Santiago Vila sanvila at debian.org
Thu May 2 23:49:34 BST 2019


Package: src:gau2grid
Version: 1.3.1-1
Severity: serious
Tags: ftbfs patch

Dear maintainer:

I tried to build this package in buster but it failed:

--------------------------------------------------------------------------------
[...]
 debian/rules build-arch
dh build-arch --with=python3 --buildsystem=pybuild
   dh_update_autotools_config -a -O--buildsystem=pybuild
   dh_autoreconf -a -O--buildsystem=pybuild
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_configure
I: pybuild base:217: python3.7 setup.py config 
running config
dh_auto_configure --buildsystem=cmake --	\
	-DCMAKE_BUILD_TYPE=Release		\
	-DPYTHON_EXECUTABLE=/usr/bin/python3	\
	-DENABLE_XHOST=OFF
	cd obj-x86_64-linux-gnu && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DENABLE_XHOST=OFF ..
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting (unspecified) option MAX_AM: 8
-- Setting (unspecified) option SPHERICAL_ORDER: gaussian
-- Setting (unspecified) option CARTESIAN_ORDER: row
-- Setting option MAX_AM: 8
-- Setting option CMAKE_BUILD_TYPE: Release
-- Setting option ENABLE_XHOST: OFF
-- Setting (unspecified) option BUILD_FPIC: ON
-- Setting (unspecified) option BUILD_SHARED_LIBS: ON
-- Setting (unspecified) option ENABLE_GENERIC: OFF
-- Setting option CMAKE_INSTALL_LIBDIR: lib/x86_64-linux-gnu
-- Setting (unspecified) option PYMOD_INSTALL_LIBDIR: /
-- Setting (unspecified) option INSTALL_PYMOD: OFF
-- Setting (unspecified) option NATIVE_PYTHON_INSTALL: OFF
-- gau2grid install: /usr
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so
-- Found Python 3.7: /usr/bin/python3 (found version 3.7.3)
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY


-- Build files have been written to: /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_build
I: pybuild base:217: /usr/bin/python3 setup.py build 
running build
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/c_wrapper.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/codegen.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/np_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/docs_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/python_reference.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/c_util_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/RSH.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/order.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/c_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/c_pragma.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/_version.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/extras.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
copying gau2grid/utility.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_np_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_c_generator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_order.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_c_code.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_rsh.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/test_helper.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
copying gau2grid/tests/ref_basis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/tests
running egg_info
creating gau2grid.egg-info
writing gau2grid.egg-info/PKG-INFO
writing dependency_links to gau2grid.egg-info/dependency_links.txt
writing requirements to gau2grid.egg-info/requires.txt
writing top-level names to gau2grid.egg-info/top_level.txt
writing manifest file 'gau2grid.egg-info/SOURCES.txt'
reading manifest file 'gau2grid.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'gau2grid.egg-info/SOURCES.txt'
UPDATING /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/_version.py
set /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/gau2grid/_version.py to '0+unknown'
running build_ext
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting option MAX_AM: 6
-- Setting option SPHERICAL_ORDER: gaussian
-- Setting option CARTESIAN_ORDER: row
-- Setting option MAX_AM: 6
-- Setting option CMAKE_BUILD_TYPE: Release
-- Setting option ENABLE_XHOST: ON
-- Performing Test CMAKE_C_FLAGS [-xHost] - Failed
-- Performing Test CMAKE_C_FLAGS [-march=native] - Success, Appending
-- Setting option BUILD_FPIC: ON
-- Setting option BUILD_SHARED_LIBS: ON
-- Setting option ENABLE_GENERIC: OFF
-- Setting (unspecified) option CMAKE_INSTALL_LIBDIR: lib
-- Setting (unspecified) option PYMOD_INSTALL_LIBDIR: /
-- Setting option INSTALL_PYMOD: ON
-- Setting option NATIVE_PYTHON_INSTALL: ON
-- gau2grid install: /usr/local/gau2grid
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so
-- Found Python 3.7: /usr/bin/python3 (found version 3.7.3)
-- Configuring done
-- Generating done
-- Build files have been written to: /<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7
make[2]: Entering directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
make[3]: Entering directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
make[4]: Entering directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
[ 12%] Generating gau2grid.h, gau2grid_orbital.c, gau2grid_phi.c, gau2grid_deriv1.c, gau2grid_deriv2.c, gau2grid_spherical.c, gau2grid_helper.c
Scanning dependencies of target gg
make[4]: Leaving directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
make[4]: Entering directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
[ 25%] Building C object CMakeFiles/gg.dir/gau2grid_phi.c.o
[ 37%] Building C object CMakeFiles/gg.dir/gau2grid_orbital.c.o
[ 50%] Building C object CMakeFiles/gg.dir/gau2grid_deriv1.c.o
[ 62%] Building C object CMakeFiles/gg.dir/gau2grid_deriv2.c.o
[ 75%] Building C object CMakeFiles/gg.dir/gau2grid_spherical.c.o
[ 87%] Building C object CMakeFiles/gg.dir/gau2grid_helper.c.o
[100%] Linking C shared library libgg.so
make[4]: Leaving directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
[100%] Built target gg
make[3]: Leaving directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
make[2]: Leaving directory '/<<PKGBUILDDIR>>/build/temp.linux-amd64-3.7'
dh_auto_build --buildsystem=cmake
	cd obj-x86_64-linux-gnu && make -j1
make[2]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
/usr/bin/cmake -S/<<PKGBUILDDIR>> -B/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f CMakeFiles/gg.dir/build.make CMakeFiles/gg.dir/depend
make[4]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[ 12%] Generating gau2grid.h, gau2grid_orbital.c, gau2grid_phi.c, gau2grid_deriv1.c, gau2grid_deriv2.c, gau2grid_spherical.c, gau2grid_helper.c
/usr/bin/python3 -c "import sys;                                      sys.path.append('/<<PKGBUILDDIR>>');                                      import gau2grid as gg;                                      gg.c_gen.generate_c_gau2grid(8, path='/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu', cartesian_order='row', spherical_order='gaussian')"
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /<<PKGBUILDDIR>> /<<PKGBUILDDIR>> /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/gg.dir/DependInfo.cmake --color=
Scanning dependencies of target gg
make[4]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f CMakeFiles/gg.dir/build.make CMakeFiles/gg.dir/build
make[4]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[ 25%] Building C object CMakeFiles/gg.dir/gau2grid_phi.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_phi.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_phi.c
[ 37%] Building C object CMakeFiles/gg.dir/gau2grid_orbital.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_orbital.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_orbital.c
[ 50%] Building C object CMakeFiles/gg.dir/gau2grid_deriv1.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_deriv1.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_deriv1.c
[ 62%] Building C object CMakeFiles/gg.dir/gau2grid_deriv2.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_deriv2.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_deriv2.c
[ 75%] Building C object CMakeFiles/gg.dir/gau2grid_spherical.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_spherical.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_spherical.c
[ 87%] Building C object CMakeFiles/gg.dir/gau2grid_helper.c.o
/usr/bin/cc -Dgg_EXPORTS  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fPIC   -std=c11 -o CMakeFiles/gg.dir/gau2grid_helper.c.o   -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/gau2grid_helper.c
[100%] Linking C shared library libgg.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/gg.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -Wl,-z,relro -shared -Wl,-soname,libgg.so.1 -o libgg.so.1 CMakeFiles/gg.dir/gau2grid_phi.c.o CMakeFiles/gg.dir/gau2grid_orbital.c.o CMakeFiles/gg.dir/gau2grid_deriv1.c.o CMakeFiles/gg.dir/gau2grid_deriv2.c.o CMakeFiles/gg.dir/gau2grid_spherical.c.o CMakeFiles/gg.dir/gau2grid_helper.c.o 
/usr/bin/cmake -E cmake_symlink_library libgg.so.1 libgg.so.1 libgg.so
make[4]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[100%] Built target gg
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
/usr/bin/cmake -E cmake_progress_start /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles 0
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_test
I: pybuild base:217: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build; python3.7 -m pytest 
============================= test session starts ==============================
platform linux -- Python 3.7.3rc1, pytest-3.10.1, py-1.7.0, pluggy-0.8.0
rootdir: /<<PKGBUILDDIR>>, inifile:
collected 102 items

gau2grid/tests/test_c_code.py ssssssssssssssssssssssssssssssssssssssssss [ 41%]
sssss                                                                    [ 46%]
gau2grid/tests/test_c_generator.py ..................                    [ 63%]
gau2grid/tests/test_np_generator.py ....................                 [ 83%]
gau2grid/tests/test_order.py ..........                                  [ 93%]
gau2grid/tests/test_rsh.py .......                                       [100%]

==================== 55 passed, 47 skipped in 3.95 seconds =====================
dh_auto_test --buildsystem=cmake
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   create-stamp debian/debhelper-build-stamp
 fakeroot debian/rules binary-arch
dh binary-arch --with=python3 --buildsystem=pybuild
   dh_testroot -a -O--buildsystem=pybuild
   dh_prep -a -O--buildsystem=pybuild
   debian/rules override_dh_auto_install
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_install
I: pybuild base:217: /usr/bin/python3 setup.py install --root /<<PKGBUILDDIR>>/debian/tmp 
Traceback (most recent call last):
  File "setup.py", line 92, in <module>
    raise KeyError("CMake argument %s not understood." % arg)
KeyError: 'CMake argument /<<PKGBUILDDIR>>/debian/tmp not understood.'
E: pybuild pybuild:341: install: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py install --root /<<PKGBUILDDIR>>/debian/tmp 
dh_auto_install: pybuild --install --test-pytest -i python{version} -p 3.7 --dest-dir /<<PKGBUILDDIR>>/debian/tmp returned exit code 13
make[1]: *** [debian/rules:30: override_dh_auto_install] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:8: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned exit status 2
--------------------------------------------------------------------------------

This will happen every time the build directory (or <<PKGBUILDDIR>> above)
contains "-D" as a substring, so it will happen randomly when built
with sbuild, including the official buildds.

To reproduce:

mkdir foo-D
cd foo-D
apt-get source gau2grid
cd gau2grid-1.3.1
dpkg-buildpackage -uc -us -b

The reason is in line 86 of setup.py:

  if "-D" not in arg:

which considers anything containing "-D" as a CMAKE option.

Peoposed patch below. Inside the for loop, it is reasonable to assume
that a CMAKE option will effectively start with "-D" and not just
contain it anywhere.

Thanks.

--- a/setup.py
+++ b/setup.py
@@ -83,7 +83,7 @@ if __name__ == "__main__":
     # Parse out CMake args
     setup_args = []
     for arg in sys.argv:
-        if "-D" not in arg:
+        if not arg.startswith("-D"):
             setup_args.append(arg)
             continue
 



More information about the Debichem-devel mailing list