#1070770 lintian: check for testing presence of "nodocs" in DEB_BUILD_OPTIONS

Package:
lintian
Source:
lintian
Submitter:
Julian Gilbey
Date:
2024-06-03 08:39:04 UTC
Severity:
normal
Tags:
#1070770#5
Date:
2024-05-08 19:38:51 UTC
From:
To:
I have come across a number of packages with a line in their
debian/rules like:

ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))

This should be "nodoc", according to the "nodoc" entry in
https://wiki.debian.org/BuildProfileSpec#Registered_profile_names

It would be good to check for this error.

#1070770#12
Date:
2024-05-09 17:13:45 UTC
From:
To:
tags 1070770 patch
thanks

I've created a patch on Salsa that creates a new Lintian check for this.

https://salsa.debian.org/lintian/lintian/-/merge_requests/504

Cheers,

#1070770#19
Date:
2024-05-09 20:14:09 UTC
From:
To:
I've added a bunch of suggestions/comments to the patch: the erroneous
check in debian/rules is for the DEB_BUILD_OPTIONS setting rather than
the DEB_BUILD_PROFILES setting, so it should refer to "options" rather
than "profiles", even though the description for the "nodoc" option
appears on the BuildProfilesSpec wiki page!

I also suggest one tweak to the regex.

Best wishes,

   Julian

#1070770#24
Date:
2024-05-19 06:57:02 UTC
From:
To:
Julian Gilbey <jdg@debian.org>:

This mostly looks like a typo and I am kinda sure that you'd find typos like
this all over many places. I am a bit unsure if checks for this is something we
as a new lintian warning is something that we even need?

Louis-Philippe Véronneau <pollo@debian.org>:

And if we do --  I checked the MR and it does not look extensible. If in
future there comes another class of typos, it will result in a new patch of this
kind. Instead, is it possible to have a list of offending terms like this in a
data list and warn the user about them via a lintian warning?

For instance, we have data/fields/obsolete-packages for listing obsolete
packages and showing the user about the obsolete packages and their
replacements. Do you think a similar implementation for this
(data/fields/bad-buildprofiles ?) makes sense?

Best,
Nilesh

#1070770#29
Date:
2024-05-19 12:48:17 UTC
From:
To:
Hi Nilesh,

Perhaps, perhaps not.  It's not something that's easily spotted by
eye unless you're explicitly looking for it.

Now *that's* a really nice approach.  But here I'd suggest doing the
opposite: checking for valid build options (and note: this is a check
for DEB_BUILD_OPTIONS, not for DEB_BUILD_PROFILES).  There is a very
short list of standard build options: those listed in
dpkg-buildpackage(1) (parallel=n, nocheck, noopt, nostrip, terse,
hardening=..., reproducible=..., abi=..., future=..., qa=...,
optimize=..., sanitize=...) and
https://wiki.debian.org/BuildProfileSpec: nodoc

Best wishes,

   Julian

#1070770#34
Date:
2024-05-20 12:01:39 UTC
From:
To:
+1

Andrius

#1070770#39
Date:
2024-05-22 20:36:58 UTC
From:
To:
Hi Julian!

I concur. Thanks also to Andrius for +1. If Pollo/Andrius would like to work on
it and/or open a MR, I will be happy to review (and merge).

Best,
Nilesh

#1070770#44
Date:
2024-06-03 08:35:02 UTC
From:
To:
On 2024-06-02 19:49, Louis-Philippe Véronneau wrote:> Sounds like a
plan. I made the changed you proposed and also made sure

Great, thanks a lot. I reviewed the code and I think it is good to be
merged as is. Tag name is appropriate and future-proof for other checks
for DEB_BUILD_OPTIONS.

Thanks,
Andrius