Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 712904 - media-libs/mesa: limit llvm version in a slot-operator dep
Summary: media-libs/mesa: limit llvm version in a slot-operator dep
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-16 16:59 UTC by Alexander Tsoy
Modified: 2020-04-03 17:44 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 Alexander Tsoy 2020-03-16 16:59:54 UTC
There should be a version limit in a depdendency with slot-operator:

@@ -153,7 +153,7 @@
                sys-devel/llvm:9[${MULTILIB_USEDEP}]
                sys-devel/llvm:8[${MULTILIB_USEDEP}]
        )
-       sys-devel/llvm:=[${MULTILIB_USEDEP}]
+       <sys-devel/llvm-10:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}


This is even outlined in comment inside ebuild:

# How to use it:
...
# 2. Update the := to specify *max* version, e.g. < 10.


Otherwise, mesa could RDEPEND on a newer llvm slot. Steps to reproduce:

1. install sys-devel/llvm-10.0*
2. re-emerge mesa (19.3* or 20.0*)
3. uninstall sys-devel/llvm-10.0*
4.

$ sudo emerge -pc

...

Calculating dependencies... done!
 * Dependencies could not be completely resolved due to
 * the following required packages not being installed:
 * 
 *   sys-devel/llvm:10/10=[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)] pulled in by:
 *     media-libs/mesa-20.0.1-r1
 * 
 * Have you forgotten to do a complete update prior to depclean? The
 * most comprehensive command for this purpose is as follows:
 * 
 *   emerge --update --newuse --deep --with-bdeps=y @world
 * 
 * Note that the --with-bdeps=y option is not required in many
 * situations. Refer to the emerge manual page (run `man emerge`)
 * for more information about --with-bdeps.
 * 
 * Also, note that it may be necessary to manually uninstall
 * packages that no longer exist in the repository, since it may not
 * be possible to satisfy their dependencies.


/var/db/pkg/media-libs/mesa-20.0.1-r1/RDEPEND: ... || ( sys-devel/llvm:9[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)] sys-devel/llvm:8[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)] ) sys-devel/llvm:10/10=[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)]

and after the change:

/var/db/pkg/media-libs/mesa-20.0.1-r1/RDEPEND: ... || ( sys-devel/llvm:9[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)] sys-devel/llvm:8[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)] ) <sys-devel/llvm-10:9/9=[abi_x86_32(-),abi_x86_64(-),llvm_targets_AMDGPU(-)]
Comment 1 Brian Evans (RETIRED) gentoo-dev 2020-03-16 17:07:29 UTC
(In reply to Alexander Tsoy from comment #0)
> 
> Otherwise, mesa could RDEPEND on a newer llvm slot. Steps to reproduce:
> 
> 1. install sys-devel/llvm-10.0*
> 2. re-emerge mesa (19.3* or 20.0*)
> 3. uninstall sys-devel/llvm-10.0*


How did you "uninstall"? It is not normally possible.
Comment 2 Alexander Tsoy 2020-03-16 17:28:02 UTC
(In reply to Brian Evans from comment #1)
> How did you "uninstall"? It is not normally possible.
Oh, indeed. I probably did emerge -C sys-devel/llvm:10 since I was sure that nothing depends on it. :)
Comment 3 Brian Evans (RETIRED) gentoo-dev 2020-03-16 17:42:21 UTC
(In reply to Alexander Tsoy from comment #2)
> (In reply to Brian Evans from comment #1)
> > How did you "uninstall"? It is not normally possible.
> Oh, indeed. I probably did emerge -C sys-devel/llvm:10 since I was sure that
> nothing depends on it. :)

If that's the case, then this is a broken dependency tree caused by such an action and portage is recommending the way to correct it (with a full @world update).

Unless you can show a good reason to limit the version, I recommend closing as INVALID
Comment 4 Alexander Tsoy 2020-03-16 19:01:14 UTC
(In reply to Brian Evans from comment #3)
> Unless you can show a good reason to limit the version, I recommend closing
> as INVALID
mesa should not RDEPEND on unsupported llvm slot/subslot. There is also an example of how package should depend on llvm in llvm.eclass:
https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/llvm.eclass?id=d2b1544125d76c2069c8c5a53dc62dbb379bf501#n24
Comment 5 Matt Turner gentoo-dev 2020-04-01 22:48:10 UTC
mgorny, do you have an opinion on this?

@@ -153,7 +153,7 @@
                sys-devel/llvm:9[${MULTILIB_USEDEP}]
                sys-devel/llvm:8[${MULTILIB_USEDEP}]
        )
-       sys-devel/llvm:=[${MULTILIB_USEDEP}]
+       <sys-devel/llvm-10:=[${MULTILIB_USEDEP}]
 "

(presumably I would change "10" to ${LLVM_MAX_SLOT})
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-04-02 06:00:17 UTC
(In reply to Matt Turner from comment #5)
> mgorny, do you have an opinion on this?
> 
> @@ -153,7 +153,7 @@
>                 sys-devel/llvm:9[${MULTILIB_USEDEP}]
>                 sys-devel/llvm:8[${MULTILIB_USEDEP}]
>         )
> -       sys-devel/llvm:=[${MULTILIB_USEDEP}]
> +       <sys-devel/llvm-10:=[${MULTILIB_USEDEP}]
>  "

Makes sense.  I'm sorry that I didn't do it that way originally.

> 
> (presumably I would change "10" to ${LLVM_MAX_SLOT})

Way, technically it's $((LLVM_MAX_SLOT + 1)), or ${LLVM_MAX_SLOT}.9999 ;-).
Comment 7 Larry the Git Cow gentoo-dev 2020-04-03 17:44:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d9406d9e086884c61ab153771628d19f75b78e8

commit 4d9406d9e086884c61ab153771628d19f75b78e8
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2020-04-03 17:39:33 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-04-03 17:42:29 +0000

    media-libs/mesa: Explicitly limit llvm max version
    
    Closes: https://bugs.gentoo.org/712904
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/mesa-9999.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)