Any git command run during the src_install() phase will fail with: --- fatal: detected dubious ownership in repository at '/var/tmp/portage/media-gfx/blender-9999/work/blender-9999' To add an exception for this directory, call: git config --global --add safe.directory /var/tmp/portage/media-gfx/blender-9999/work/blender-9999 --- This is because the .git folder and its content is owned by the portage user while we are root during the install phase. This can be reproduced but simply unpacking a git live package and running "git log" in the working directory.
Seems like git 2.36 add this option: git config --global --add safe.directory '*' Then every directory on the system will be regarded as safe and will effectively disable this check. The "safe directory" check was added in 2.35.2 do fix a security issue: https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2 I don't think this security issue is affecting us.
Could you test the patch from the linked PR?
Seems to work fine for me. Thanks for the fix!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=207a50da440b7c6bea060972a7684e792c2a84fc commit 207a50da440b7c6bea060972a7684e792c2a84fc Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2022-11-06 07:32:48 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2022-11-07 13:25:31 +0000 git-r3.eclass: Add checkout dirs as "safe" directories Mark all checkout directories as "safe" to avoid dubious ownership errors with newer git versions when the checkout directory is accessed from src_install(). Closes: https://bugs.gentoo.org/879353 Closes: https://github.com/gentoo/gentoo/pull/28154 Signed-off-by: Michał Górny <mgorny@gentoo.org> eclass/git-r3.eclass | 5 +++++ 1 file changed, 5 insertions(+)