We need to launch wayland sessions as login shells, or many things are broken, e.g most stuff found in /etc/env.d/ - which includes important stuff for us like GSETTINGS_BACKEND setting, or whatever PATH tweaks are done there, or nice stuff like the lesspipe usage so less'ing some bz2 or xz packed /usr/share/doc NEWS file works, instead of complaining about it being binary (yes, that's even broken from gnome-terminal that should be doing some of its shell setup; it only fixes when opening a login shell from inside an open tab with e.g "su - username").
This is broken for all distributions right now that don't apply some workaround (including Fedora - even listed at https://fedoraproject.org/wiki/Common_F25_bugs#gnome-login-shell), and is now growingly important with 3.22 actually defaulting to a wayland session (but only when USE=wayland in necessary places is used in case of Gentoo, mainly gnome-session and gdm).
We just happen to suffer more than others due to our huge use of /etc/env.d/ and /etc/profile and whatnot.
The upstream and Fedora bugs (see URL field) discuss various potential workarounds. Some of them I don't like personally for one of the following reasons:
1) It only "fixes" gnome sessions, not other wayland sessions
2) It adds a login shell exec for all sessions, even X11 ones, which means an extra one, because those are already launched within a login shell via all the xinit/Sessions stuff
3) Doesn't work with all possible $SHELL's
The backported patch by my reading seems to always use bash to get a login shell, which means settings in .zsh_profile or whatever ZSH has might not be sourced. If this is a real problem, someone should file a new bug and maybe take it up with upstream.
Author: Mart Raudsepp <firstname.lastname@example.org>
Date: Sat Mar 18 14:22:57 2017 +0200
gnome-base/gnome-session: 3.22.3 bump, revert to Xorg session default, make wayland session be a login shell
The upstream bump from 3.22.2 to 3.22.3 just reduces the data traffic for VT switch monitoring.
Backport upstream patch from 22.214.171.124 to re-launch itself as a "bash" login shell when /usr/bin/gnome-session
is started for a wayland based session without a login shell. This makes GNOME wayland session to
do all the shell setup that a login shell does, which means e.g Gentoo /etc/env.d things get processed
via shell profile, fixing all the variable and other setups we rely on heavily in Gentoo.
Because this currently re-launches with bash, it will probably only source bash and generic setups, not e.g
zsh specific paths.
Forward port upstream patch from 3.19 days that reverted default "gnome" session back to Xorg for 3.20,
to do it again in Gentoo 3.22. Also manually forward port translations for the "GNOME on Wayland" string
change, where available as a translated string in 3.20.
3.24 should be available faster in Gentoo now, which will get us to Wayland then, as in 3.24 it'll also
work with nvidia-drivers and be generally even more mature.
Package-Manager: Portage-2.3.4, Repoman-2.3.1