Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma5: Use upstream xsession/wayland-session files #56988

Closed
wants to merge 3 commits into from

Conversation

@bkchr
Copy link
Contributor

@bkchr bkchr commented Mar 6, 2019

This also enables Wayland for plasma5.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Mar 7, 2019

pinging #53843 because it will change that options name.

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Mar 7, 2019

I think the commit msg should start like nixos/plasma5

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Mar 7, 2019

Testing in a vm shortly

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Mar 7, 2019

@bkchr I think it would be a good idea to possibly add a test for the wayland session?

Current test is broken because the session is now called plasma,
so we need to unset

services.xserver.desktopManager.default = "plasma5";

there.

And it seems that using sddm's autologin fails if we try to set the default session to plasma

- SDDM auto-login requires that services.xserver.desktopManager.default and
services.xserver.windowManager.default are set to valid values. The current
default session: plasma is not valid.

Not sure if the assertion is right there.

@bkchr
Copy link
Contributor Author

@bkchr bkchr commented Mar 7, 2019

Hmm okay :( I will take a look.

@matklad
Copy link
Member

@matklad matklad commented Mar 10, 2019

Did a quick test today by applying the patch on top of 19.03.

Launching wayland session explicitly works (in fact, writing this comment from withing wayland session), but the default seession in SDDM becomes xterm, so you have to choose plasma explicitly.

@hedning
Copy link
Contributor

@hedning hedning commented Mar 12, 2019

Not sure if the assertion is right there.

Right autologin with an upstream session doesn't work in sddm and lightdm at the moment. I left these asserts when doing #44497. I reasoned that the assert was in place to avoid getting stuck in a bad auto login (the upstream sessions isn't available at eval time).

That's fixed in #53843, though it's a bit messy, partly due to the windowManager/desktopManager split which sessionPackages doesn't have. Though I think I've come up with a solution that would rework desktopManager.default so it could be used to pick sessions from sessionPackages instead of introducing a new displayManager.defaultSession option. That might be preferable.

@Infinisil
Copy link
Member

@Infinisil Infinisil commented Mar 28, 2019

As far as I can see, the only thing left to do is rename the commit to start with "nixos/plasma5". Anything else?

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Mar 28, 2019

@Infinisil It works but there's the breakages with upstream sessions noted by @hedning, @matklad, and I.

I don't really think it's a good idea to just leave autologin broken so we need something like #53843

