Bug 227509 - graphics/mesa-{dri,libs}: enable WAYLAND by default
Summary: graphics/mesa-{dri,libs}: enable WAYLAND by default
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jan Beich
URL:
Keywords: needs-qa
Depends on: 223018 227423 232323 232729 233220
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-14 08:55 UTC by Tobias C. Berner
Modified: 2018-12-14 10:34 UTC (History)
14 users (show)

See Also:
zeising: maintainer-feedback+
jbeich: exp-run?


Attachments
add WAYLAND to OPTIONS_DEFAULT (551 bytes, patch)
2018-04-14 08:55 UTC, Tobias C. Berner
no flags Details | Diff
v0 (5.34 KB, patch)
2018-10-15 20:13 UTC, Jan Beich
no flags Details | Diff
v1 (8.26 KB, patch)
2018-10-20 21:54 UTC, Jan Beich
jbeich: maintainer-approval+
Details | Diff
v1 (8.34 KB, patch)
2018-10-20 22:43 UTC, Jan Beich
no flags Details | Diff
v1.1 (9.68 KB, patch)
2018-10-28 04:25 UTC, Jan Beich
no flags Details | Diff
v1.2 (10.49 KB, patch)
2018-11-04 09:25 UTC, Jan Beich
no flags Details | Diff
v1.2 (10.44 KB, patch)
2018-11-06 14:10 UTC, Jan Beich
zeising: maintainer-approval+
jbeich: maintainer-approval? (multimedia)
jbeich: maintainer-approval? (gnome)
jbeich: maintainer-approval? (cpm)
jbeich: maintainer-approval? (amdmi3)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias C. Berner freebsd_committer freebsd_triage 2018-04-14 08:55:51 UTC
Created attachment 192508 [details]
add WAYLAND to OPTIONS_DEFAULT

Hi there

kde@ would like (read "needs") the wayland parts of mesa-libs to be able to import the Plasma 5 desktop into FreeBSD (even for the X11 based session).

Otherwise it will be impossible to provide official binary packages, as libEGL-parts are missing in the standard  mesa-libs package.


I'd would be great if this could be changed :) 



mfg Tobias
Comment 1 Val Packett 2018-04-14 10:42:14 UTC
Hi, I support this change very much, but also please look at bug 227423. libwayland-egl lives in the official libwayland distribution since 1.15! The patch I posted there enables qt5-wayland to be built by default.
Comment 2 Niclas Zeising freebsd_committer freebsd_triage 2018-04-14 11:46:29 UTC
This needs more thought, since I don't want to add wayland dependencies by default to mesa.  One idea is to separate out the wayland bits of mesa into a separate port.  I haven't looked at the details right now though.
We also have to ensure that we don't break platforms without llvm, since wayland requires llvm, at least according to comments in the makefile.

This needs further discussion.
Comment 3 Val Packett 2018-04-14 12:34:52 UTC
(In reply to Niclas Zeising from comment #2)

Gallium (required for EGL) depends on LLVM, not Wayland.

This is handled in the current port correctly. Please read it carefully:

https://github.com/freebsd/freebsd-ports/blob/d334f82120c2749ac67a9df2c3d8d8f354ac5447/graphics/mesa-libs/Makefile#L26-L40

EGL *is* already enabled by default on platforms with LLVM. Adding Wayland support to EGL/DRI2 wouldn't mess with anything else.

graphics/wayland is a small dependency, 1mb on amd64, and pretty much all the desktop things depend on it.

You can't "separate out the wayland bits". libgbm is linked to libwayland-server, libEGL to both -server and -client. You could make a nowayland flavor for people hell bent on saving one megabyte of disk space :)
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-16 13:58:15 UTC
Sorry, I had my wires crossed a bit. In fact we should be able to build the X11 part of Plasma5 without this change.

But I none the less think, that this change is very non-invasive and does more good than bad :)
Comment 5 Denis Polygalov 2018-07-01 17:29:27 UTC
(In reply to Greg V from comment #3)

Hi Greg,
related to Niclas Zeising's idea to "separate wayland bits from mesa-libs".

To my knowledge currently it is impossible to install/use 
anything Wayland-related without Xorg installed because 
mesa-libs pulls a lot of Xorg-related stuff as dependencies.

So this is not only about saving few megabytes on a disk but also
about removing garb... eh.. dark legacy (Xorg) from system...
Do you think it is the right way to keep Wayland(compositor part) 
tightly tied to libX11/Xorg?

Maybe it is somehow possible to make a noXorg flavor 
for people hell bent on getting rid of Xorg? :)

