scripts: Make git intercept global

Message ID 20220425140102.2743203-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit af27c81eaf68ee681dcd9456a74cca6a9ab40bf6
Headers show
Series scripts: Make git intercept global | expand

Commit Message

Richard Purdie April 25, 2022, 2:01 p.m. UTC
The previous minimially invasive git intercept simply isn't enough. For example,
meson used in the igt-gpu-tools recipe hardcodes the path to git in the configure
step so at install time, changing PATH has no effect.

There are lots of interesting things we could do to try and avoid problems but
making the git intercept and dropping fakeroot privs for git global is probably
the least worst solution at this point. It will add slight overhead to git calls
but we don't make many so the overall impact is likely minimal.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/base.bbclass       | 1 -
 meta/classes/devshell.bbclass   | 2 --
 scripts/{git-intercept => }/git | 0
 3 files changed, 3 deletions(-)
 rename scripts/{git-intercept => }/git (100%)

Comments

Khem Raj April 25, 2022, 4:58 p.m. UTC | #1
I see git describe hung during bitbake parse stage in few of meta-oe
recipe and also kernel recipe with this patch.

On Mon, Apr 25, 2022 at 7:01 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> The previous minimially invasive git intercept simply isn't enough. For example,
> meson used in the igt-gpu-tools recipe hardcodes the path to git in the configure
> step so at install time, changing PATH has no effect.
>
> There are lots of interesting things we could do to try and avoid problems but
> making the git intercept and dropping fakeroot privs for git global is probably
> the least worst solution at this point. It will add slight overhead to git calls
> but we don't make many so the overall impact is likely minimal.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/classes/base.bbclass       | 1 -
>  meta/classes/devshell.bbclass   | 2 --
>  scripts/{git-intercept => }/git | 0
>  3 files changed, 3 deletions(-)
>  rename scripts/{git-intercept => }/git (100%)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index b54b56d6248..3515720bf95 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -367,7 +367,6 @@ addtask install after do_compile
>  do_install[dirs] = "${B}"
>  # Remove and re-create ${D} so that is it guaranteed to be empty
>  do_install[cleandirs] = "${D}"
> -PATH:prepend:task-install = "${COREBASE}/scripts/git-intercept:"
>
>  base_do_install() {
>         :
> diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
> index 75604d0c076..62dc958d9a4 100644
> --- a/meta/classes/devshell.bbclass
> +++ b/meta/classes/devshell.bbclass
> @@ -2,8 +2,6 @@ inherit terminal
>
>  DEVSHELL = "${SHELL}"
>
> -PATH:prepend:task-devshell = "${COREBASE}/scripts/git-intercept:"
> -
>  python do_devshell () {
>      if d.getVarFlag("do_devshell", "manualfakeroot"):
>         d.prependVar("DEVSHELL", "pseudo ")
> diff --git a/scripts/git-intercept/git b/scripts/git
> similarity index 100%
> rename from scripts/git-intercept/git
> rename to scripts/git
> --
> 2.32.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#164823): https://lists.openembedded.org/g/openembedded-core/message/164823
> Mute This Topic: https://lists.openembedded.org/mt/90685316/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index b54b56d6248..3515720bf95 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -367,7 +367,6 @@  addtask install after do_compile
 do_install[dirs] = "${B}"
 # Remove and re-create ${D} so that is it guaranteed to be empty
 do_install[cleandirs] = "${D}"
-PATH:prepend:task-install = "${COREBASE}/scripts/git-intercept:"
 
 base_do_install() {
 	:
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
index 75604d0c076..62dc958d9a4 100644
--- a/meta/classes/devshell.bbclass
+++ b/meta/classes/devshell.bbclass
@@ -2,8 +2,6 @@  inherit terminal
 
 DEVSHELL = "${SHELL}"
 
-PATH:prepend:task-devshell = "${COREBASE}/scripts/git-intercept:"
-
 python do_devshell () {
     if d.getVarFlag("do_devshell", "manualfakeroot"):
        d.prependVar("DEVSHELL", "pseudo ")
diff --git a/scripts/git-intercept/git b/scripts/git
similarity index 100%
rename from scripts/git-intercept/git
rename to scripts/git