Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 957542 - dev-vcs/git: with USE=tk installs files to / on first emerge
Summary: dev-vcs/git: with USE=tk installs files to / on first emerge
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal QA
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-08 00:11 UTC by hlgl2
Modified: 2025-06-08 01:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build logs from first and second emerge (build logs.zip,49.49 KB, application/zip)
2025-06-08 00:11 UTC, hlgl2
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hlgl2 2025-06-08 00:11:22 UTC
Created attachment 931806 [details]
build logs from first and second emerge

I noticed files get installed to / when emerging dev-vcs/git with USE=tk on a fresh stage3.
Only happens when git is installed for the first time with version 2.48.1 and later.
Version 2.45.3 seems fine.
After emerging for a second time  the files get installed to their correct place in /usr/libexec/git-core

Here are the steps to reproduce this:

# 1. extract amd64 stage3 and setup chroot (tested with stage3-amd64-systemd-20250601T163943Z.tar.xz)

# 2. setup dns and gentoo repo
echo "nameserver 10.0.1.1" > /etc/resolv.conf
mkdir /etc/portage/repos.conf
sed 's|^sync-type = rsync$|sync-type = webrsync|g' /usr/share/portage/config/repos.conf > /etc/portage/repos.conf/gentoo.conf
emaint sync -r gentoo

# 3. emerge dev-vcs/git for the first time (with USE=tk)
USE="tk" MAKEOPTS="-j$(nproc)" emerge -a dev-vcs/git

# 4. notice that git-citool, git-gui and git-gui--askpass are in /

# 5. emerge dev-vcs/git again using the same command
USE="tk" MAKEOPTS="-j$(nproc)" emerge -a dev-vcs/git

# 6. notice that the files are gone from /, as they should be


If you unmerge git after step 6 and continue at step 3, it happens again.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 00:14:29 UTC
In git-gui/Makefile:
```
ifndef gitexecdir
	gitexecdir := $(shell git --exec-path)
endif

ifndef sharedir
ifeq (git-core,$(notdir $(gitexecdir)))
	sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share
else
	sharedir := $(dir $(gitexecdir))share
endif
endif
```

Fortunately, master has ported git-gui to meson as well.
Comment 2 Larry the Git Cow gentoo-dev 2025-06-08 00:31:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04893125ccb6e4125982e7d5ec17616b602d8151

commit 04893125ccb6e4125982e7d5ec17616b602d8151
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-06-08 00:30:29 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-06-08 00:30:29 +0000

    dev-vcs/git: fix USE=tk installation when git is not already installed
    
    git-gui/Makefile invokes git to determine gitexecdir if unset. Fortunately,
    for master, git-gui uses meson, so will switch that in a followup commit.
    
    Closes: https://bugs.gentoo.org/957542
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-vcs/git/{git-2.48.1.ebuild => git-2.48.1-r1.ebuild}    | 4 ++--
 dev-vcs/git/{git-2.49.0-r2.ebuild => git-2.49.0-r3.ebuild} | 4 ++--
 dev-vcs/git/git-9999-r1.ebuild                             | 5 ++---
 dev-vcs/git/git-9999-r2.ebuild                             | 4 ++--
 dev-vcs/git/git-9999-r3.ebuild                             | 4 ++--
 dev-vcs/git/git-9999.ebuild                                | 4 ++--
 6 files changed, 12 insertions(+), 13 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2025-06-08 01:40:08 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4c81b8ad8b339a9dceff7500b4e461405297c66

commit e4c81b8ad8b339a9dceff7500b4e461405297c66
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-06-08 01:32:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-06-08 01:32:18 +0000

    dev-vcs/git: switch more USE=tk to meson
    
    Bug: https://bugs.gentoo.org/957542
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-vcs/git/git-9999-r1.ebuild | 48 +++++++++++++++++++++++-------------------
 dev-vcs/git/git-9999-r2.ebuild | 46 ++++++++++++++++++++++------------------
 dev-vcs/git/git-9999-r3.ebuild | 46 ++++++++++++++++++++++------------------
 3 files changed, 76 insertions(+), 64 deletions(-)