Regards,
Denis
Comment 6 Val Packett 2018-07-01 22:13:10 UTC
(In reply to Denis Polygalov from comment #5)
Oh yeah, that should definitely be possible.

With the Meson build system (see https://github.com/myfreeweb/freebsd-ports-dank/blob/master/graphics/mesa-dev/Makefile for an alternative mesa port using it), you should be able to pass -Dplatforms=wayland,drm,surfaceless -Dglx=disabled and get an X-free build. Of course something similar is possible with the old configure script.

So it shouldn't be too hard to have port options for X11 and WAYLAND and default|nox11|nowayland flavors that set these options.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2018-10-15 19:09:11 UTC
Bug 227423 will tackle libwayland-egl issue. WAYLAND=on is still required for other things (Vulkan, libEGL). So, let's change the default to facilitate testing/maintenance.

https://lists.freebsd.org/pipermail/freebsd-x11/2017-December/020288.html

(In reply to Niclas Zeising from comment #2)
> This needs more thought, since I don't want to add wayland dependencies by default to mesa.

What benefit do you expect from neglecting Wayland support? X11 isn't going away but in future more Wayland-only apps may appear.

> One idea is to separate out the wayland bits of mesa into a separate port.
> I haven't looked at the details right now though.

Let's not undo bug 218799. Splitting ports adds to maintenance cost and introduces intradependencies (i.e., dependencies in-between parts, including loops). Moving into a flavor won't work until the ports framework supports package alternatives aka variable dependencies, so direct and indirect consumers don't add up in a conflict between flavored and unflavored dependency.

> We also have to ensure that we don't break platforms without llvm,
> since wayland requires llvm, at least according to comments in the
> makefile.

Not Wayland but libEGL. Affects only sparc64. Is it that hard to add OPTIONS_EXCLUDE_sparc64=WAYLAND ?
Comment 8 Jan Beich freebsd_committer freebsd_triage 2018-10-15 20:13:42 UTC
Created attachment 198188 [details]
v0
Comment 9 Tobias Kortkamp freebsd_committer freebsd_triage 2018-10-15 20:40:48 UTC
Comment on attachment 198188 [details]
v0

Backend choice is not dynamic in glfw at the moment and enabling
WAYLAND by default would disable Xorg support.  Probably best
to leave it off by default for now there.
Comment 10 Val Packett 2018-10-16 09:57:48 UTC
(In reply to Tobias Kortkamp from comment #9)
Yeah might be a good idea to flavorize glfw until they land https://github.com/glfw/glfw/pull/1338
Comment 11 Jan Beich freebsd_committer freebsd_triage 2018-10-20 21:54:12 UTC
Created attachment 198417 [details]
v1

Does this look reasonable? A minor inconvenience to ensure Wayland build never regresses. X11 runtime should be unaffacted (tested mpv/vaapi and firefox). If something goes wrong some or all parts can be reverted. There's plenty of time before the next /quarterly is branched.

I'm counting towards maintainer timeout. Review/comments are welcome from anyone. No cookie licking, please.
Comment 12 Jan Beich freebsd_committer freebsd_triage 2018-10-20 21:54:53 UTC
Comment on attachment 198417 [details]
v1

gecko@ would prefer gnome@ enable WAYLAND in x11-toolkits/gtk30 but, otherwise, prepared to create and maintain a slave port.
Comment 13 Jan Beich freebsd_committer freebsd_triage 2018-10-20 21:56:26 UTC
Off to portmgr@ to check for unexpected bustage in case Wayland support is auto-enabled in consumers.
Comment 14 Guido Falsi freebsd_committer freebsd_triage 2018-10-20 22:22:53 UTC
I have no objection and so approve, regarding the ports I maintain.

I have never used wayland though and never tested the WAYLAND options at runtime, though.
Comment 15 Tobias Kortkamp freebsd_committer freebsd_triage 2018-10-20 22:26:32 UTC
Comment on attachment 198417 [details]
v1

--- a/graphics/mesa-dri/Makefile
+++ b/graphics/mesa-dri/Makefile
[...]
@@ -12,6 +12,7 @@ USE_XORG=	xorgproto x11 xdamage xext xfixes xshmfence xv xvmc
 
 OPTIONS_DEFINE=	TEXTURE VAAPI VDPAU WAYLAND
 OPTIONS_DEFAULT=TEXTURE
+OPTIONS_DEFAULT=WAYLAND

This doesn't look right.
Comment 16 Jan Beich freebsd_committer freebsd_triage 2018-10-20 22:43:32 UTC
Created attachment 198419 [details]
v1

(In reply to Tobias Kortkamp from comment #15)
Mismerge: TEXTURE is gone in bug 230298. Thanks for catching!
Comment 17 Jan Beich freebsd_committer freebsd_triage 2018-10-28 04:25:59 UTC
Created attachment 198710 [details]
v1.1

- Enable Wayland for sdl20 consumers (e.g., ppsspp)
- Rebase bumps after ports r482830, ports r482993
Comment 18 Jan Beich freebsd_committer freebsd_triage 2018-10-29 12:39:05 UTC
portmgr@, are you planning to wait for timeout (in case of disapproval) before exp-run? I'd like to start fixing consumers in advance (of maintainer timeouts and bug 232729 testing). Ignore FreeBSD 10.* due to EOL, lack of evdev(4) and _EXCLUDE=WAYLAND in some ports.

After a week of dogfooding this and a few other Mesa patches in X11 environment and all my poudriere jails while landing unrelated stuff (e.g., bug 232525) I didn't notice any regressions. x11@ is silent about what else is missing. It's kinda boring. ;)
Comment 19 Niclas Zeising freebsd_committer freebsd_triage 2018-10-31 20:16:37 UTC
I would like to discuss this with the rest of the graphics team.  We have our next VC meeting next week, and I hope this can remain until then, especially since there has not been an exp-run done yet.
Comment 20 Jan Beich freebsd_committer freebsd_triage 2018-11-01 11:40:38 UTC
(In reply to Niclas Zeising from comment #19)
Previous discussion happened in https://lists.freebsd.org/pipermail/freebsd-x11/2017-December/020288.html After that johalun outlined plan of action in https://lists.freebsd.org/pipermail/freebsd-x11/2018-January/020410.html seeking amendments, assuming a decision has been reached. kde@ and gnome@ completed their own items. I've landed mesa-dri/sdl20 patches and handled sparc64. In bug 232767 johalun confirmed compositors are outside of scope at this stage. Everything looks OK but the full picture won't be known until this lands.

Anyway, set a deadline for reaching a (new) decision. Not something ambiguous like "next week" just for (another) discussion.
Comment 21 Warner Losh freebsd_committer freebsd_triage 2018-11-01 20:53:09 UTC
The plan for the plan has always been to reach a decision at our next conference call.
Comment 22 Warner Losh freebsd_committer freebsd_triage 2018-11-01 20:54:13 UTC
(In reply to Warner Losh from comment #21)
at least as far as the base drm / video drivers is concerned.
Comment 23 Jan Beich freebsd_committer freebsd_triage 2018-11-04 09:25:15 UTC
Created attachment 198928 [details]
v1.2

- Add graphics/gstreamer1-plugins-gl
- Revert to RUN_DEPENDS in ppsspp as sdl20 now pulls Wayland
- Rebase after ports r483514, ports r483567, ports r483650, ports r483807
Comment 24 Jan Beich freebsd_committer freebsd_triage 2018-11-06 14:10:50 UTC
Created attachment 199012 [details]
v1.2

- Rebase after ports r484273
- Don't bump PORTEPOCH in vlc3 ;)

Sorry for the noise. I didn't realize there would be so much (mostly rebase) churn in order to pick phabricator for review.
Comment 25 Niclas Zeising freebsd_committer freebsd_triage 2018-11-08 19:01:27 UTC
Comment on attachment 199012 [details]
v1.2

Approve by the graphics team.
Comment 27 Antoine Brodin freebsd_committer freebsd_triage 2018-11-11 19:43:01 UTC
(In reply to Antoine Brodin from comment #26)
gnucash may be false positive
Comment 28 commit-hook freebsd_committer freebsd_triage 2018-11-11 23:23:34 UTC
A commit references this bug:

Author: jbeich
Date: Sun Nov 11 23:23:12 UTC 2018
New revision: 484785
URL: https://svnweb.freebsd.org/changeset/ports/484785

Log:
  graphics/waffle: track graphics/wayland dependency

  ====> Running Q/A tests (stage-qa)
  Error: /usr/local/lib/libwaffle-1.so.0.5.2 is linked to /usr/local/lib/libwayland-client.so.0 from graphics/wayland but it is not declared as a dependency
  Warning: you need LIB_DEPENDS+=libwayland-client.so:graphics/wayland
  Error: /usr/local/lib/libwaffle-1.so.0.5.2 is linked to /usr/local/lib/libwayland-egl.so.1 from graphics/wayland but it is not declared as a dependency
  Warning: you need LIB_DEPENDS+=libwayland-egl.so:graphics/wayland

  PR:		227509
  Reported by:	antoine (via exp-run)

Changes:
  head/graphics/waffle/Makefile
Comment 29 commit-hook freebsd_committer freebsd_triage 2018-11-11 23:23:38 UTC
A commit references this bug:

Author: jbeich
Date: Sun Nov 11 23:23:27 UTC 2018
New revision: 484786
URL: https://svnweb.freebsd.org/changeset/ports/484786

Log:
  graphics/piglit: track graphics/wayland dependency

  CMake Error at CMakeLists.txt:162 (message):
    Wayland support requires xkbcommon.  Failed to find xkbcommon library.

  PR:		227509
  Reported by:	antoine (via exp-run)

Changes:
  head/graphics/piglit/Makefile
Comment 30 commit-hook freebsd_committer freebsd_triage 2018-11-11 23:24:43 UTC
A commit references this bug:

Author: jbeich
Date: Sun Nov 11 23:23:41 UTC 2018
New revision: 484787
URL: https://svnweb.freebsd.org/changeset/ports/484787

Log:
  deskutils/cairo-dock: track more dependencies

  ====> Running Q/A tests (stage-qa)
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libdbus-1.so.3 from devel/dbus but it is not declared as a dependency
  Warning: you need LIB_DEPENDS+=libdbus-1.so:devel/dbus
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libGLU.so.1 from graphics/libGLU but it is not declared as a dependency
  Warning: you need USE_GL+=glu
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libGL.so.1 from graphics/mesa-libs but it is not declared as a dependency
  Warning: you need USE_GL+=gl
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libwayland-client.so.0 from graphics/wayland but it is not declared as a dependency
  Warning: you need LIB_DEPENDS+=libwayland-client.so:graphics/wayland
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libXcomposite.so.1 from x11/libXcomposite but it is not declared as a dependency
  Warning: you need USE_XORG+=xcomposite
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libXrandr.so.2 from x11/libXrandr but it is not declared as a dependency
  Warning: you need USE_XORG+=xrandr
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libX11.so.6 from x11/libX11 but it is not declared as a dependency
  Warning: you need USE_XORG+=x11
  Error: /usr/local/bin/cairo-dock is linked to /usr/local/lib/libXinerama.so.1 from x11/libXinerama but it is not declared as a dependency
  Warning: you need USE_XORG+=xinerama

  PR:		227509
  Reported by:	antoine (via exp-run)

Changes:
  head/deskutils/cairo-dock/Makefile
Comment 31 Jan Beich freebsd_committer freebsd_triage 2018-11-11 23:29:02 UTC
(In reply to Antoine Brodin from comment #26)
> http://package23.nyi.freebsd.org/data/112i386-default-PR227509/2018-11-09_09h20m18s/logs/errors/piglit-20180910.log

Fixed along with its dependency.

graphics/piglit + WAYLAND=OFF: https://ptpb.pw/OKea
graphics/piglit + WAYLAND=ON:  https://ptpb.pw/n8MA

> http://package23.nyi.freebsd.org/data/112i386-default-PR227509/2018-11-09_09h20m18s/logs/errors/gnucash-3.3_1.log

"Segmentation fault" maybe transient. It builds fine on 11.2 i386 here.
Comment 32 commit-hook freebsd_committer freebsd_triage 2018-11-11 23:55:08 UTC
A commit references this bug:

Author: jbeich
Date: Sun Nov 11 23:54:11 UTC 2018
New revision: 484788
URL: https://svnweb.freebsd.org/changeset/ports/484788

Log:
  graphics/mesa-libs: enable WAYLAND by default here and in consumers

  PR:		227509
  Requested by:	Johannes Lundberg, Greg V
  Reviewed by:	tobik (earlier version)
  Approved by:	madpilot, x11 (zeising), maintainer timeout (2 weeks)
  Exp-run by:	antoine

Changes:
  head/UPDATING
  head/deskutils/cairo-dock/Makefile
  head/devel/sdl20/Makefile
  head/emulators/ppsspp/Makefile
  head/graphics/gstreamer1-plugins-gl/Makefile
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-libs/Makefile
  head/graphics/piglit/Makefile
  head/graphics/waffle/Makefile
  head/mail/thunderbird/Makefile
  head/multimedia/libva/Makefile
  head/multimedia/libva-utils/Makefile
  head/multimedia/mpv/Makefile
  head/multimedia/vlc3/Makefile
  head/sysutils/gnome-control-center/Makefile
  head/www/firefox/Makefile
  head/www/firefox/Makefile.options
  head/www/firefox-esr/Makefile
  head/www/webkit2-gtk3/Makefile
  head/x11-toolkits/gtk30/Makefile
Comment 33 Jan Beich freebsd_committer freebsd_triage 2018-11-11 23:55:48 UTC
Leaving open for 1 week to collect pointy hats.
Comment 34 Walter Schwarzenfeld freebsd_triage 2018-11-15 07:56:31 UTC
WAYLAND=on causes problems with Firefox (a opening window problem) reported on irc freebsd (PR should/will follow).
Comment 35 Jan Beich freebsd_committer freebsd_triage 2018-12-14 10:34:36 UTC
(In reply to w.schwarzenfeld from comment #34)
That was never properly reported. Upstream also enabled Wayland *build* since Firefox 65.
https://bugzilla.mozilla.org/show_bug.cgi?id=1501218