Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 911249 - media-video/ffmpeg[amf] installs misnamed and therefore unused env.d file
Summary: media-video/ffmpeg[amf] installs misnamed and therefore unused env.d file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-07-26 09:11 UTC by Karl-Johan Karlsson
Modified: 2023-07-27 09:39 UTC (History)
0 users

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 Karl-Johan Karlsson 2023-07-26 09:11:30 UTC
media-video/ffmpeg, versions 4.4.4-r2 and above, have the following line in multilib_src_install_all:

   use amf && doenvd "${FILESDIR}"/amf-env-vulkan-override

This installs a file in env.d which sets an environment variable to select the AMD Pro Vulkan ICD:

   VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_pro_icd64.json

However, even after running env-update manually, that variable is not set.

This seems to be because the Portage code that runs in env-update requires that file names start with digits:

https://github.com/gentoo/portage/blob/41094c785115e45cc456028f1b9e914160e0d392/lib/portage/util/env_update.py#L111

    for x in fns:
        if len(x) < 3:
            continue
        if not x[0].isdigit() or not x[1].isdigit():
            continue
        if x.startswith(".") or x.endswith("~") or x.endswith(".bak"):
            continue
        templist.append(x)
    fns = templist

After renaming the file from /etc/env.d/amf-env-vulkan-override to /etc/env.d/99amf-env-vulkan-override and running env-update again the variable is now set in new shells.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-26 09:13:59 UTC
Fancy doing a PR to fix it?
Comment 2 Karl-Johan Karlsson 2023-07-26 10:22:34 UTC
PR sent: https://github.com/gentoo/gentoo/pull/32050

I'm not sure how to handle 6.0-r2. I can't revbump it since 6.0-r3 already exists, and it seems like it's kept there in order to allow downgrades in case 6.0-r4 doesn't work. I left it as-is and revbumped the others, with a solution that is not optimal but allowed 6.0-r2 to still work.
Comment 3 Larry the Git Cow gentoo-dev 2023-07-27 09:39:37 UTC
The bug has been closed via the following commit(s):

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

commit 48e25a7bc7d7206f69b863622abcdf83bbdbee25
Author:     Karl-Johan Karlsson <creideiki@ferretporn.se>
AuthorDate: 2023-07-26 10:01:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-27 09:38:44 +0000

    media-video/ffmpeg: Rename AMF env.d file, and revbump
    
    Leading digits are required for env-update to consider the file.
    
    This commit leaves the file in the repository as is and uses "newenvd"
    to install it under a different name. This makes sure that the 6.0-r2
    ebuild continues to work. If that is not required, a simpler solution
    would be to instead rename the file in the repository to
    99amf-env-vulkan-override and keep using "doenvd".
    
    Closes: https://bugs.gentoo.org/911249
    
    Signed-off-by: Karl-Johan Karlsson <creideiki@lysator.liu.se>
    Closes: https://github.com/gentoo/gentoo/pull/32050
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/ffmpeg/{ffmpeg-4.4.4-r2.ebuild => ffmpeg-4.4.4-r3.ebuild} | 2 +-
 media-video/ffmpeg/{ffmpeg-5.1.3-r2.ebuild => ffmpeg-5.1.3-r3.ebuild} | 2 +-
 media-video/ffmpeg/{ffmpeg-6.0-r4.ebuild => ffmpeg-6.0-r5.ebuild}     | 2 +-
 media-video/ffmpeg/ffmpeg-9999.ebuild                                 | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)