mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, Guillem Jover <guillem@debian.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: deb-pkg: remove the fakeroot builds support
Date: Thu, 30 Nov 2023 19:25:42 +0100	[thread overview]
Message-ID: <573e05d347a46febbb0f512b6128a4d683551679.camel@decadent.org.uk> (raw)
In-Reply-To: <CAK7LNASWqQBcf+z+cxWphf5pi8VkB10ABYvPKSxrLKbePYwC0g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2995 bytes --]

On Wed, 2023-11-29 at 03:56 +0900, Masahiro Yamada wrote:
> On Wed, Nov 29, 2023 at 1:31 AM Ben Hutchings <ben@decadent.org.uk> wrote:
> > 
> > On Wed, 2023-11-29 at 00:38 +0900, Masahiro Yamada wrote:
> > > In 2017, the dpkg suite introduced the rootless builds support with the
> > > following commits:
> > > 
> > >   - 2436807c87b0 ("dpkg-deb: Add support for rootless builds")
> > >   - fca1bfe84068 ("dpkg-buildpackage: Add support for rootless builds")
> > > 
> > > This feature is available in the default dpkg on Debian 10 and Ubuntu
> > > 20.04.
> > > 
> > > Remove the old method.
> > 
> > This seems reasonable.
> > 
> > 
> > > Additionally, export DEB_RULES_REQUIRES_ROOT=no in case debian/rules is
> > > invoked without dpkg-buildpackage. This change aligns with the Debian
> > > kernel commit 65206e29f378 ("Allow to run d/rules.real without root").
> > 
> > The Debian linux package has multiple makefiles used recursively
> > (rather than included).  The referenced commit is kind of a hack to
> > make rootless builds of a subset of binary packages work when invoking
> > one of the lower-level makefiles directly.
> 
> 
> The upstream kernel does not support individual package build
> since it is implemented in scripts/package/builddeb shell script.
> 
> 
> Is the direct execution of debian/rules still worth supporting
> in the upstream kernel?

I don't have an opinion on that.

> If the answer is no, "export DEB_RULES_REQUIRES_ROOT=no"
> is meaningless.
> 
> 
> > It works because the package runs dh_builddeb, which checks
> > DEB_RULES_REQUIRES_ROOT.  But setting DEB_RULES_REQUIRES_ROOT has
> > absolutely zero effect on dpkg-deb or other low-level tools.
> 
> Please let me clarify your statement.
> 
> Do you mean this?  ("is needed" ?)
> 
> "It is needed because the package runs dh_builddeb, which checks
>  DEB_RULES_REQUIRES_ROOT."

Yes.

> > > While the upstream kernel currently does not run dh_testroot, it may
> > > be useful in the future.
> > 
> > We can do one of:
> > 
> > 1. Ignore DEB_RULES_REQUIRES_ROOT, assume that dpkg-deb supports
> >    --root-owner-group and use it unconditionally (your v1).
> > 2. Check DEB_RULES_REQUIRES_ROOT, do either fakeroot and chown or
> >    dpkg-deb --root-owner-group (current behaviour), and maybe also do
> >    the equivalent of dh_testroot.
> > 3. Delegate this to dh_builddeb.  Since we use dh_listpackages now,
> >    debhelper is already required and this would make things a lot
> >    simpler.
> > 
> > But the combination of changes in v2 does not make sense to me.
> 
> 
> 
> I like 1 or 3.
> 
> 
> 
> If I go with 3.,
> does splitting it into two patches make sense?
> 
> 
> 1/2:  remove fakeroot  (just like v1)
> 2/2:  dh_* conversion + "export DEB_RULES_REQUIRES_ROOT=no"

Yes, that makes sense to me.

Ben.

-- 
Ben Hutchings
It is easier to write an incorrect program
than to understand a correct one.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-11-30 18:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 15:38 Masahiro Yamada
2023-11-28 16:30 ` Ben Hutchings
2023-11-28 18:56   ` Masahiro Yamada
2023-11-30 18:25     ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573e05d347a46febbb0f512b6128a4d683551679.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=guillem@debian.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®