Skip to content

lightdm: Fix regression from 29caa185a7e4aaa0d621a4f117f3e8f653261fda #19054

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

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Sep 28, 2016

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

29caa18 introduced a bug where when
using i3 and no desktopmanager, it would start xterm and not i3.

Example configuration:

services.xserver.displayManager.lightdm.enable = true;
services.xserver.windowManager.i3.enable = true;

when starting up you would get i3 sort of, but xterm would be started
as your user-session.

This was fixable by setting:

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

as well, but this was definitely a surprise which broke my system. I
don't think this regression was intentional, so here we are fixing it.

Note the default value of desktopManager.default is empty, and the example value is none. Not sure how those two are substantially different, so I think that justifies the change.

Sorry, something went wrong.

@mention-bot
Copy link

@grahamc, thanks for your PR! By analyzing the annotation information on this pull request, we identified @bennofs, @ocharles and @wkennington to be potential reviewers

@grahamc grahamc added 9.needs: port to stable A PR needs a backport to the stable release. 0.kind: regression Something that worked before working no longer labels Sep 28, 2016
@grahamc
Copy link
Member Author

grahamc commented Sep 28, 2016

Originally introduced here: 29caa18 and backported here: 6a12ff4

@obadz
Copy link
Contributor

obadz commented Sep 28, 2016

Seems reasonable to me, but would also recommand trying to understand why the code that defines services.xserver.desktopManager.default in nixos/modules/services/x11/desktop-managers/default.nix doesn't populate it for you.

@vcunat
Copy link
Member

vcunat commented Sep 28, 2016

Isn't the condition always true?

(wm != "" || wm != "none")

@grahamc
Copy link
Member Author

grahamc commented Sep 28, 2016

Heh, yeah, I probably meant && didn't I? :)

29caa18 introduced a bug where when
using i3 and no desktopmanager, it would start xterm and not i3.

Example configuration:

    services.xserver.displayManager.lightdm.enable = true;
    services.xserver.windowManager.i3.enable = true;

when starting up you would get i3 sort of, but xterm would be started
as your user-session.

This was fixable by setting:

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

as well, but this was definitely a surprise which broke my system. I
don't think this regression was intentional, so here we are fixing it.
@grahamc grahamc force-pushed the 29caa185a7e4aaa0d621a4f117f3e8f653261fda-regression branch from ff09221 to 00d1106 Compare September 28, 2016 20:47
@grahamc
Copy link
Member Author

grahamc commented Sep 28, 2016

@vcunat fixed.

@grahamc grahamc added this to the 16.09 milestone Sep 29, 2016
@grahamc
Copy link
Member Author

grahamc commented Sep 29, 2016

Another way to solve this is to set xterm to false:

{
  services.xserver.desktopManager.xterm.enable = false;
}

is this intended behavior, and the behavior from 16.03 / 15.09 is a bug? or is there a bug in that i3 should set xterm to false?

@grahamc grahamc added the 1.severity: blocker This is preventing another PR or issue from being completed label Sep 29, 2016
@grahamc
Copy link
Member Author

grahamc commented Sep 29, 2016

Upgrading to a blocker to get some eyes. Without some sort of fix, users of something like i3 and what-not are going to upgrade to 16.09 and have only xterm running. I don't mind what the decision is on how to resolve this but I don't think it is wrong to let this get released without either a release note or a code change.

@dezgeg
Copy link
Contributor

dezgeg commented Sep 29, 2016

I think your change made it work just by accident due to the always-true bug: in reality the computed value of services.xserver.desktopManager.default is actually none (note the apply logic on that option definition which acts on the default ""), which makes defaultSessionName = "xterm + none", which then makes (elem defaultSessionName dmcfg.session.names) false, which leads to user-session setting not being added to the config file at all.

But regardless, I think we should keep the obvious thing (services.xserver.windowManager.i3.enable = true;) doing the right thing. Maybe the safest thing would be to totally revert 29caa18 for 16.09 and then properly fix the wm/dm mess in unstable.

@obadz
Copy link
Contributor

obadz commented Sep 29, 2016

Presumably reverting wouldn't fix other display managers, and would break what the commit originally fixed. What's wrong with having i3 disable xterm, or set itself as the default?

