Add Wayland backed option to Linux try
Categories
(Developer Infrastructure :: Try, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: stransky, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [dev-prod-2020])
Attachments
(1 file)
3.03 KB,
patch
|
Details | Diff | Splinter Review |
Please add Wayland Linux backend to automated testing, right now we test only X11 backend. Mutter compositor can be used to run Wayland builds.
If X11 is running, run test suite under Mutter compositor as:
$mutter --wayland --nested &
if [ -z "$WAYLAND_DISPLAY" ]; then
export WAYLAND_DISPLAY=wayland-0
else
export WAYLAND_DISPLAY=wayland-1
fi
$MOZ_ENABLE_WAYLAND=1 ./mach (test, mochitest,....)
If X11 is not running, we need to use xvfb-run to launch X11 first and ten run mutter in it:
xvfb-run mutter --wayland --nested &
if [ -z "$WAYLAND_DISPLAY" ]; then
export WAYLAND_DISPLAY=wayland-0
else
export WAYLAND_DISPLAY=wayland-1
fi
$MOZ_ENABLE_WAYLAND=1 ./mach (test, mochitest,....)
Reporter | ||
Comment 1•5 years ago
|
||
Wayland specific bugs on testsuite are tracked as Bug 1578640.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 2•5 years ago
|
||
Mike, any idea how to proceed here? Would be great to have Wayland backend enabled for at least some subset of tests. The testsuite should work fine, at least from my testing on Fedora.
Thanks.
Comment 3•5 years ago
|
||
I was going to redirect to :egao, but he's on PTO until the 20th. Andrew, what do you think?
Comment 4•5 years ago
|
||
Seems like a good idea!
If all we care about is try, we could set it up behind the MOZ_ENABLE_WAYLAND
env in this script:
https://searchfox.org/mozilla-central/source/taskcluster/scripts/tester/test-linux.sh
Then you could pass in --env
via mach try
(or we could add a dedicated flag for it). Though maybe we'd want to make it a dedicated platform that runs some handful of tests as a sanity check?
Unsure of priorities here or when someone will be free to work on it. I'll add it to the backlog and mention it to :ajones at our next 1 on 1.
Comment 5•5 years ago
|
||
Forgot that script is run as part of the docker image build, so passing flags at task runtime won't work. We'll likely need official platforms here.
Reporter | ||
Comment 6•5 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #4)
Seems like a good idea!
If all we care about is try, we could set it up behind the
MOZ_ENABLE_WAYLAND
env in this script:
https://searchfox.org/mozilla-central/source/taskcluster/scripts/tester/test-linux.shThen you could pass in
--env
viamach try
(or we could add a dedicated flag for it). Though maybe we'd want to make it a dedicated platform that runs some handful of tests as a sanity check?
It also needs to run mutter compositor prior of that which provides the Wayland environment. It can be done by mutter,
see comment 0
Comment 7•5 years ago
|
||
I'm confused by what "prior to that" means. There is no "prior" to test-linux.sh
, at least as far as in-tree configuration goes.
Reporter | ||
Comment 8•5 years ago
•
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #7)
I'm confused by what "prior to that" means. There is no "prior" to
test-linux.sh
, at least as far as in-tree configuration goes.
As X11 can be run without actual display by Xvfb (https://en.wikipedia.org/wiki/Xvfb) Wayland also allows that. To run Firefox in Wayland mode you need to provide a Wayland environment for it. It can be done by the mutter compositor, which is run before firefox actually starts.
https://searchfox.org/mozilla-central/source/taskcluster/scripts/tester/test-linux.sh will need a patch to start mutter compositor when MOZ_ENABLE_WAYLAND env variable is set. It's similar to the NEED_XVFB used there.
I'll look at it.
Comment 9•5 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #8)
(In reply to Andrew Halberstadt [:ahal] from comment #7)
I'm confused by what "prior to that" means. There is no "prior" to
test-linux.sh
, at least as far as in-tree configuration goes.As X11 can be run without actual display by Xvfb (https://en.wikipedia.org/wiki/Xvfb) Wayland also allows that. To run Firefox in Wayland mode you need to provide a Wayland environment for it. It can be done by the mutter compositor, which is run before firefox actually starts.
https://searchfox.org/mozilla-central/source/taskcluster/scripts/tester/test-linux.sh will need a patch to start mutter compositor when MOZ_ENABLE_WAYLAND env variable is set. It's similar to the NEED_XVFB used there.
I'll look at it.
Got it, I think we're on the same page and I was just tripped up by some wording. Thanks, if you can provide a patch for test-linux.sh
it would be a big help. Also apparently run-task
does invoke test-linux.sh
for mozharness based tests:
https://searchfox.org/mozilla-central/source/taskcluster/taskgraph/transforms/job/mozharness_test.py#188
Which means it's not only run as part of the image build, and we can simply add a runtime flag to enable Wayland (assuming we only care about running this configuration on try).
Reporter | ||
Comment 10•5 years ago
|
||
Thanks, there's a rough patch for it.
Unfortunately I have no idea how to test it but the logic should be clear. You also need to have mutter installed and wayland libraries. I'm not sure about Ubuntu/Debian but Fedora ships:
libwayland-client-1.18.0
libwayland-server-1.18.0
libwayland-egl-1.18.0
libwayland-cursor-1.18.0
Thanks.
Reporter | ||
Comment 11•5 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #9)
Which means it's not only run as part of the image build, and we can simply add a runtime flag to enable Wayland (assuming we only care about running this configuration on try).
Yes, try is enough and you just need to set MOZ_ENABLE_WAYLAND env variable.
Thanks.
Comment 12•5 years ago
|
||
Thanks!
You can test it out by running ./mach try fuzzy --env MOZ_ENABLE_WAYLAND=1
. Would you mind submitting the above to phabricator? If passing --env
isn't ideal we could add a shortcut (though if this isn't going to be a super common use case, I might just suggest we let people pass --env
).
Comment 13•5 years ago
•
|
||
I'd like to highlight that having the Wayland backend tested by default in the CI is also something we would need soon, if possible. See e.g. https://phabricator.services.mozilla.com/D85496#2669079
We already have very few Wayland devs - using their time on fixing regressions from other peoples patches makes things unnecessary hard :/
Comment 14•5 years ago
|
||
Sure, would you mind filing a new bug under Firefox Build System :: Task Configuration
that depends on this one? Fyi the CI teams were very heavily hit by the layoffs, so expect requests to be processed slowly.
Comment 15•5 years ago
|
||
(If we're going to be creating a new configuration for wayland anyway, I vote we just leave the --env
as the only means of enabling this on try for now)
Reporter | ||
Comment 16•5 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #14)
Sure, would you mind filing a new bug under
Firefox Build System :: Task Configuration
that depends on this one? Fyi the CI teams were very heavily hit by the layoffs, so expect requests to be processed slowly.
Filed as Bug 1663159, Thanks. In order to work properly we need to have mutter installed in the environment.
Reporter | ||
Comment 17•5 years ago
|
||
Latest trunk with ./mach try fuzzy --env MOZ_ENABLE_WAYLAND=1 --env GDK_BACKEND=wayland
(we need to set GDK_BACKEND=wayland as Ubuntu 18.04 has too old Wayland implementation which is off by default).
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3a5cfe7a04a480c2f9797c08095800615f412bd0
Reporter | ||
Comment 18•5 years ago
|
||
I wonder if it's possible to add Ubuntu 20.04 to the try test pool to get latest (and perhaps only working) Wayland enabled system.
Reporter | ||
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Release managers repeatedly refuse uplifting bug fixes for Wayland because of this: bug 1672139 comment 27
This is a strange situation: Firefox' Wayland backend is apparently enabled by default on Fedora while it couldn't be enabled on Nightly yet (bug 1543600) due to missing CI (bug 1578640). IMHO it would be important to test a shipped feature.
According to bug 1648872 comment 16, Mozilla builds Wayland support on old Linux: "Debian 8 / GTK 3.14 per bug 1634204"
According to bug 1644312 comment 11, Firefox' Wayland backend needs a Mutter/Kwin version that supports wl_surface_damage_buffer to be able to actually run. Mutter supports it since 3.25.4 which would mean Debian 9 stable must be used instead of Debian 8 oldstable to test the Wayland backend. (Also, Wayland requires Mesa drivers to be used if it's not the case.)
Comment 20•5 years ago
|
||
Is the issue about building or actually running the tests? Because the test really should run on something more recent IMHO. Optimal would be something like Ubuntu 20.04 / GS 3.36 - there have been many bugs fixed on the way, in Mutter, GTK, Mesa and probably more packages :/
Waiting for Debian oldstable to catch up with that would cost us several more years I assume.
Reporter | ||
Comment 21•5 years ago
|
||
(In reply to Robert Mader [:rmader] from comment #20)
Is the issue about building or actually running the tests? Because the test really should run on something more recent IMHO. Optimal would be something like Ubuntu 20.04 / GS 3.36 - there have been many bugs fixed on the way, in Mutter, GTK, Mesa and probably more packages :/
Waiting for Debian oldstable to catch up with that would cost us several more years I assume.
Rober, a recent problem is that we can't launch Wayland session at Mozilla automation - mutter refuses to start and complains.
See https://treeherder.mozilla.org/logviewer?job_id=315960005&repo=try&lineNumber=2345
[task 2020-09-17T14:58:37.515Z] (mutter:57): mutter-WARNING **: 14:58:37.515: Can't initialize KMS backend: Could not get session ID: No such file or directory
Reporter | ||
Comment 22•5 years ago
|
||
I have some WIP patches but it's still now working.
Comment 23•5 years ago
|
||
Summoning Jonas :)
Jonas, does this ring a bell? Otherwise I'll try to have a look later.
Reporter | ||
Comment 24•5 years ago
|
||
The real deal here is to run mutter as a wayland compositor without gnome session, if that's even possible. We can set XDG dirs, set up dbus and so on, see the actual script with window manager setup:
Comment 25•5 years ago
|
||
Mutter can't run headlessly on top of the native backend right now; to be able to run automated tests (that doesn't require emulated input without) I suggest to do what mutter itself does to test Wayland clients - run the nested backend inside Xvfb. See .gitlab-ci.yml in mutter/ for how.
However, running headlessly without being drm master etc, is planned, and in-progress. With it, things like emulated input (currently via the remote desktop API, eventually via libei) will work.
Reporter | ||
Comment 26•5 years ago
|
||
Yes, I use xvfb as x11 backend, there's the latest try:
https://treeherder.mozilla.org/jobs?repo=try&revision=2f2f06668e3d1cf897cf5d5a3d1cb0b026503528
Comment 27•5 years ago
|
||
To not have mutter try to run on top of KMS, pass --nested in combination with --wayland.
Reporter | ||
Comment 28•5 years ago
|
||
Mutter seems to start in the latest try but Firefox crashes on start...needs some more investigation then:
https://treeherder.mozilla.org/logviewer?job_id=320819955&repo=try&lineNumber=2099
Reporter | ||
Comment 29•5 years ago
|
||
I see, I'm getting these errors:
[task 2020-11-05T11:58:05.265Z] Disabling glamor and dri3, EGL setup failed
[task 2020-11-05T11:58:05.265Z] Failed to initialize glamor, falling back to sw
[task 2020-11-05T11:58:05.313Z] Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
[task 2020-11-05T11:58:05.316Z] Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
[task 2020-11-05T11:58:05.316Z] Window manager error: Unable to open X display :1
[task 2020-11-05T11:58:05.320Z] (EE)
[task 2020-11-05T11:58:05.320Z] Fatal server error:
[task 2020-11-05T11:58:05.320Z] (EE) failed to read Wayland events: Connection reset by peer
[task 2020-11-05T11:58:05.320Z] (EE)
Comment 30•5 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #18)
I wonder if it's possible to add Ubuntu 20.04 to the try test pool to get latest (and perhaps only working) Wayland enabled system.
On the surface you could try modifying the image we use:
https://searchfox.org/mozilla-central/source/taskcluster/docker/ubuntu1804-test/Dockerfile#1
Changing that line should trigger image builds as dependencies of the test tasks. There will likely be further issues though and we wouldn't be able to commit to a green baseline of tests. Feel free to file a bug under Firefox Build System :: Task Configuration
anyway.
Comment 31•5 years ago
•
|
||
(In reply to Martin Stránský [:stransky] from comment #29)
I see, I'm getting these errors:
[task 2020-11-05T11:58:05.265Z] Disabling glamor and dri3, EGL setup failed
[task 2020-11-05T11:58:05.265Z] Failed to initialize glamor, falling back to sw
[task 2020-11-05T11:58:05.313Z] Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
[task 2020-11-05T11:58:05.316Z] Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
These are expected AFAIK - at least I get the same errors on my local machine without them being fatal.
[task 2020-11-05T11:58:05.316Z] Window manager error: Unable to open X display :1
Hm, is display :1 right? Just from a quick look, I'd expect it to be :0. Anyhow, this appears to be part where things fail.
Edit: is NEED_XVFB
really set?
Comment 32•5 years ago
|
||
Some things that come to mind to double check:
- Is a dbus session running?
- Do you need X11 support too? If yes, then make sure Xwayland is available, otherwise pass
--no-x11
to the mutter command next to--nested
.
Reporter | ||
Comment 33•5 years ago
|
||
I managed to run the script locally on console with some minor modifications so I'll look at it.
Reporter | ||
Comment 34•5 years ago
|
||
Hm, works fine on Fedora 32. I'm going to test that on Ubuntu 18.04 which is installed on Mozilla test boxes.
Reporter | ||
Comment 35•5 years ago
|
||
As Bug 1665844 landed we have basic Wayland support there.
Updated•3 years ago
|
Description
•