#1057238 debian-policy: Take dpkg-build-api into account for Rules-Requires-Root

#1057238#5
Date:
2023-12-02 00:22:04 UTC
From:
To:
Hi!

Starting with dpkg 1.22.0, it implements a dpkg-build-api mechanism
similar in concept to the debhelper-compat levels.

You can check its documentation in the dpkg-build-api(7) and
dpkg-buildapi(1) manual pages.

I think at least the part that involves the Rules-Requires-Root field
which in level 1 defaults to value «no» instead of «binary-targets»
should be documented in the Debian policy.

I'm ambivalent on whether documenting the general mechanism in Debian
policy makes sense though.

[ I noticed I didn't update the deb-src-control(5) manual page,
  so I did that locally and will be part of the next dpkg release. ]

Thanks,
Guillem

#1057238#10
Date:
2023-12-11 18:09:44 UTC
From:
To:
Note that I proposed that in bug #229357 in 2004, this was even fully implemented,
commited to the VCS and finally reverted without explanation.
I am still not sure why I suffered so much hostility over such a simple design.

Cheers,

#1057238#15
Date:
2023-12-15 16:42:34 UTC
From:
To:
Hello,

Agreed.  Thanks for the report.

When many/most Debian package maintainers need to know about this, as
they do debhelper compat, then we should add it, but until then, perhaps
not.

#1057238#20
Date:
2024-08-13 19:36:09 UTC
From:
To:
On Fri, 15 Dec 2023 16:42:34 +0000 Sean Whitton <spwhitton@spwhitton.name> wrote:

Can we have a trivial editorial change to the Rules-Requires-Root
paragraph saying that default depends on the `dpkg-build-api` used?

Bringing it up, because we are seeing a recommendation for people to add
a `Rules-Requires-Root: no` even though it is the default and redundant
because "policy and lintian said so".

Best regards,
Niels

PS: Concrete example I noticed was in #1078267, but I doubt it is a lone
case if we dig deeper.

#1057238#25
Date:
2024-08-14 00:30:00 UTC
From:
To:
Hello,

That's not good.  Let's fix this.

It's not quite trivial, because I think we need to say what a
dpkg-build-api is, somewhere, and how it's selected.

A patch would be welcome and it would still be an informative/editorial
change that I could just upload, I think.

#1057238#30
Date:
2024-08-15 09:07:43 UTC
From:
To:
Sean Whitton:

How about adding

"""
The default for Rules-Requires-Root depends on the dpkg-build-api level
(the dpkg-build-api is defined in "man 7 dpkg-build-api"). At level 0
(or when not declared), Rules-Requires-Root defaults to binary-targets.
In later versions, it defaults to no.
"""

in 5.6.31 and then removing the `(default)` next `binary-targets` in 5.6.31?

I think that would do wonders.

Best regards,
Niels

#1057238#35
Date:
2024-08-16 23:17:15 UTC
From:
To:
Hi!

That would look good to me.

Thanks,
Guillem

#1057238#40
Date:
2024-08-25 02:04:33 UTC
From:
To:
Hello,

Based on this I came up with the following, which I think is slightly
cleaner than adding a whole paragraph.  Would you mind checking it?
--- debian/changelog | 2 ++ policy/ch-controlfields.rst | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index c1fc3c3..2d5d204 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ debian-policy (4.7.0.1) UNRELEASED; urgency=medium Thanks to Paul Gevers for the report. * Fix markup problem in 3.9 (Closes: #1074040). Thanks to Ke Zhang for the report & patch. + * Update specification of the default value for Rules-Requires-Root. + See #1057238.
#1057238#45
Date:
2024-08-25 03:45:12 UTC
From:
To:
Hi!

Ah, indeed, this looks better to me too!

Thanks,
Guillem

#1057238#50
Date:
2024-08-25 07:42:03 UTC
From:
To:
Sean Whitton:

LGTM/seconded. Thanks for providing.

Best regards,
Niels