Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857180 - media-video/mpv-9999 with >=dev-vcs/git-2.36.0: /tmp/portage/media-video/mpv-9999/work/mpv-9999/version.py generated/version.h: fatal: unsafe repository
Summary: media-video/mpv-9999 with >=dev-vcs/git-2.36.0: /tmp/portage/media-video/mpv-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mikle Kolyada (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-09 15:37 UTC by Alex Xu (Hello71)
Modified: 2022-07-24 00:46 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Xu (Hello71) 2022-07-09 15:37:34 UTC
>>> Install media-video/mpv-9999 into /tmp/portage/media-video/mpv-9999/image
meson install -C /tmp/portage/media-video/mpv-9999/work/mpv-9999-build --destdir /tmp/portage/media-video/mpv-9999/image
ninja: Entering directory `/tmp/portage/media-video/mpv-9999/work/mpv-9999-build'
[1/4] Generating generated/version.h with a custom command
FAILED: generated/version.h
/tmp/portage/media-video/mpv-9999/work/mpv-9999/version.py generated/version.h
fatal: unsafe repository ('/tmp/portage/media-video/mpv-9999/work/mpv-9999' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /tmp/portage/media-video/mpv-9999/work/mpv-9999
[ ... ]
subprocess.CalledProcessError: Command '['/usr/bin/git', '-C', '/tmp/portage/media-video/mpv-9999/work/mpv-9999', 'describe', '--always', '--tags', '--dirty']' returned non-zero exit status 128.
ninja: build stopped: subcommand failed.
Could not rebuild /tmp/portage/media-video/mpv-9999/work/mpv-9999-build

this was apparently already broken with waf, but version.sh ignores the bad exit status:

>>> Install media-video/mpv-9999 into /tmp/portage/media-video/mpv-9999/image
"/tmp/portage/media-video/mpv-9999/work/mpv-9999/waf" --destdir="/tmp/portage/media-video/mpv-9999/image"  install
Waf: Entering directory `/tmp/portage/media-video/mpv-9999/work/mpv-9999/build'
[1/1] Compiling version.sh
fatal: unsafe repository ('/tmp/portage/media-video/mpv-9999/work/mpv-9999' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /tmp/portage/media-video/mpv-9999/work/mpv-9999
[ ... ]
[255/256] Linking build/mpv
+ install /tmp/portage/media-video/mpv-9999/image/usr/bin/mpv (from build/mpv)
Waf: Leaving directory `/tmp/portage/media-video/mpv-9999/work/mpv-9999/build'
'install' finished successfully (4.577s)

this patch fixes it:

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 7ba6501688b..8dec315c1ae 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -427,6 +427,7 @@ meson_install() {
        local mesoninstallargs=(
                -C "${BUILD_DIR}"
                --destdir "${D}"
+               --no-rebuild
                "$@"
        )

but maybe it could break some other ebuilds?
Comment 1 Mike Gilbert gentoo-dev 2022-07-09 15:57:57 UTC
I think that eclass patch probably makes sense. I'll send that for review.
Comment 2 Larry the Git Cow gentoo-dev 2022-07-24 00:46:00 UTC
The bug has been closed via the following commit(s):

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

commit 5a465ec448ea48b9dd9471e4d15b7669a77e4536
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-07-09 16:00:49 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-07-24 00:45:47 +0000

    meson.eclass: add "--no-rebuild" to meson install args
    
    This avoids rebuilding targets with no dependency information.
    
    Closes: https://bugs.gentoo.org/857180
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 1 +
 1 file changed, 1 insertion(+)