Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 744784

Summary: dev-util/pkgcheck: warn about virtuals with a single provider
Product: Gentoo Hosted Projects Reporter: Sergei Trofimovich (RETIRED) <slyfox>
Component: PkgCoreAssignee: PkgCore project <pkgcore>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=744787
https://github.com/pkgcore/pkgcheck/pull/484
Whiteboard:
Package list:
Runtime testing required: ---

Description Sergei Trofimovich (RETIRED) gentoo-dev 2020-09-26 11:18:45 UTC
Popped up today on #gentoo-dev-help for virtual/ffmpeg:

$ cat ffmpeg-9-r2.ebuild
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="Virtual package for FFmpeg executable implementation"

# Please note that this virtual is only suited for packages that call
# ffmpeg/avconv or one of the remaining executables. If your package
# links to one of the libraries, you need to use the following
# dependency instead (adding IUSE=libav):
#       libav? ( media-video/libav:0= )
#       !libav? ( media-video/ffmpeg:0= )

SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
IUSE="X +encode gsm jpeg2k mp3 opus sdl speex theora threads truetype vaapi vdpau x264"

RDEPEND="
        >=media-video/ffmpeg-1.2.6-r1:0[X?,encode?,gsm?,jpeg2k?,mp3?,opus?,sdl?,speex?,theora?,threads?,truetype?,vaapi?,vdpau?,x264?]
"

I suggest adding a check to repoman to:
- warn about redundant virtual if it has only one provider
- suggest adding a package to package.deprecated if it's not there yet

That way users will see a warning and will gradually move away from the virtual.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:18 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-06 22:49:21 UTC
If we do this, we should check that all versions of the package have a single provider instead, I think, to avoid issues where we might have subslotted virtuals? dunno
Comment 3 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-10-27 19:11:10 UTC
PR opened for pkgcheck
Comment 4 Larry the Git Cow gentoo-dev 2022-11-08 18:59:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=9fefb10f2b5ca6dc3e595e1d318956252f396ed0

commit 9fefb10f2b5ca6dc3e595e1d318956252f396ed0
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2022-10-27 19:07:12 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2022-11-04 12:57:44 +0000

    VirtualProvidersCheck: new check for providers issues
    
    - check for virtual package defining DEPEND or BDEPEND
    - check for virtual package with a single provider across versions
    
    Closes: https://bugs.gentoo.org/744784
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 src/pkgcheck/checks/metadata.py                    | 80 +++++++++++++++++++++-
 .../VirtualWithBdepend/expected.json               |  2 +
 .../VirtualWithDepend/expected.json                |  2 +
 .../VirtualWithSingleProvider/expected.json        |  1 +
 testdata/repos/standalone/profiles/desc/elibc.desc |  1 +
 .../repos/standalone/profiles/package.deprecated   |  1 +
 .../VirtualWithBdepend/VirtualWithBdepend-0.ebuild |  6 ++
 .../VirtualWithBdepend/VirtualWithBdepend-1.ebuild | 11 +++
 .../VirtualWithDepend/VirtualWithDepend-0.ebuild   |  6 ++
 .../VirtualWithDepend/VirtualWithDepend-1.ebuild   | 11 +++
 .../VirtualWithSingleProvider1-0.ebuild            | 10 +++
 .../VirtualWithSingleProvider2-0.ebuild            | 10 +++
 .../VirtualWithSingleProvider3-0.ebuild            |  8 +++
 .../VirtualWithSingleProvider3-1.ebuild            |  8 +++
 .../VirtualWithSingleProvider4-0.ebuild            |  8 +++
 .../VirtualWithSingleProvider4-1.ebuild            |  8 +++
 .../VirtualWithSingleProvider5-0.ebuild            |  8 +++
 .../VirtualWithSingleProvider6-0.ebuild            |  9 +++
 18 files changed, 189 insertions(+), 1 deletion(-)