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?
Hi! 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
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?
Hi! 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. 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
Control: tags -1 moreinfo 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
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
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. Thanks, ~Niels
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