Debian Bug report logs - #901678
lintian: Do not recommend MAINT_OPTIONS for nocheck

Package: lintian; Maintainer for lintian is Debian Lintian Maintainers <[email protected]>; Source for lintian is src:lintian (PTS, buildd, popcon).

Reported by: Drew Parsons <[email protected]>

Date: Fri, 15 Jun 2018 14:03:02 UTC

Severity: normal

Tags: moreinfo

Merged with 1001588

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#901609; Package dpkg-dev. (Fri, 15 Jun 2018 14:03:04 GMT) (full text, mbox, link).


Acknowledgement sent to Drew Parsons <[email protected]>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <[email protected]>. (Fri, 15 Jun 2018 14:03:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Drew Parsons <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS
Date: Fri, 15 Jun 2018 16:01:54 +0200
Package: dpkg-dev
Version: 1.19.0.5
Severity: normal

There seems to be an inconsistency in the handling of BUILD_OPTIONS by
dpkg-buildpackage, in regards to the alternative DEB_BUILD_OPTIONS and
DEB_BUILD_MAINT_OPTIONS handled by dpkg-buildflags.

lintian warning debian-rules-sets-DEB_BUILD_OPTIONS instructs us to
use DEB_BUILD_MAINT_OPTIONS in debian/rules, not DEB_BUILD_OPTIONS
(which can be set by the user).

But dpkg-buildpackage only uses DEB_BUILD_OPTIONS and ignores
DEB_BUILD_MAINT_OPTIONS.  

Should dpkg-buildpackage be updated to use DEB_BUILD_MAINT_OPTIONS?

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dpkg-dev depends on:
ii  binutils      2.30-21
ii  bzip2         1.0.6-8.1
ii  libdpkg-perl  1.19.0.5
ii  make          4.2.1-1
ii  patch         2.7.6-2
ii  perl          5.26.2-6
ii  tar           1.30+dfsg-2
ii  xz-utils      5.2.2-1.3

Versions of packages dpkg-dev recommends:
ii  build-essential          12.5
ii  clang-3.8 [c-compiler]   1:3.8.1-27
ii  fakeroot                 1.22-2
ii  gcc [c-compiler]         4:7.3.0-3
ii  gcc-6 [c-compiler]       6.4.0-17
ii  gcc-7 [c-compiler]       7.3.0-22
ii  gnupg                    2.2.8-1
ii  gnupg2                   2.2.8-1
ii  gpgv                     2.2.8-1
ii  libalgorithm-merge-perl  0.08-3

Versions of packages dpkg-dev suggests:
ii  debian-keyring  2018.06.04

-- no debconf information



Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#901609; Package dpkg-dev. (Fri, 15 Jun 2018 14:36:05 GMT) (full text, mbox, link).


Acknowledgement sent to Guillem Jover <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>. (Fri, 15 Jun 2018 14:36:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Guillem Jover <[email protected]>
To: Drew Parsons <[email protected]>, [email protected]
Subject: Re: Bug#901609: dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS
Date: Fri, 15 Jun 2018 16:32:06 +0200
Hi!

On Fri, 2018-06-15 at 16:01:54 +0200, Drew Parsons wrote:
> Package: dpkg-dev
> Version: 1.19.0.5
> Severity: normal

> There seems to be an inconsistency in the handling of BUILD_OPTIONS by
> dpkg-buildpackage, in regards to the alternative DEB_BUILD_OPTIONS and
> DEB_BUILD_MAINT_OPTIONS handled by dpkg-buildflags.
> 
> lintian warning debian-rules-sets-DEB_BUILD_OPTIONS instructs us to
> use DEB_BUILD_MAINT_OPTIONS in debian/rules, not DEB_BUILD_OPTIONS
> (which can be set by the user).
> 
> But dpkg-buildpackage only uses DEB_BUILD_OPTIONS and ignores
> DEB_BUILD_MAINT_OPTIONS.  
> 
> Should dpkg-buildpackage be updated to use DEB_BUILD_MAINT_OPTIONS?

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.

Thanks,
Guillem



Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#901609; Package dpkg-dev. (Fri, 15 Jun 2018 22:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>. (Fri, 15 Jun 2018 22:57:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Drew Parsons <[email protected]>
To: Guillem Jover <[email protected]>, [email protected]
Subject: Re: Bug#901609: dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS
Date: Sat, 16 Jun 2018 00:48:16 +0200
> 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.

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?





Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#901609; Package dpkg-dev. (Sat, 16 Jun 2018 16:45:08 GMT) (full text, mbox, link).


Acknowledgement sent to Guillem Jover <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>. (Sat, 16 Jun 2018 16:45:08 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Guillem Jover <[email protected]>
To: [email protected], [email protected]
Cc: [email protected]
Subject: Re: Bug#901609: dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS
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



Bug 901609 cloned as bug 901678 Request was from Guillem Jover <[email protected]> to [email protected]. (Sat, 16 Jun 2018 16:45:08 GMT) (full text, mbox, link).


Bug reassigned from package 'dpkg-dev' to 'debhelper'. Request was from Guillem Jover <[email protected]> to [email protected]. (Sat, 16 Jun 2018 16:45:10 GMT) (full text, mbox, link).


No longer marked as found in versions dpkg/1.19.0.5. Request was from Guillem Jover <[email protected]> to [email protected]. (Sat, 16 Jun 2018 16:45:11 GMT) (full text, mbox, link).


Changed Bug title to 'debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS' from 'dpkg-dev: dpkg-buildpackage ignores DEB_BUILD_MAINT_OPTIONS'. Request was from Guillem Jover <[email protected]> to [email protected]. (Sat, 16 Jun 2018 16:45:11 GMT) (full text, mbox, link).


Information forwarded to [email protected], Debhelper Maintainers <[email protected]>:
Bug#901678; Package debhelper. (Sun, 17 Jun 2018 16:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to Niels Thykier <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debhelper Maintainers <[email protected]>. (Sun, 17 Jun 2018 16:51:02 GMT) (full text, mbox, link).


Message #33 received at [email protected] (full text, mbox, reply):

From: Niels Thykier <[email protected]>
To: [email protected], Drew Parsons <[email protected]>, Guillem Jover <[email protected]>
Subject: Re: Bug#901678: debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS
Date: Sun, 17 Jun 2018 16:44:00 +0000
Control: tags -1 moreinfo

On Sat, 16 Jun 2018 18:44:25 +0200 Guillem Jover <[email protected]> wrote:
> [...]
> 
> > 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?
> 
> [...]
> 
> 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
> 
> 

Indeed, overriding dh_auto_test is probably what you are looking for.

As for debhelper supporting DEB_BUILD_MAINT_OPTIONS.  It is possible,
but are we sure it makes sense for packagers to DEB_BUILD_MAINT_OPTIONS
for things like nocheck, nostrip, noautodbgsym, parallel=n, etc.?

Thanks,
~Niels



Added tag(s) moreinfo. Request was from Niels Thykier <[email protected]> to [email protected]. (Sun, 17 Jun 2018 16:51:02 GMT) (full text, mbox, link).


Information forwarded to [email protected], Debhelper Maintainers <[email protected]>:
Bug#901678; Package debhelper. (Sun, 17 Jun 2018 17:42:02 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Debhelper Maintainers <[email protected]>. (Sun, 17 Jun 2018 17:42:02 GMT) (full text, mbox, link).


Message #40 received at [email protected] (full text, mbox, reply):

From: Drew Parsons <[email protected]>
To: Niels Thykier <[email protected]>, [email protected], Guillem Jover <[email protected]>
Subject: Re: Bug#901678: debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS
Date: Sun, 17 Jun 2018 19:33:08 +0200
On Sun, 2018-06-17 at 16:44 +0000, Niels Thykier wrote:
> 
> > > 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?
> > 
> > 
> Indeed, overriding dh_auto_test is probably what you are looking for.
> 
> As for debhelper supporting DEB_BUILD_MAINT_OPTIONS.  It is possible,
> but are we sure it makes sense for packagers to
> DEB_BUILD_MAINT_OPTIONS
> for things like nocheck, nostrip, noautodbgsym, parallel=n, etc.?


I don't get it.  What is the point of DEB_BUILD_MAINT_OPTIONS (and the
lintian warning about DEB_BUILD_OPTIONS) if no tool is actually using
it?

Drew





Information forwarded to [email protected], Debhelper Maintainers <[email protected]>:
Bug#901678; Package debhelper. (Sun, 17 Jun 2018 18:39:02 GMT) (full text, mbox, link).


Acknowledgement sent to Niels Thykier <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debhelper Maintainers <[email protected]>. (Sun, 17 Jun 2018 18:39:02 GMT) (full text, mbox, link).


Message #45 received at [email protected] (full text, mbox, reply):

From: Niels Thykier <[email protected]>
To: [email protected], [email protected], Guillem Jover <[email protected]>
Subject: Re: Bug#901678: debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS
Date: Sun, 17 Jun 2018 18:35:00 +0000
Drew Parsons:
> On Sun, 2018-06-17 at 16:44 +0000, Niels Thykier wrote:
>>
>>>> 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?
>>>
>>>
>> Indeed, overriding dh_auto_test is probably what you are looking for.
>>
>> As for debhelper supporting DEB_BUILD_MAINT_OPTIONS.  It is possible,
>> but are we sure it makes sense for packagers to
>> DEB_BUILD_MAINT_OPTIONS
>> for things like nocheck, nostrip, noautodbgsym, parallel=n, etc.?
> 
> 
> I don't get it.  What is the point of DEB_BUILD_MAINT_OPTIONS (and the
> lintian warning about DEB_BUILD_OPTIONS) if no tool is actually using
> it?
> 
> Drew
> 
> 

The primary use of DEB_BUILD_MAINT_OPTIONS that I know of is to make
dpkg-buildflags enable hardening or other special-case compiler flags.
E.g. DEB_BUILD_MAINT_OPTIONS=hardening=+all.

That use-case is completely handled/covered by dpkg-buildflags.

Thanks,
~Niels




Information forwarded to [email protected], Debhelper Maintainers <[email protected]>:
Bug#901678; Package debhelper. (Sun, 17 Jun 2018 19:09:04 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Debhelper Maintainers <[email protected]>. (Sun, 17 Jun 2018 19:09:04 GMT) (full text, mbox, link).


Message #50 received at [email protected] (full text, mbox, reply):

From: Drew Parsons <[email protected]>
To: Niels Thykier <[email protected]>, [email protected], Guillem Jover <[email protected]>
Subject: Re: Bug#901678: debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS
Date: Sun, 17 Jun 2018 21:06:57 +0200
On Sun, 2018-06-17 at 18:35 +0000, Niels Thykier wrote:
> Drew Parsons:
> > 
> The primary use of DEB_BUILD_MAINT_OPTIONS that I know of is to make
> dpkg-buildflags enable hardening or other special-case compiler
> flags.
> E.g. DEB_BUILD_MAINT_OPTIONS=hardening=+all.
> 
> That use-case is completely handled/covered by dpkg-buildflags.

I see.  The idea is that dpkg-buildflags uses DEB_BUILD_MAINT_OPTIONS
to adjust CFLAGS and friends.  nocheck has no place there.

The debhelper check in /usr/share/lintian/checks/rules.pm checks for
DEB_BUILD_OPTIONS in debian/rules and issues a warning on it (l.219). 

An override for that warning is automatically placed if
DEB_BUILD_OPTIONS contains nocheck, but only when override_dh_auto_test
is used (l.447).

I'm not sure if the tests in my upstream build script can be handled
with override_dh_auto_test. In that case, I should use a package
lintian-override to override the lintian warning.

Drew




Marked as found in versions debhelper/13.5.2. Request was from Niels Thykier <[email protected]> to [email protected]. (Mon, 13 Dec 2021 06:51:03 GMT) (full text, mbox, link).


Merged 901678 1001588 Request was from Niels Thykier <[email protected]> to [email protected]. (Mon, 13 Dec 2021 06:51:04 GMT) (full text, mbox, link).


Information forwarded to [email protected], Debhelper Maintainers <[email protected]>:
Bug#901678; Package debhelper. (Sat, 08 Oct 2022 09:45:04 GMT) (full text, mbox, link).


Acknowledgement sent to Niels Thykier <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debhelper Maintainers <[email protected]>. (Sat, 08 Oct 2022 09:45:04 GMT) (full text, mbox, link).


Message #59 received at [email protected] (full text, mbox, reply):

From: Niels Thykier <[email protected]>
To: [email protected], [email protected], Guillem Jover <[email protected]>
Subject: Re: Bug#901678: debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS
Date: Sat, 8 Oct 2022 11:27:48 +0200
Control: reassign -1 lintian
Control: retitle -1 lintian: Do not recommend MAINT_OPTIONS for nocheck

Hi,

Revisiting this, I think the bug is that lintian blindly recommended 
DEB_BUILD_MAINT_OPTIONS for when you set DEB_BUILD_OPTIONS=nocheck in 
debian/rules.

As it is, DEB_BUILD_MAINT_OPTIONS is only for dpkg-buildflags despite 
its similarity with DEB_BUILD_OPTIONS (which is *also* used by other 
tools).  When lintian detects DEB_BUILD_OPTIONS being set in 
debian/rules, it should recommend to use DEB_BUILD_MAINT_OPTIONS only 
for things that dpkg-buildflags cares about and other means for other 
flags (e.g., nocheck => override_dh_auto_test for dh packages).

Thanks,
~Niels





Bug reassigned from package 'debhelper' to 'lintian'. Request was from Niels Thykier <[email protected]> to [email protected]. (Sat, 08 Oct 2022 09:45:04 GMT) (full text, mbox, link).


No longer marked as found in versions debhelper/13.5.2. Request was from Niels Thykier <[email protected]> to [email protected]. (Sat, 08 Oct 2022 09:45:06 GMT) (full text, mbox, link).


Changed Bug title to 'lintian: Do not recommend MAINT_OPTIONS for nocheck' from 'debhelper: Dh_Lib:get_buildoptions() does not honor DEB_BUILD_MAINT_OPTIONS'. Request was from Niels Thykier <[email protected]> to [email protected]. (Sat, 08 Oct 2022 09:45:07 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 09:31:46 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.