@grahamc
Copy link
Member Author

grahamc commented Sep 30, 2016

I agree @dezgeg, @obadz -- I don't think this is the right solution. I'm beginning to think the right solution is to have a release note -- there are a lot of WMs to fix: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/services/x11/window-managers and I don't think this just impacts i3.

@grahamc grahamc removed 1.severity: blocker This is preventing another PR or issue from being completed 9.needs: port to stable A PR needs a backport to the stable release. labels Sep 30, 2016
@grahamc
Copy link
Member Author

grahamc commented Sep 30, 2016

I was thinking it'd be better to disable xterm by default, and only enable it if the none WM is used, but none has no enabled state, so no place to enable xterm I think. I think the best choice is to revert this change only in 16.09 and work on a better solution for 17.03.

@grahamc
Copy link
Member Author

grahamc commented Sep 30, 2016

@obadz I would rather keep the commit and add fixes for all the WMs, but it is many WMs and more than I can realistically test changes to before 16.09 is released. I'm going to revert the change now, and I think if we can come up with a fix which doesn't impact existing workflows we'll backport.

grahamc added a commit that referenced this pull request Sep 30, 2016
@bennofs
Copy link
Contributor

bennofs commented Sep 30, 2016

The problem here is actually that windowManager.default is none if you don't set it explicitly. If you set windowManager.default = "i3" everything works as expected: i3 and xterm are both started.

I don't know how this used to work in the past. I couldn't find any code that automatically sets windowManager.default based on the window managers that are enabled.

bennofs added a commit to bennofs/repros that referenced this pull request Sep 30, 2016
@dezgeg
Copy link
Contributor

dezgeg commented Sep 30, 2016

How it "works" is that usually your window manager comes alphabetically before xterm, as in "i3 + none" < '"xterm".

@bennofs
Copy link
Contributor

bennofs commented Sep 30, 2016

@dezgeg oh, and the default for lightdm is to use the alphabetical lowest session? That makes sense! But I think we shouldn't rely on that, and instead fix windowManager.default.

@bennofs
Copy link
Contributor

bennofs commented Sep 30, 2016

I think we could solve this the same way that the conflict is solved in desktopManager.default: make it dependent on the order of imports to give i3 and other window managers priority over none if they are enabled.

@obadz
Copy link
Contributor

obadz commented Oct 1, 2016

Agree with @bennofs that you can fix the issue in your config by setting the default you want. However, if you revert, there is nothing you can do to set the WM you want.

@dezgeg
Copy link
Contributor

dezgeg commented Oct 1, 2016

As a workaround, after the revert services.xserver.displayManager.lightdm.extraSeatDefaults = "user-session = whatever-you-want"; should work.

@obadz
Copy link
Contributor

obadz commented Oct 9, 2016

So it turns out enabling services.accounts-daemon.enable = true; lets lightdm save which session each user has previously selected. We should probably enable that by default with ligthdm.

Thoughts?

@domenkozar
Copy link
Member

@grahamc so this was reverted in 16.09 and master? So we can close and reopen the original issue?

@domenkozar domenkozar modified the milestones: 17.03, 16.09 Oct 24, 2016
@obadz
Copy link
Contributor

obadz commented Oct 24, 2016

@domenkozar: yes, it was reverted in both.

25be65f which I've put in master, but not release-16.09, fixes 99.9% of the issue for me. I suspect if nobody complains in the next couple of weeks, it should be safe to cherry-pick to stable, but up to you…

Looking forward to meet you tomorrow!

@obadz
Copy link
Contributor

obadz commented Oct 24, 2016

We should probably also consider cherry-picking cdaf55a ef35c66 8a547ae 1529641 1d8e7d1 755be7e and ff81b74

@grahamc grahamc closed this Nov 27, 2016
@grahamc grahamc deleted the 29caa185a7e4aaa0d621a4f117f3e8f653261fda-regression branch November 27, 2016 16:30
obadz added a commit that referenced this pull request Feb 26, 2017
This reverts commit 29caa18.

Not clear what the proper thing to do is. cf94cdb renders this
question mostly moot. Reverting before 17.03 branch to avoid a repeat
of #19054.
adrianpk added a commit to adrianpk/nixpkgs that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants