Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using debian-compat (=12) fails #326

Open
ikus060 opened this issue Apr 24, 2021 · 5 comments
Open

Using debian-compat (=12) fails #326

ikus060 opened this issue Apr 24, 2021 · 5 comments

Comments

@ikus060
Copy link

ikus060 commented Apr 24, 2021

I'm trying to upgrade my package to use compat 12. It's failing with this error Please use the third-party "pybuild" build system instead of python-distutils

Here control file:

Source: minarca-quota-api
Section: python
Priority: extra
Maintainer: IKUS Software inc. <support@ikus-soft.com>
Build-Depends: debhelper-compat (= 12), python3, dh-virtualenv (>= 1.1),
    python3-setuptools, python3-pip, python3-dev, libffi-dev,
    libldap2-dev, libsasl2-dev
Standards-Version: 3.9.5

Package: minarca-quota-api
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python3 (>= 3.5), ${misc:Pre-Depends}
Depends: ${python3:Depends}, ${misc:Depends}, python3-distutils | libpython3.5-stdlib
Description: Minarca Quota API Server

Rules:


export DH_VIRTUALENV_INSTALL_ROOT=/opt/
export SETUPTOOLS_SCM_PRETEND_VERSION=$(shell python3 setup.py --version)

%:
	dh $@ --with python-virtualenv --builddirectory=build

override_dh_virtualenv:
	dh_virtualenv --install-suffix minarca-server --setuptools-test --python python3

And the resulting build log:

dpkg-buildpackage: info: source package minarca-quota-api
dpkg-buildpackage: info: source version 3.8.1~dev24+g2985e41
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Patrik Dufresne <patrik@ikus-soft.com>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with python-virtualenv --builddirectory=build
/build/minarca-quota-api/.eggs/setuptools_scm-6.0.1-py3.7.egg/setuptools_scm/git.py:88: UserWarning: "/build" is shallow and may cause errors
  warnings.warn(f'"{wd.path}" is shallow and may cause errors')
   dh_autoreconf_clean -O--builddirectory=build
   dh_clean -O--builddirectory=build
 debian/rules build
dh build --with python-virtualenv --builddirectory=build
/build/minarca-quota-api/.eggs/setuptools_scm-6.0.1-py3.7.egg/setuptools_scm/git.py:88: UserWarning: "/build" is shallow and may cause errors
  warnings.warn(f'"{wd.path}" is shallow and may cause errors')
   dh_update_autotools_config -O--builddirectory=build
   dh_autoreconf -O--builddirectory=build
   dh_auto_configure -O--builddirectory=build
dh_auto_configure: Please use the third-party "pybuild" build system instead of python-distutils
dh_auto_configure: This feature was removed in compat 12.
make: *** [debian/rules:7: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make[1]: *** [Makefile:50: ../minarca-quota-api_3.8.1~dev24+g2985e41_amd64.deb] Error 2
make[1]: Leaving directory '/builds/ikus-soft/minarca/minarca-quota-api'
make: *** [Makefile:13: minarca-quota-api] Error 2

Is compat 12 event support ? The documentation still make reference to compat 9

@nailor
Copy link
Collaborator

nailor commented Apr 25, 2021 via email

@ikus060
Copy link
Author

ikus060 commented Apr 27, 2021

Seams to be working with compat=11.

Leaving this bug open as it still relevant. compat=12 is not working

@Forty-Bot
Copy link
Contributor

Forty-Bot commented Jul 25, 2021

I believe this could be fixed if you use --buildsystem=dh_virtualenv. However, note that you will need to add

export DH_VIRTUALENV_ARGUMENTS

to avoid the error

virtualenv: error: unrecognized arguments: --no-site-packages

as this flag has been removed in recent virtualenv versions (see this stackoverflow answer for details) (this should be resolved by #334).

You will also need to add a dependency on python(3)-pip, as the buildsystem uses the host pip... (this should be resolved by #333).

In addition, you must provide a requirements.txt, because it is unconditionally used, even if it does not otherwise exist.

Seams to be working with compat=11.

Note that according to the man page,

The compat 11 is discouraged for new packages as it suffers from feature interaction between dh_installinit and dh_installsystemd causing services to not run correctly in some cases. Please consider using compatibility mode 10 or 12 instead. More details about the issue are available in Debian#887904 and https://lists.debian.org/debian-release/2019/04/msg01442.html.

@mathiasertl
Copy link
Contributor

Hi,

The issue is caused by dh detecting the presence of a setup.py file and thus selecting distutils as build system. The Debian project does not ever change the selection order to ensure deterministic builds. The correct fix would be to pass --buildsystem=none to dh, but that also throws an error currently - but I fixed this in #347 .

Another clean way to solve this issue until the next release is to create an empty Makefile in your repo. dh will detect this before distutils and thus select it. Then your Makefile is called by dh but does nothing (just make sure you don't have a build/install target!).

@nailor I guess a dh_virtualenv release would be kind of nice by now :-)

kr, Mat

@flaccid
Copy link

flaccid commented Mar 20, 2024

I was able to get compat 12 working ok with debian bookworm: https://github.com/flaccid/deb-virtualenv-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants