[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rules-Requires-Root, inconsistency in policy?



Hi!

On Thu, 2025-08-28 at 21:58:54 +0200, Robin Gustafsson wrote:
> With `Rules-Requires-Root: no` as the new default,

The default only when using dpkg-buildpackage.

> as reflected in
> policy section 5.6.31, is the last paragraph of policy section
> 4.9(.0) still correct?
> 
> """
> The builder may set DEB_RULES_REQUIRES_ROOT environment variable
> when calling any of the mandatory targets as defined in
> Rules-Requires-Root. If the variable is not set, the package must
> behave as if it was set to binary-targets.
> """
> 
> It seems inconsistent but I'm not familiar enough with the topic to know.

Because we still support debian/rules as an official entry point
(will be sending a revision of the old proposal to change that RSN!),
other builders might not support the R³ field, so might not set that
variable at all. But this was the intended behavior for backwards
compatibility.

Perhaps seeing this in action might help see how it works though. For
example take pci.ids (a very simple package), and modify its
debian/rules so that it looks like this:

  ,---
  […]

  %:
  	@echo "=> R3: <$(DEB_RULES_REQUIRES_ROOT)>"
  	dh $@

  […]
  `---

Then build the package with:

  $ dpkg-buildpackage --no-sign --build=binary
  $ debian/rules binary
  $ fakeroot debian/rules binary
  $ DEB_RULES_REQUIRES_ROOT=no debian/rules binary

I think it would be nice to try to clarify the Debian policy to make
this more clear, but I'm not sure what is the confusing part that
might need to be reworded or improved.

Thanks,
Guillem


Reply to: