Subject: Re: Bug#901609: dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS

From: Guillem Jover <[email-masked]>
Date: Sat, 16 Jun 2018 18:44:25 +0200

Control: clone -1 -2
Control: retitle -1 dpkg-dev: Does not honor noopt from DEB_BUILD_MAINT_OPTIONS
Control: reassign -2 debhelper
Control: retitle -2 debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS

Hi!

On Sat, 2018-06-16 at 00:48:16 +0200, Drew Parsons wrote:
> > Perhaps I'm misunderstanding the request, but this is inside-out,
> > dpkg-buildpackage always calls debian/rules (and never the other way
> > around) so whatever is set from within that file will not be visible
> > to the outter process. dpkg-buildpckage does not (and cannot) really
> > care what you do with either of the variables in debian/rules. :)
> > 
> > Barring some misunderstanding from my part, I'm planning on closing
> > this report in a bit.

> The problem is this:  in debian/rules I have DEB_BUILD_OPTIONS=nocheck,
> which is used (I don't know by what exactly) to prevent the build
> system from automatically running test.

Take into account, though, that this will not affect things like the
build dependency satisfiability, or build profiles and similar, because
as I mention above, that's set too late and in an inner level than what
dpkg-checkbuilddeps or dpkg-buildpackage would be checking.

> But lintian complains that it should be set to DEB_BUILD_MAINT_OPTIONS
> instead.
> 
> But when I change it to DEB_BUILD_MAINT_OPTIONS=nocheck (or "export
> DEB_BUILD_MAINT_OPTIONS=nocheck"), the tests are run.
> DEB_BUILD_MAINT_OPTIONS is being ignored at build time.
> 
> Is it dh and debhelper that the bug needs to be sent to?

I was actually going over the dpkg-dev code to make sure, and that
does not handle noopt correctly when set from DEB_BUILD_MAINT_OPTIONS,
which I've fixed now locally. That's why I've cloned instead of just
reassigning.

The one you report seems to be a bug in debhelper. But I think the
usual pattern is to just add an override for the dh_auto_test command
instead?

Thanks,
Guillem