Bug 242607

Summary: graphics/mesa-dri: drop RUN_DEPENDS on devel/llvm*
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: Closed Not Accepted    
Severity: Affects Only Me CC: brooks, lme, manu, zeising
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (x11)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266007
Attachments:
Description Flags
v1 none

Description Jan Beich freebsd_committer freebsd_triage 2019-12-12 17:03:54 UTC
Created attachment 209897 [details]
v1

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.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2019-12-12 17:32:00 UTC
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 ...
Comment 2 Emmanuel Vadot freebsd_committer freebsd_triage 2019-12-12 17:55:01 UTC
Wouldn't it be better to create a libllvm package that only install libllvm ? (and maybe conflict with llvm or something like that).
Comment 3 Jan Beich freebsd_committer freebsd_triage 2019-12-12 18:05:18 UTC
For each devel/llvm* port? Until review D16457 lands packaging components separately requires slave ports.
Comment 4 Emmanuel Vadot freebsd_committer freebsd_triage 2019-12-12 18:14:36 UTC
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.
Comment 5 Lars Engels freebsd_committer freebsd_triage 2019-12-13 21:13:56 UTC
(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.
Comment 6 Niclas Zeising freebsd_committer freebsd_triage 2019-12-17 15:24:02 UTC
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.
Comment 7 Niclas Zeising freebsd_committer freebsd_triage 2020-07-11 20:07:34 UTC
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.