Xorgserver upgrade and startx

I just upgraded from 19.09 to 20.03, and with that came an upgrade from xorg server 1.20.5 to 1.20.8.

I use startx to launch emacs, however this upgrade broke startx. From my understanding of the logs, startx seems to keep pointing to the old xorg server (which still exists in nix store), and doesn’t run.
xfce4 works fine, and xinit point correctly to 1.20.8 (however I’ve never figured out how to use it correctly in lieu of startx).

My question is: how to get my startx working again (and probably using xorg server 1.20.8)? I don’t have any custom configuration for startx, so I’m not sure what to change in my config. I’m not sure if startx is somehow dependent on the older xorgserver and it’s an issue upstream. I don’t know.

startx log: startx.log - Pastebin.com
xinit log: xinit.log - Pastebin.com
nix config: nixConf - Pastebin.com
xinitrc: xinitrc - Pastebin.com

I have startx setup in the following way:

#   services.xserver = {
#   enable = true;
#    layout = "us";
#    xkbVariant = "dvp";
#    libinput = {
#      enable = true;
#    };
#    displayManager = {
#      startx.enable = true;
#    };
#  }; 

System is using Intel CPU and GPU.

One thought is to find out what package depends on the older xorg-server version, and if that package is potentially startx. However, I’m not sure how to go about this.

I’ve looked at the cheatsheet Cheatsheet - NixOS Wiki, however I cannot enter ‘xorg-server’ as an argument to find what depends on it.

nix-store --query --references $(which xorg-server)   

Ideally, I could see what depends on the older version of xorg-server, and maybe try and get rid of it?

Any help or debugging advice is much appreciated.

I took a brief look on the startx log. What mostly I didn’t like is:

Using system config directory "/nix/store/yp4hzh1zfnabi90c3azxwy7v6glnly70-xorg-server-1.20.5/share/X11/xorg.conf.d"

As it should use this directory under xorg-1.20.8’s path…

Whats the output of:

readlink $(where startx)

?

@doronbehar

I got this output once, but now I can’t reproduce it. I believe this output occurred one time when I switched to bash, but I can’t remember.
/nix/store/qh0azb77wfmf4yyrl89gilharsl0cgas-xinit-1.4.1/bin/startx
Every other time in zsh nothing special outputs. It’s same output as readlink by itself.
In bash, I get where: command not found.
I don’t know if it matters, but I run ‘nixos-rebuild switch’ with sudo.
Neofetch output states: Packages: 1159 (nix-system), 113 (nix-user)
So I don’t know if my user packages are getting morphed in system packages by doing that.

Never mind neofetch and where vs which, you should see what’s the output of nix-store --query --references with that store path of xinit you get when you enable services.xserver.displayManager.startx.

Using which I can reliably get the output posted above.

Before and after enabling the startx given above, running nix-store --query --references outputs nothing of note.
It’s just a vertical line of ~.

I experimented with the following lines:

services.xserver.enable = true;
services.xserver.libinput.enable = true;
services.xserver.displayManager.startx.enable = true;

When removing the configuration option services.xserver.enable = true, nixos-rebuild switch outputs:

removing obsolete symlink ‘/etc/X11/xorg.conf’...
removing obsolete symlink ‘/etc/X11/xkb’...
removing obsolete symlink ‘/etc/X11/xorg.conf.d/00-keyboard.conf’...
removing obsolete symlink ‘/etc/X11/xorg.conf.d/40-libinput.conf’...
removing obsolete symlink ‘/etc/X11/xorg.conf.d/10-evdev.conf’...

After that, :white_check_mark:startx works, however keyboard and mouse input does not, whether or not libinput is enabled. (Note, it’s still using the old xserver version :no_entry:)

If I continue and further remove services.xserver.libinput.enable = true; then nixos-rebuild switch outputs: removing obsolete symlink ‘/etc/X11/xorg.conf.d/40-libinput.conf’...
Here are the three xorg.logs based off the 3 permutation of the lines listed above if it matters:

1) startx, libinput, xserver enabled: startx, libinput, xserver enabled - Pastebin.com

  • startx does not work.

Notable lines?

 Failed to load module "vesa" (module requirement mismatch, 0)

