#1029470 lintian: Needs to distinguish between valid field names for .dsc files and for debian/control files (with vs without "XS-" prefix)

Package:
lintian
Source:
lintian
Submitter:
Joao Eriberto Mota Filho
Date:
2023-01-23 01:03:03 UTC
Severity:
normal
Tags:
#1029470#5
Date:
2022-07-13 17:48:53 UTC
From:
To:
Dear Maintainer,

When doing a QA revision over the package "gox", I received the warning:

  W: gox source: unknown-field Go-Import-Path

However, the right field name is XS-Go-Import-Path, not Go-Import-Path. The
field is present in debian/control on gox:

  XS-Go-Import-Path: github.com/mitchellh/gox

If the XS-Go-Import-Path filed is removed, the following message is shown:

  I: gox source: missing-xs-go-import-path-for-golang-package

The Debian bug #984719 explains how much the XS-Go-Import-Path field is needed.

Regards,

Eriberto

#1029470#10
Date:
2023-01-18 19:55:24 UTC
From:
To:
Hi,

I can confirm this issue for lintian 2.116.0 against src:piuparts
as it is in git or unstable.

#1029470#15
Date:
2023-01-23 00:52:18 UTC
From:
To:
Hi,

Holger Levsen wrote:

I can confirm as well. Unfortunately this is not as trivial to fix
properly as it seems:

A) Lintian currently doesn't seem to make a difference between the
   fields in the .dsc file and those in the debian/control file. But
   especially these XS-* fields exactly need that differentiation.

B) If I add Autobuild, Go-Import-Path, and Ruby-Versions to
   data/common/source-fields, the test suite shows that then these
   lintian tags would fire although they shouldn't (according to the
   test suite):

   adopted-extended-field (in section for source) XS-Go-Import-Path
   adopted-extended-field (in section for source) XS-Autobuild

So for now I have no idea except for hardcoding these three inside the
source function in lib/Lintian/Check/Fields/Unknown.pm. But this feels
wrong.

This though might lead to false negatives if someone uses e.g.
Go-Import-Path without the "XS-" prefix in debian/control.

What would be worse: The current false positives or the potential
false negatives?

I assume that any potential false negative on these
three fields will cause package breakage at build time (wrong Ruby
versions, some Go stuff not working, non-free packages not
autobuilding, etc.), so that we can cope with them.

Cloning this bug report to document that we need a rewrite of
Lintian::Check::Fields::Unknown and module dependencies to distinguish
between .dsc fields and debian/control fields with a common subset.
And maybe with the one set being calculated from the other set by
stripping the XS- prefix.

		Regards, Axel