You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.kind: enhancementAdd something new or improve an existing system.6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
I would love to help give NixOS full support for running wayland natively. As you may know wayland is a protocol which aims to replace the antiquated X11 protocol and replace it with something more modern. I'm putting together a list of some tasks . As always, I'm biased and don't know much so any input is greatly appreciated!
IIRC gtk3 supports wayland natively, so I presume most gtk3 apps should just work out of the box. The whole gnome3 stack should be a low-hanging fruit (because upstream supports it). The WMs you listed are packaged, only they may need some (X)wayland tweaks.
I have started working on writing NixOS modules for Wayland compositors, out of my own interest in using Wayland as a primary window environment. I have hit a snag where compositors (both weston-launch and swc-launch) will segfault, but only when running as systemd services. I've been sidetracked into trying to collect core dumps of those processes, but I suspect it has something to do with systemd sandboxing.
Right now I'm just making modules as simple systemd services, but I think it might be best to somehow incorporate Wayland sessions into the existing X11 display-manager/session configuration. It is conceivable that one might launch a Wayland compositor from an X11 display manager and vice-versa. I fear this will add a lot of multiplicity to the options, but I believe more than one person will want this during the X11 to Wayland transition period. (Personally, I will just be using auto-login, so I'm open to whatever works)
There have been a number of lesser-known compositors popping up, many of them on github. There's a good list on the Arch Wiki. I might add packages for a few of those as I test them out.
My only goal right now is boot to Wayland. It shouldn't be difficult to do, but doing it right with all of the right options exposed could be tricky.
It will tweak the build of a derivation to include debug symbols.
Also another think you should note, is that opengl needs LD_LIBRARY_PATH to be correctly set. It's done by default on user environments, don't know if it's also in systemd service variables by default.
Without strace, I figured a core dump would be my only option. It took a while to figure out, but I enabled core dump collection in systemd. I have a pull request that adds the NixOS config niceties for enabling it here: #6168
@lethalman Thanks for the debugVersion tip. I was having trouble getting symbols in my core dump before I started using that.
tl;dr: I found and patched the segfault and sent it upstream. Now that it's working, I'll try to get a NixOS config interface fleshed out that works with multiple system/session compositors.
This is awesome! NixOS is already awesome and the moment it supports Wayland well I will switch to it for my main computer. Depending on how annoyed I get at my current system I might ragequit earlier and help with the effort. I'm not at that point yet, but it's tempting.
We have XWayland marked as done, as per previous ticket. However, it's not documented how to install a version of Weston that has the optional dependency supplied. Possibly that's in some more general documentation area, but my google-fu is lacking, and this seems like it should be more straightforward than it is.
Could anyone provide guidance on how to install Weston with XWayland?
How is the integration of Wayland going? I packaged a Wayland window manager -- see SirCmpwn/sway and my nixpkgs fork for the nix expression -- and I'd like to know if someone thought of an API akin to the X11 one for Nix. I'd very much like to contribute but as it impacts a lot more than this little package I'm afraid to touch anything before getting any insight.
The problem is that you can spawn firefox from an XWayland window within a wayland session (e.g. sway) and then firefox also defaults to using XWayland. By setting the desired backend explicitly you can workaround that issue. Most distributions (AFIK fedora & ubuntu) ship a shim package for the very same purpose.
But normally setting GDK_BACKEND to wayland should already be enough and IMO, in general, we should prefer setting this by default rather than introducing additional packages for Wayland (but I haven't had a closer look at the Firefox case).
So far I have been totally unable to run firefox under wayland natively.
@NilsIrl Just remembered that I wanted to test this at some point (I'm not using Firefox by default).
While Firefox from the firefox package does indeed run with XWayland, the one from the firefox-wayland package does run natively under Wayland on my setup (I'm using Sway on nixos-unstable). Maybe it changed in the meantime?
@primeos are you running firefox-wayland on unstable as well?
Yes (nixos-unstable, it wasn't the most recent release (might be 1-2 weeks behind) but hopefully that shouldn't make a difference in this case).
Firefox never shows a window and is stuck
That seems like a bug (I though it was just using XWayland instead). Does it print something interesting to the console (when you run it from a terminal)?
stable firefox-wayland
stable xwayland
unstable sway
That's strange... Does xwayland from stable vs unstable make the difference?
Also I use sway unstable just because there's a "rendering" bug that's "fixed" (it still occur but is less painful) in it.
In case it matters (but I guess it shouldn't) I should probably mention that I was using Sway 1.2-rc2 but still with wlroots 0.6.0.
The problem is that without xwayland explicitly installed firefox-wayland will not work.
Just tested this and got the same result on my system. It doesn't crash/terminate, doesn't print any warning/error messages to the console, and also doesn't create a window (i.e. it seems to do basically nothing).
It's probably an upstream bug due to leftovers from X11. strace might help, but I don't have time to investigate this.
However, with xwayland installed it works and creates a Wayland window as expected (at least the main browser window). It might also need XWayland for something else and I also see the following warning on the console (when XWayland is installed):
invalid cast form 'GdkWaylandDisplay' to 'GdkX11Display'
@NilsIrl what's the point of it? No offence, but tbh I neither have much time for it nor am I particularly interested in investigating this any further (I use Chromium instead of Firefox and have XWayland installed -> it doesn't affect me and I cannot easily test it with my current setup).
I can note the following things though (hope this helps):
I think this discussion deserves a separate issue (we're kinda hijacking this thread)
I already noted my findings here (XWayland was required but a native Wayland window was created -> I assume it won't work with xwayland disable)
The Wayland support in Firefox is probably experimental (source):
Additionally, problems with Firefox are almost certainly Firefox bugs, not sway bugs. Start by submitting your issue to the Firefox bugzilla and come back here only after they confirm otherwise.
You can e.g. use one of the following methods to determine if a window uses Wayland or XWayland: Is an application using Xwayland? (my assumption is that the Wayland support is not complete yet and some parts still require XWayland)
0.kind: enhancementAdd something new or improve an existing system.6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Activity
vcunat commentedon Nov 21, 2014
IIRC gtk3 supports wayland natively, so I presume most gtk3 apps should just work out of the box. The whole gnome3 stack should be a low-hanging fruit (because upstream supports it). The WMs you listed are packaged, only they may need some (X)wayland tweaks.
Revert "mesa: Don't depend on Wayland"
mesa: Don't depend on Wayland
auntieNeo commentedon Feb 5, 2015
I have started working on writing NixOS modules for Wayland compositors, out of my own interest in using Wayland as a primary window environment. I have hit a snag where compositors (both weston-launch and swc-launch) will segfault, but only when running as systemd services. I've been sidetracked into trying to collect core dumps of those processes, but I suspect it has something to do with systemd sandboxing.
Right now I'm just making modules as simple systemd services, but I think it might be best to somehow incorporate Wayland sessions into the existing X11 display-manager/session configuration. It is conceivable that one might launch a Wayland compositor from an X11 display manager and vice-versa. I fear this will add a lot of multiplicity to the options, but I believe more than one person will want this during the X11 to Wayland transition period. (Personally, I will just be using auto-login, so I'm open to whatever works)
There have been a number of lesser-known compositors popping up, many of them on github. There's a good list on the Arch Wiki. I might add packages for a few of those as I test them out.
My only goal right now is boot to Wayland. It shouldn't be difficult to do, but doing it right with all of the right options exposed could be tricky.
lucabrunox commentedon Feb 5, 2015
@auntieNeo consider checking journalctl, most likely you find the reason of the crash there.
About core dumps, it may be worthwhile for you to look at this function:
nixpkgs/pkgs/misc/misc.nix
Line 114 in 8d49e87
It will tweak the build of a derivation to include debug symbols.
Also another think you should note, is that opengl needs
LD_LIBRARY_PATHto be correctly set. It's done by default on user environments, don't know if it's also in systemd service variables by default.vcunat commentedon Feb 5, 2015
Before inspecting coredumps, just using strace might be more efficient (to see what resources are accessed right before the crash).
auntieNeo commentedon Feb 5, 2015
journalctl is what told me that it was segfaulting in the first place. My second instinct was to use strace, but I quickly discovered that setuid-wrapper.c has code that prevents it from running with strace here: https://github.com/NixOS/nixos/blob/master/modules/security/setuid-wrapper.c#L46
Without strace, I figured a core dump would be my only option. It took a while to figure out, but I enabled core dump collection in systemd. I have a pull request that adds the NixOS config niceties for enabling it here: #6168
@lethalman Thanks for the debugVersion tip. I was having trouble getting symbols in my core dump before I started using that.
tl;dr: I found and patched the segfault and sent it upstream. Now that it's working, I'll try to get a NixOS config interface fleshed out that works with multiple system/session compositors.
lucabrunox commentedon Feb 6, 2015
Great @auntieNeo , will review your PR about the coredump.
trishume commentedon Feb 7, 2015
This is awesome! NixOS is already awesome and the moment it supports Wayland well I will switch to it for my main computer. Depending on how annoyed I get at my current system I might ragequit earlier and help with the effort. I'm not at that point yet, but it's tempting.
👍
MaddieM4 commentedon Feb 19, 2015
We have XWayland marked as done, as per previous ticket. However, it's not documented how to install a version of Weston that has the optional dependency supplied. Possibly that's in some more general documentation area, but my google-fu is lacking, and this seems like it should be more straightforward than it is.
Could anyone provide guidance on how to install Weston with XWayland?
vcunat commentedon Feb 19, 2015
Weston (the non-lite version) comes with XWayland support. Only it doesn't compile in current master 170775a834#commitcomment-9748711.
yacinehmito commentedon Dec 8, 2015
Bumping!
How is the integration of Wayland going? I packaged a Wayland window manager -- see SirCmpwn/sway and my nixpkgs fork for the nix expression -- and I'd like to know if someone thought of an API akin to the X11 one for Nix. I'd very much like to contribute but as it impacts a lot more than this little package I'm afraid to touch anything before getting any insight.
vcunat commentedon Dec 13, 2015
I don't understand what kind of API you mean; can you explain?
49 remaining items
primeos commentedon Jun 19, 2019
@NilsIrl from #55119 (comment):
But normally setting
GDK_BACKENDtowaylandshould already be enough and IMO, in general, we should prefer setting this by default rather than introducing additional packages for Wayland (but I haven't had a closer look at the Firefox case).NilsIrl commentedon Jun 20, 2019
@primeos So far I have been totally unable to run firefox under wayland natively. I'm pretty sure I have tried every possible combination.
firefoxandfirefox-waylandwithGDK_BACKENDandMOZ_ENABLE_WAYLANDcorrectly set.Soundtoxin commentedon Aug 22, 2019
I see xmonad crossed out. There's a project called waymonad that appears to be like xmonad for wayland. It seems very WIP, though.
primeos commentedon Aug 25, 2019
@NilsIrl Just remembered that I wanted to test this at some point (I'm not using Firefox by default).
While Firefox from the
firefoxpackage does indeed run with XWayland, the one from thefirefox-waylandpackage does run natively under Wayland on my setup (I'm using Sway on nixos-unstable). Maybe it changed in the meantime?NilsIrl commentedon Aug 25, 2019
@primeos are you running
firefox-waylandon unstable as well?NilsIrl commentedon Aug 25, 2019
I can confirm that:
firefox-waylandfirefox-waylanddo not work (firefox never shows a window and is stuck) where as
firefox-waylandxwaylandswaydoes work.
Also I use
swayunstable just because there's a "rendering" bug that's "fixed" (it still occur but is less painful) in it.primeos commentedon Aug 25, 2019
Yes (nixos-unstable, it wasn't the most recent release (might be 1-2 weeks behind) but hopefully that shouldn't make a difference in this case).
That seems like a bug (I though it was just using XWayland instead). Does it print something interesting to the console (when you run it from a terminal)?
That's strange... Does
xwaylandfrom stable vs unstable make the difference?In case it matters (but I guess it shouldn't) I should probably mention that I was using Sway 1.2-rc2 but still with wlroots 0.6.0.
NilsIrl commentedon Aug 25, 2019
The problem is that without
xwaylandexplicitly installedfirefox-waylandwill not work.primeos commentedon Aug 27, 2019
Just tested this and got the same result on my system. It doesn't crash/terminate, doesn't print any warning/error messages to the console, and also doesn't create a window (i.e. it seems to do basically nothing).
It's probably an upstream bug due to leftovers from X11. strace might help, but I don't have time to investigate this.
However, with
xwaylandinstalled it works and creates a Wayland window as expected (at least the main browser window). It might also need XWayland for something else and I also see the following warning on the console (when XWayland is installed):NilsIrl commentedon Oct 23, 2019
@primeos
Try to set the following in your
$XDG_CONFIG_HOME/sway/config:Tell me if it works
primeos commentedon Oct 23, 2019
@NilsIrl what's the point of it? No offence, but tbh I neither have much time for it nor am I particularly interested in investigating this any further (I use Chromium instead of Firefox and have XWayland installed -> it doesn't affect me and I cannot easily test it with my current setup).
I can note the following things though (hope this helps):
xwayland disable)NilsIrl commentedon Oct 23, 2019
Performance? I read somewhere that Firefox natively on Wayland was smoother. Also there is no
Xwaylandrunning in the background.zimbatm commentedon Oct 23, 2019
Wayland support is complete as far as I am concerned.
@NilsIrl can you make a separate issue to track the xwayland removal?