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

pinging #53843 because it will change that options name.

@worldofpeace
Copy link
Contributor

I think the commit msg should start like nixos/plasma5

@worldofpeace
Copy link
Contributor

Testing in a vm shortly

@worldofpeace
Copy link
Contributor

@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 commented Mar 7, 2019

Hmm okay :( I will take a look.

@matklad
Copy link
Member

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 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

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

@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 Plasma5: Use upstream xsession/wayland-session files #56988 (comment))
  2. Possibly write a test for the wayland session
  3. adjust commit msg (Plasma5: Use upstream xsession/wayland-session files #56988 (comment) Plasma5: Use upstream xsession/wayland-session files #56988 (comment))

@matthewbauer matthewbauer added this to the 19.09 milestone May 30, 2019
@matthewbauer
Copy link
Member

Rebased

This also enables Wayland for plasma5.
@adisbladis
Copy link
Member

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

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

@nixos-discourse
Copy link

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 November 1, 2019 09:57
This should make the plasma 5 tests run whitout problems
@Synthetica9
Copy link
Member

Is this now ready for prime time?

@worldofpeace
Copy link
Contributor

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 nixos/displayManager: introduce defaultSession #53843 or similar idea from @hedning
  2. there's no integration testing for plasma wayland
  3. Something is improperly wrapped or missing a wrapper
    Plasma5: Use upstream xsession/wayland-session files #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 commented Dec 20, 2019

  1. Autologin is still broken in sddm if you use upstream sessions.
    Needs nixos/displayManager: introduce defaultSession #53843 or similar idea from @hedning

Looks like the mentioned PR has since been merged.

@worldofpeace
Copy link
Contributor

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

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

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 modified the milestones: 20.03, 20.09 Feb 9, 2020
@pasqui23
Copy link
Contributor

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 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 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 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 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 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

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 commented Sep 23, 2020

Upstream changed a lot. Is there anything in advance?

@pasqui23
Copy link
Contributor

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

@pasqui23
Copy link
Contributor

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

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

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
Development

Successfully merging this pull request may close these issues.

None yet