From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Paul Gortmaker <paul.gortmaker@windriver.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] devshell: introduce intercepts as per native / nativesdk
Date: Thu, 21 Apr 2022 10:53:17 +0100 [thread overview]
Message-ID: <5089dcb4899e2b3bbd1ee12f742eaf87c0021f97.camel@linuxfoundation.org> (raw)
In-Reply-To: <20220420151141.25027-1-paul.gortmaker@windriver.com>
On Wed, 2022-04-20 at 11:11 -0400, Paul Gortmaker wrote:
> In a devshell, recent versions of git will complain if the repo is owned
> by someone other than the current UID - consider this example:
>
> ------
> bitbake -c devshell linux-yocto
>
> [...]
>
> kernel-source#git branch
> fatal: unsafe repository ('/home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source' is owned by someone else)
> To add an exception for this directory, call:
>
> git config --global --add safe.directory /home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source
> kernel-source#
> ------
>
> Of course the devshell has UID zero and the "real" UID is for "paul" in
> this case. And so recent git versions complain.
>
> As the whole purpose of the devshell is to invoke a shell where development
> can take place, having a non-functional git is clearly unacceptable.
>
> Richard suggested we could use PSEUDO_UNLOAD=1 to evade this issue, and I
> suggested we probably will see other similar instances like this and should
> make use of PATH to intercept via devshell wrappers - conveniently we already
> have examples of this.
>
> Here, we copy the existing "ar" example and tune it to the needs of git to
> combine Richard's suggestion and mine.
>
> As such we now also can store commit logs and use send-email with our user
> specific settings, instead of "root", so in additon to fixing basic
> commands like "git branch" it should also increase general usefulness.
>
> Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>
> diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
> index 62dc958d9a4a..7ac134e0950f 100644
> --- a/meta/classes/devshell.bbclass
> +++ b/meta/classes/devshell.bbclass
> @@ -2,6 +2,8 @@ inherit terminal
>
> DEVSHELL = "${SHELL}"
>
> +PATH:prepend = "${COREBASE}/scripts/devshell-intercept:"
> +
I just realised, we can't do that! It would apply globally and mean builds
change behaviour depending on whether devshell is inherited or not. It also
means all git calls run through the wrapper, not just devshell ones.
I've also realised we have a bigger problem since some software is running git
to get the version during do_install.
My proposal is to change scripts/devshell-intercept to scripts/git-intercept,
make the PATH change in the do_devshell function below but also add something
like:
PATH:prepend:task-do_install = "${COREBASE}/scripts/git-intercept:"
in common code.
Since this hasn't merged yet, I can tweak the patch if that works for you (or
you can)?
Cheers,
Richard
prev parent reply other threads:[~2022-04-21 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 15:11 [PATCH] devshell: introduce intercepts as per native / nativesdk Paul Gortmaker
2022-04-20 23:24 ` [OE-core] " Andre McCurdy
2022-04-21 10:10 ` Peter Kjellerstedt
2022-04-21 9:53 ` Richard Purdie [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=5089dcb4899e2b3bbd1ee12f742eaf87c0021f97.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.gortmaker@windriver.com \
/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