Other things are:

  1. Fix the NixOS test (noted in #56988 (comment))
  2. Possibly write a test for the wayland session
  3. adjust commit msg (#56988 (comment) #56988 (comment))

@matthewbauer matthewbauer added this to the 19.09 milestone May 30, 2019
@matthewbauer matthewbauer force-pushed the plasma_enable_wayland branch from 6ff5432 to 1c16770 Jun 17, 2019
@matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Jun 17, 2019

Rebased

This also enables Wayland for plasma5.
@matthewbauer matthewbauer force-pushed the plasma_enable_wayland branch from 1c16770 to 763b75b Jun 17, 2019
@matthewbauer matthewbauer removed this from the 19.09 milestone Aug 31, 2019
@matthewbauer matthewbauer added this to the 20.03 milestone Aug 31, 2019
@adisbladis
Copy link
Member

@adisbladis adisbladis commented Oct 7, 2019

The wayland session is failing with log (~/.local/share/sddm/wayland-session.log):

dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.systemd1 was not provided by any .service files
qt.qpa.plugin: Could not load the Qt platform plugin "wayland-org.kde.kwin.qpa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, minimal, offscreen, vnc, xcb.

/nix/store/9mlxan56vpqk33ask109pgqjwbiwl9xl-plasma-workspace-5.16.5/bin/startplasmacompositor: line 283:  2352 Aborted                 (core dumped) /nix/store/xvrlykra01fj12929nwf8sjpn7mlfd1c-kwin-5.16.5-bin/bin/kwin_wayland --xwayland --libinput --exit-with-session=/nix/store/9mlxan56vpqk33ask109pgqjwbiwl9xl-plasma-workspace-5.16.5/libexec/startplasma
startplasmacompositor: Shutting down...
startplasmacompositor: Done.

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Oct 7, 2019

@adisbladis It looks like something that plasma-workspace-5.16.5/bin/startplasmacompositor calls into isn't wrapped etc.

@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Oct 10, 2019

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/wayland-sessions/4315/6

pasqui23 and others added 2 commits Nov 1, 2019
This should make the plasma 5 tests run whitout problems
@Synthetica9
Copy link
Member

@Synthetica9 Synthetica9 commented Nov 4, 2019

Is this now ready for prime time?

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Nov 4, 2019

Is this now ready for prime time?

See #56988 (comment).

To paraphrase:

  1. Autologin is still broken in sddm if you use upstream sessions.
    Needs #53843 or similar idea from @hedning
  2. there's no integration testing for plasma wayland
  3. Something is improperly wrapped or missing a wrapper
    #56988 (comment)

Also, since the session names have changed, what will happen for users that have done

services.xserver.desktopManager.default = "plasma5";

for the xsession?

@solson
Copy link
Member

@solson solson commented Dec 20, 2019

  1. Autologin is still broken in sddm if you use upstream sessions.
    Needs #53843 or similar idea from @hedning

Looks like the mentioned PR has since been merged.

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Dec 20, 2019

Correct, with #53843 merged you're not going to get any regressions with using upstream session. The options are renamed now as well.

So 2 and 3 now 😄

@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Jan 31, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-20-03-feature-freeze/5655/11

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Feb 9, 2020

Moving this to 20.09 milestone. At a glance, it's not as simple as I thought. I need to know more about nixpkgs custom startup script for wayland.

@worldofpeace worldofpeace removed this from the 20.03 milestone Feb 9, 2020
@worldofpeace worldofpeace added this to the 20.09 milestone Feb 9, 2020
@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Jun 7, 2020

I've "rebased"(copied from the source tree in my /etc/nixos then modified it) this pr and ,while the "plasma" session work perfectly(it even seem faster,probably by skipping all of our custom init) "plasmawayland" still crashes with:

giu 07 18:41:16 nixos xsession[28941]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
giu 07 18:41:16 nixos xsession[28941]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
giu 07 18:41:16 nixos xsession[28941]: Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

in the journal.
Weird that a wayland session still look for xcb.

@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Jun 7, 2020

@bkchr maybe I can publish a pr to use only the upstream xsession files,and to enable the wayland sessions in a later pr,maybe waiting for #84542 ?

@hedning
Copy link
Contributor

@hedning hedning commented Jun 7, 2020

(Assuming you're using SDDM). @pasqui23 I'd try setting SessionCommand in the wayland section of sddm:

[Wayland]
EnableHidpi=${if cfg.enableHidpi then "true" else "false"}
SessionDir=${dmcfg.sessionData.desktops}/share/wayland-sessions

This is done in X11 section:

SessionCommand=${dmcfg.sessionData.wrapper}

@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Jun 8, 2020

I did apply @hedning's suggestion but unfortunately wayland still did not work.
Also my .local/share/sddm/wayland-session.log is empty.
To note that sddm's default wayland-session and xsession are wholly different.

https://github.com/sddm/sddm/blob/develop/data/scripts/Xsession
https://github.com/sddm/sddm/blob/develop/data/scripts/wayland-session
Wayland's,after a bit of initialization shared with xsession,jump straight to exec "$@",while xsession first import a bunch of stuff from x-related files.

I don't know how that relates to wayland

@hedning
Copy link
Contributor

@hedning hedning commented Jun 8, 2020

Right, wayland-session looks like it does the correct things (similar to how GDM handles wayland sessions). Looks like it's most likely something that isn't wrapped correctly as noted in #56988 (comment).

@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Jun 8, 2020

However that still leaves .local/share/sddm/wayland-session.log empty even after my failed session,where else do I look?

@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Jul 3, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/hardware-acceleration-on-firefox/7947/4

@oxalica
Copy link
Contributor

@oxalica oxalica commented Sep 23, 2020

Upstream changed a lot. Is there anything in advance?

@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Sep 23, 2020

@oxalica I'm waiting for nixos-unstabe to proceed.

@pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Oct 8, 2020

@bkchr I'm continuing your work in #100057
It's ok if you close this and continue the work on that?

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Oct 9, 2020

The last rebase was a long time ago so you are continuing the work @pasqui23. Closing in favor of that PR for now

@worldofpeace worldofpeace removed this from the 20.09 milestone Oct 9, 2020
@peterhoeg
Copy link
Member

@peterhoeg peterhoeg commented Mar 22, 2021

Guys, I'm spamming some of the old KDE wayland issues/PRs to ensure we get some testers. This comment is written from a plasma wayland session spawned from sddm after applying this PR (and the one-liner mentioned in a comment) which basically gets it going: #117102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet