Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualProvidersCheck: new check for providers issues #484

Merged
merged 1 commit into from Nov 8, 2022

Conversation

arthurzam
Copy link
Member

@arthurzam arthurzam commented Oct 27, 2022

  • check for virtual package defining DEPEND or BDEPEND
  • check for virtual package with a single provider across versions
  • All of them of Warning level

The logic for the single provider is:

  1. Every version has one provider (compares full atom, for cases like when we depend on one of use flags)
  2. Collecting all unversioned unslotted RDEPENDs gives us only one match --> to which we should replace the virtual.

Closes: https://bugs.gentoo.org/744784

results over gentoo repo
virtual/acl
  VirtualWithSingleProvider: virtual package with a single provider: sys-apps/acl

virtual/blas
  VirtualWithDepend: version 3.8: virtual package with a DEPEND defined

virtual/cblas
  VirtualWithDepend: version 3.8: virtual package with a DEPEND defined

virtual/imap-c-client
  VirtualWithSingleProvider: virtual package with a single provider: net-libs/c-client

virtual/jpeg
  VirtualWithSingleProvider: virtual package with a single provider: media-libs/libjpeg-turbo

virtual/lapacke
  VirtualWithDepend: version 3.8-r1: virtual package with a DEPEND defined

virtual/lapack
  VirtualWithDepend: version 3.8: virtual package with a DEPEND defined
  VirtualWithDepend: version 3.10: virtual package with a DEPEND defined

virtual/libiconv
  VirtualWithSingleProvider: virtual package with a single provider: dev-libs/libiconv

virtual/libintl
  VirtualWithSingleProvider: virtual package with a single provider: dev-libs/libintl

virtual/linuxtv-dvb-headers
  VirtualWithSingleProvider: virtual package with a single provider: sys-kernel/linux-headers

virtual/perl6
  VirtualWithSingleProvider: virtual package with a single provider: dev-lang/rakudo

virtual/pkgconfig
  VirtualWithSingleProvider: virtual package with a single provider: dev-util/pkgconf

virtual/ruby-ssl
  VirtualWithDepend: version 11: virtual package with a DEPEND defined
  VirtualWithBdepend: version 12: virtual package with a BDEPEND defined
  VirtualWithDepend: version 12: virtual package with a DEPEND defined

virtual/rubygems
  VirtualWithBdepend: version 16: virtual package with a BDEPEND defined
  VirtualWithDepend: version 16: virtual package with a DEPEND defined
  VirtualWithBdepend: version 17: virtual package with a BDEPEND defined
  VirtualWithDepend: version 17: virtual package with a DEPEND defined

virtual/tex-base
  VirtualWithSingleProvider: virtual package with a single provider: app-text/texlive-core

  • Handle the case of virtual/libiconv and virtual/libintl

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Base: 81.11% // Head: 81.05% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (9fefb10) compared to base (f3d6180).
Patch coverage: 66.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #484      +/-   ##
==========================================
- Coverage   81.11%   81.05%   -0.07%     
==========================================
  Files          55       55              
  Lines        8063     8095      +32     
  Branches     1810     1820      +10     
==========================================
+ Hits         6540     6561      +21     
- Misses       1425     1435      +10     
- Partials       98       99       +1     
Impacted Files Coverage Δ
src/pkgcheck/checks/metadata.py 90.13% <66.66%> (-0.88%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@thesamesam
Copy link
Member

  • check for virtual package defining DEPEND or RDEPEND

You mean BDEPEND or DEPEND? ("not RDEPEND")?

@thesamesam
Copy link
Member

thesamesam commented Oct 28, 2022

These are false positives in an interesting way:

virtual/libiconv
  VirtualWithSingleProvider: virtual package with a single provider: dev-libs/libiconv

virtual/libintl
  VirtualWithSingleProvider: virtual package with a single provider: dev-libs/libintl

In libintl:

# - Don't put elibc_glibc? ( sys-libs/glibc ) to avoid circular deps between that and gcc.
RDEPEND="!elibc_glibc? ( !elibc_musl? ( dev-libs/libintl[${MULTILIB_USEDEP}] ) )"

The reason is that non-glibc & non-musl usually need an external libintl. In fact, musl needed it for a long time. This lets ebuilds be correct when they need libintl.

A real example of this is macOS, btw. Same for libiconv.

I'm not sure yet how to cleanly identify these. Maybe if the RDEPEND is "complex" (USE-conditionals) for VirtualWithSingleProvider, we should skip?

@arthurzam arthurzam force-pushed the check-virtual branch 3 times, most recently from 9774053 to df24c8e Compare October 31, 2022 18:11
@arthurzam arthurzam marked this pull request as draft October 31, 2022 18:14
- 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>
@arthurzam arthurzam marked this pull request as ready for review November 4, 2022 12:58
@arthurzam
Copy link
Member Author

I'm not sure yet how to cleanly identify these. Maybe if the RDEPEND is "complex" (USE-conditionals) for VirtualWithSingleProvider, we should skip?

Added exception check for dependence on use flags starting with elibc_ and kernel_.

Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I just wanted to check one thing (for other USE_EXPANDs), and we're all good.

@gentoo-bot gentoo-bot merged commit 9fefb10 into pkgcore:master Nov 8, 2022
@arthurzam arthurzam deleted the check-virtual branch November 8, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants