Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 829691 - sys-apps/portage: soname dependency resolution does not distinguish bundled libraries from real providers (libOpenCL.so.1 should not be provided by nvidia-cuda-toolkit)
Summary: sys-apps/portage: soname dependency resolution does not distinguish bundled l...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 694246
  Show dependency tree
 
Reported: 2021-12-20 01:20 UTC by Zac Medico
Modified: 2021-12-20 02:26 UTC (History)
2 users (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 Zac Medico gentoo-dev 2021-12-20 01:20:06 UTC
(In reply to Ionen Wolkens from bug 829623 comment #4)
> Personally ran into the following when I wanted to depclean
> nvidia-cuda-toolkit
> 
> $ emerge -pvc nvidia-cuda-toolkit
> Calculating dependencies... done!
>   dev-util/nvidia-cuda-toolkit-11.5.1-r1 pulled in by:
>     app-emulation/wine-staging-6.23 requires x86_64: libOpenCL.so.1
>     dev-util/clinfo-3.0.21.02.21 requires x86_64: libOpenCL.so.1
>     media-video/ffmpeg-4.4.1-r1 requires x86_64: libOpenCL.so.1
> 
> libOpenCL is used from opencl-icd-loader, not nvidia-cuda-toolkit which just
> happens to have the same library in /opt
> 
> $ emerge -pvc --ignore-soname-deps=y nvidia-cuda-toolkit
> Calculating dependencies... done!
> >>> Calculating removal order...
> 
> >>> These are the packages that would be unmerged:
> 
>  dev-util/nvidia-cuda-toolkit
>     selected: 11.5.1-r1 
>    protected: none 
>      omitted: none
Comment 1 Ionen Wolkens gentoo-dev 2021-12-20 01:51:00 UTC
To distinguish this in iwdevtools' qa-vdb[1] (used to check missing dependencies by analyzing /var/db/pkg among other things), I've limited to libraries found through /etc/ld.so.conf paths to allow it to give the mostly-right suggestions, i.e. if linking against libOpenCL it'll say to add opencl-icd-loader rather than nvidia-cuda-toolkit

Although being 100% correct and have it fit all setups may be difficult (may also have rpath using a different library with the same name and such)

[1] https://github.com/ionenwks/iwdevtools#qa-vdb
Comment 2 Ionen Wolkens gentoo-dev 2021-12-20 02:26:48 UTC
(In reply to Ionen Wolkens from comment #1)
> also have rpath using a different library with the same name and such
i.e. could imagine a scenario where path was gotten from pkg-config or something, and it's actually using libOpenCL provided by nvidia-cuda-toolkit and opencl-icd-loader could be depcleaned if nothing else uses it.