Created attachment 209897 [details]
llvm* package is large but mesa-dri only needs libLLVM and is stuck with obsolete version. So, let's reduce the install size via static linking.
For 12.1 amd64 example, mesa-dri 19.0.8 built against llvm90 grows from 31 MiB to 109 MiB but drops 799 MiB large llvm90 dependency.
Runtime (at least, llvmpipe) seems to be fine. Tested within a pristine jail (connected to Sway on host) e.g.,
$ pkg install firefox mesa-dri
$ LIBGL_ALWAYS_SOFTWARE=1 MOZ_ENABLE_WAYLAND=1 MOZ_WEBRENDER=1 firefox ...
Wouldn't it be better to create a libllvm package that only install libllvm ? (and maybe conflict with llvm or something like that).
For each devel/llvm* port? Until review D16457 lands packaging components separately requires slave ports.
Yes indeed this is a good candidate for subpackages that we don't have yet.
I'm not a fan of this solution but maybe there is no better way of dealing with that before subpackages land.
(In reply to Jan Beich from comment #1)
I tried your patch and Xorg and it works fine for me on 12.1-RELEASE-p1 with Intel HD Graphics 5500.
I'm very skeptical to this change. This would mean that for every change to llvm80 (in this case, but future versions as well) all mesa ports that statically link to llvm would need to be bumped as well, and keeping track of that would be problematic.
Looking upstream, the default is dynamic linking, which also means that static linking probably gets less testing, but I haven't asked around upstream.
It could be possible to create an option, defaulting it to off, for people who find the extra dependency on llvm bothersome. They would then themselves have to keep track of any bumps to llvm and recompile mesa as needed.
As I've stated before, I believe this is a bad change as this means we need to keep track of LLVM version bumps (even minor, maybe) and then bump mesa* at the same time.