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
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).
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
> 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?
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).
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
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).
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).
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
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
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).
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
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
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).
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
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).
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/.