2) startx + libinput enable: xinit, libinput enable - Pastebin.com

  • startx works, input does not.

Notable lines?

Failed to load module "vesa" (module does not exist, 0)
Failed to load module "libinput" (module does not exist, 0)

3) startx enable: xinit enable - Pastebin.com

  • startx works, input does not.
1 Like

Found in the log files 2 & 3:

[   892.423] (EE) AIGLX error: dlopen of /run/opengl-driver/lib/dri/swrast_dri.so failed (/nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /run/opengl-driver/lib/dri/swrast_dri.so))

Sounds like the horrible glibc-2.30 libraries link to glibc-2.27 · Issue #84043 · NixOS/nixpkgs · GitHub :frowning: + a similar issue with your mixed versions of xorg.

That’s a pretty nasty bug and the unfortunate thing is that the big contributors of Nixpkgs that may be able to fix these bugs usually use unstable all the time so it’s unlikely they’ll fix this, for as far as I can see.

When thinking about it, these are signs that something isn’t designed right deep down there in the bootstrapping system. See Guix Reduces Bootstrap Seed by 50% - #6 by qyliss .

Sounds good. At least I’m content knowing it’s probably not something I did wrong. I guess I’ll get by in the meantime by bootstrapping my emacs EXWM setup by running emacs as the window manager inside xfce, as I retain most of the functionality I had before.

Thanks for all your help, I really appreciate it.

1 Like

@doronbehar

I believe I originally misunderstood what you meant by running nix-store --query --references.

If I run nix-store --query --references /nix/store/qh0azb77wfmf4yyrl89gilharsl0cgas-xinit-1.4.1/bin/startx
The output is the same with either xfce or the startx enabled in my config:

/nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27
/nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23
/nix/store/iywp6iw365pm47x5g2jh0imv246f9i3d-libX11-1.6.8
/nix/store/x44kzyjf51m828172p9pbgc45qyykaqy-xauth-1.1
/nix/store/yp4hzh1zfnabi90c3azxwy7v6glnly70-xorg-server-1.20.5
/nix/store/qh0azb77wfmf4yyrl89gilharsl0cgas-xinit-1.4.1

Not sure if that changes anything, but there it is.

At least its clear its somehow related to an old xorg-server.

Yea that’s what I wanted to see. It’s clear to see that both glibc 2.27 and xorg 1.20.5 are used while 20.03 is supposed to use glibc 2.29 and xorg 1.20.8 (I assume). This practically means the update hasn’t landed properly in your system.

I’d create an issue in Nixpkgs and quote the maintainers and mention that it’s a mutation of the ugly glibc-2.30 libraries link to glibc-2.27 · Issue #84043 · NixOS/nixpkgs · GitHub .

OpenGL drivers are provided impurely, by design, as you may want to use e.g. proprietary nvidia implementation without rebuilding everything that uses OpenGL. When you mix OS and package versions (so that they depend on incompatible libraries), you’ll then run into problems. More details e.g. on Solve the libGL ABI problem · Issue #31189 · NixOS/nixpkgs · GitHub

Is it possible by interrupting the upgrade and rebuild switch that impartial installations / upgrades can occur? (nixos-rebuild switch --upgrade and nixos-rebuild switch).

I occasionally stop rebuild switch’s that are in-progress, and re-run them. I believe I did cancel Ctrl + C the upgrade once, and re-start it (I believe it was relatively early on). Maybe this is user error.

No, I don’t think so. But doing a switch can cause this until a reboot, as your display-manager.service is not restarted, so you keep using the old OpenGL closure even though your $PATH is switched to new programs. (Also kernel remains old, but user-space ABI compatibility tends to be very good there.)

@greghab that sounds like starting multiple x sessions · Issue #83646 · NixOS/nixpkgs · GitHub.
You might want to give exportConfiguration = true; a try (example).

(Please ignore this comment if I missed something while quickly scrolling through this thread.)

I get the same output as #1 posted above. startx doesn’t work.

I just did a fresh nixos install and copied my configs to a backup pc. The startx config I had works fine (the one that broke after the upgrade). I’m just going to do a re-install and call it a day.