Re: debian/rules and DEB_BUILD_PROFILES vs _OPTIONS
On 2020-09-08 17:43, Helmut Grohne wrote:
> On Tue, Sep 08, 2020 at 12:33:07PM +0200, Christian Kastner wrote:
>> nocheck
>> -------
>>
>> A recipe such as
>>
>> override_dh_auto_test:
>> ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
>> dh_auto_test
>> endif
>>
>> is sufficient as "dh_auto_test" will honor possibly present _OPTIONS, but
>
> This one is redundant. Anyone setting nocheck in profiles must also set
> it in options.
Mattia already pointed this out, but it seems to have slipped my mind again.
>
>> override_dh_auto_test:
>> ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
>> custom-test-command
>> endif
>>
>> is not, as "custom-test-command" will be executed even if
>> DEB_BUILD_OPTIONS=nocheck is set.
>
> Yeah, this is just wrong (at present).
>
> I do understand that having nocheck both as a profile and an option is
> confusing. Being on of the people who made us end up here, I do not
> object to transitioning to a less confusing state. A number of people
> would like to see nocheck be a profile and not an option. I agree with
> that goal in principle, but getting there is a lot of effort. We're
> talking about touching 2300 source packages.
>
> Given that people already started using the profile exclusively, we
> could now deprecate nocheck as an option. That would make us enter a
> transition period where you must set both and packages should check the
> profile. After maybe two stable releases, we could MBF the remaining
> packages.
>
> Contrary to earlier such transitions, we now have a mighty tool to do
> the bulk of the work: The Debian Janitor (thank you again Jelmer!).
Indeed, both lintian and the Janitor could probably help with a
significant share of those cases.
> Another aspect that could make it less confusing would be changing
> canonical entry point for builds. I know that Niels has been working on
> this. The current entry point is debian/rules and that means, we cannot
> add any compatibility layer around that. If you'd have to build with
> dpkg-buildpackage, it could check for the profile and automatically add
> the option.
>
> In any case, we could change both sbuild and pbuilder to do that today.
> Whenever you go sbuild --profiles=nocheck, it could add the option.
That also seems like a quick solution, but feels to me like sidestepping
the issue instead of addressing it (which can be perfectly acceptable
solution, though).
Reply to: