From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0Jb3ANZ7UGSQCgAASxT56A (envelope-from ) for ; Tue, 02 May 2023 04:56:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WP7pANZ7UGTVhQEA9RJhRA (envelope-from ) for ; Tue, 02 May 2023 04:56:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A37FF1DD7A for ; Tue, 2 May 2023 04:56:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptgBQ-0004yS-T4; Mon, 01 May 2023 22:56:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptgBO-0004vc-F3 for bug-guix@gnu.org; Mon, 01 May 2023 22:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptgBO-0002Z2-4b for bug-guix@gnu.org; Mon, 01 May 2023 22:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ptgBO-0008KH-0C for bug-guix@gnu.org; Mon, 01 May 2023 22:56:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#59474: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 02 May 2023 02:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59474 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Matt Armstrong , 59474@debbugs.gnu.org Received: via spool by 59474-submit@debbugs.gnu.org id=B59474.168299615531994 (code B ref 59474); Tue, 02 May 2023 02:56:01 +0000 Received: (at 59474) by debbugs.gnu.org; 2 May 2023 02:55:55 +0000 Received: from localhost ([127.0.0.1]:41368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgBH-0008Jx-3i for submit@debbugs.gnu.org; Mon, 01 May 2023 22:55:55 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgBD-0008Jf-Jg for 59474@debbugs.gnu.org; Mon, 01 May 2023 22:55:54 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id B0FA640004; Tue, 2 May 2023 02:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1682996145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8EzuGhn/U55Xi5nISqazD8L8lOzwA+nLj6G9gBcOPQw=; b=C6MdpgaHCrResQN6l2ucCOL7JSHYbzzJKnHwK5cwqIeM9544KjxnQs40MS5K0JN9Mcr4oa P5v26GgmTZNRWi2U9xGmqKH/UuH/0nJTWY3KxNvyOmvhNTO4nVwUiqOy1/IAhXi2jq5Zux rMTioOPztvrJ4qmngcss2jgTx9mMq8+oPJdfxYnOWLUfPd811jiJkSo1K5n8C5U1Zi3sxl Zsjx5qbGqeNFxslJ81gHQ5lmmgc8kL67i8DwFcYiWuFITfIVONl/jfe/iRKBFjHhPMz9k3 k7Ri+DxnDsfqViNC8WuNEwfaylq6HPz0YsIZaymIhumHmRW4u3UUtmYk1RE+TA== From: Andrew Tropin In-Reply-To: <87fsebbk80.fsf@rfc20.org> References: <87fsebbk80.fsf@rfc20.org> Date: Tue, 02 May 2023 06:55:40 +0400 Message-ID: <87h6sv1lxv.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682996180; a=rsa-sha256; cv=none; b=DbiRkV4Lts9XRgn5Xfa1u6gNCi9keTngyOm0Oydzw9djRpdiwNbzpAfxtwHzgcAh93o98/ oNWO6+e+OUSq/79MQs/wpg7tTNsMdEOluuaggB+2Rk4IdvK7R+eRvRj8C2FLPaIOhtdOuo 0z5z9dXRdTMXHrYUWM1Aku2/alK2wsqSAgCmTh6m8qQOBJy0Icpj2ukNexSEJ1vP690aOu VFyFlk8edQixL6UgrRik4bg6KYKuX5n7BJaEeUw98tvTcyTHg4xtJmrpj4xtx1uf7b9MES VSFMMAplhRs6tWgFlNKOaSu15TZvVJ8gf+v07+jCu3qwb6nCYFtMoiH+rqqdVQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=C6MdpgaH; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682996180; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=8EzuGhn/U55Xi5nISqazD8L8lOzwA+nLj6G9gBcOPQw=; b=SW8XkI9TwDsOrr0rEcAEx2YYYE/N0V4exMM4Pdx/gIhJzyVadJqAz3/KMzY0sBnwKkFcJL 7YZllRjEaLLgT1VSp3pIkmvh9Iav7c8nNHnzxoTcdJqWxKBr2pNiXpJ4KC1mvZZ35MbfJT xoQP3FZ5C9B2JyiDjwhZEzXgarG8nAmfY6GMMIND7jTLG4bJK/yrTPb0XA0rqGm0JDpB8v q79R/oOnTwgFjowlke/lsC7Y3KOLF5n4GmevpYWHZgdvsZPWMrUmBvh/vwn2LFXz8JbaFq 0GpGwt3S+n/qVX62zhZOGM7Muv4zI522PReFLgZjQ99/7uPbrNjC27dVJ241bg== X-Migadu-Spam-Score: -2.71 X-Spam-Score: -2.71 X-Migadu-Queue-Id: A37FF1DD7A X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=C6MdpgaH; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: OXGrYTlsij2o --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-11-21 22:02, Matt Armstrong wrote: > I am experimenting with Guix Home on Debian Testing, using GDM+Gnome. > The .profile generated by "guix home reconfigure" broke logging in to > the Gnome desktop. The gnome session would die, failing to initialize > what it considered to be essential things, and return to the login > screen I could log in to a tty, and was able to undo the new .profile > and get back to a working system. > > The home-configuration.scm I used was generated by "guix home import" > and was quite simple: > > ---------------------------------------------------------------------- > (use-modules (gnu home) > (gnu packages) > (gnu services) > (guix gexp) > (gnu home services shells)) > > (home-environment > ;; Below is the list of packages that will show up in your > ;; Home profile, under ~/.guix-home/profile. > (packages (specifications->packages (list "glibc-locales"))) > > ;; Below is the list of Home services. To search for available > ;; services, run 'guix home search KEYWORD' in a terminal. > (services > (list (service home-bash-service-type > (home-bash-configuration > (aliases '(("ls" . "ls --color=3Dauto"))) > (bashrc (list (local-file ".bashrc" "bashrc"))) > (bash-logout (list (local-file ".bash_logout" > "bash_logout")))))))) > ---------------------------------------------------------------------- > > Note: a stock GDM+Gnome setup runs the user's login shell when logging > in via the GDM display manager, and this shell execs > gnome-session-binary. This doesn't necessarily happen with other > display managers or other desktop environments, so on those systems the > Guix Home .profile may not even run before the DE is initialized. > Nearly all of my time debugging this was spent figuring this out! :-) > > The .profile file generated by Guix Home is this: > > ---------------------------------------------------------------------- > HOME_ENVIRONMENT=3D$HOME/.guix-home > . $HOME_ENVIRONMENT/setup-environment > $HOME_ENVIRONMENT/on-first-login > ---------------------------------------------------------------------- > > The first thing I see is that $HOME/.guix-home/seutp-environment is > modifying various XDG_ variables incorrectly. It prepends new values > without honor the variable's default value if it doesn't happen to be > set already. > > For example, if XDG_DATA_DIRS is not set its default value is > "/usr/local/share/:/usr/share/". > > But .guix-home/setup-environment will instead prepend a value without > checking, leaving XDG_DATA_DIRS set incorrectly to > "$HOME/.guix-home/profile/share:" when it should be > "$HOME/.guix-home/profile/share:/usr/local/share/:/usr/share/". > > See this code in setup-environment: > > case $XDG_DATA_DIRS in > *$HOME_ENVIRONMENT/profile/share*) ;; > *) export XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIR= S ;; > esac > > The correct idiom is this: > > XDG_DATA_DIRS=3DPATH_TO_PREPEND:${XDG_DATA_DIRS:-/usr/local/share/:/usr/s= hare/} > > or > > XDG_DATA_DIRS=3D${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:PATH_TO_A= PPEND > > The above is what I see in various Nix and Snap configuration files. > > Because I have a few other things installed that modify XDG_DATA_DIRS > before Guix Home does, Guix Home doesn't break that particular variable. > > It did break XDG_CONFIG_DIRS, since Guix Home was setting it to > "$HOME/.guix-home/profile/etc/xdg:". I worked around this problem by > running this code before Guix Home's .profile: > > # Note: when XDG_CONFIG_DIRS is not set Guix home sets > # XDG_CONFIG_DIRS=3D"$HOME/.guix-home/profile/etc/xdg:", which removes > # the default "/etc/xdg" value. > if [[ -z $XDG_CONFIG_DIRS ]]; then > XDG_CONFIG_DIRS=3D/etc/xdg > fi > > # Note: when XDG_DATA_DIRS is not set Guix home sets > # XDG_DATA_DIRS=3D"$HOME/.guix-home/profile/share:", which removes the > # default "/usr/local/share:/usr/share" value. > if [[ -z $XDG_DATA_DIRS ]]; then > XDG_DATA_DIRS=3D"/usr/local/share:/usr/share" > fi > > I have other more minor quibbles about how Guix Home handles XDG values: > > XDG_STATE_HOME is set to a non-standard value. In the current XDG Base > Directory Specification it defaults to "$HOME/.local/state", but Guix > Home sets it to "$HOME/.local/var/lib". On a foreign distro this is > going to cause some disruption when a user switches to Guix Home, or > switches away. > > XDG_LOG_HOME is a non-standard variable. The spec suggests that logs > should go in XDG_STATE_HOME. Why not a establish a GUIX_LOG_HOME > variable instead? (if it ever does become a standard XDG variable, its > default may not be the same one picked by Guix Home, causing the same > issue as above). > > Setting XDG_RUNTIME_DIR is not something I would expect Guix Home to do > -- it is the job of whatever logs the user in. > > XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME are set to their defaults > unnecessarily. > > I modified my personal config by unsetting XDG_STATE_HOME, XDG_LOG_HOME, > XDG_CACHE_HOME, XDG_CONFIG_HOME, and XDG_DATA_HOME if Guix Home left > them set to their default values (in the case of XDG_STATE_HOME I unset > it unconditionally). XDG_DATA_DIRS behavior seems reasonable, the problem should be reported to Debian. The work on STATE_HOME is happenning in a separate thread. Closing this ticket. Let us know if you have some other thoughts on the topic. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmRQe60ACgkQIgjSCVjB 3rAg5A//Sk6ZE0xxtXa3r0wMKoeQL6R9TCNHGahzLYCBkYceLoDZ+jvN0HogUKPo du14vMn/Td14VFq3C/XoTi9KNWfDhyKCIKJvGXlX5DqEuGiY5ee6fdboVDbKkVYJ Quq7diUDXcqvXHSKgOUALBdxHlGLbPhXZNLPtE9w/sH5f6QNiCidrAGriV602VoL p1dvc2qoNLQXTfwMBi/opuJ1Acy2VYdO+g/tVfWi5lUjLu3WpoHoy12j9UP4ckJb 78g4TlRMqK87EY7OKSNyIf5Cl6GMT3v8NiWDnGmvJsfgeWuUKZcBfg6J4F/6LWZz LFKnlLbzF1rDK5xBFp1/xb8FyScnZrXd4NnU57Lay5NI23+22/oQ4e6RfTMyF+9O r6olY2Q40Zs9w2lfVnC4jJ4YS+e1LusgBeZ+tiIcgFdqx5eeGI50YG2iI+TlWeyv OGm7c5cQ25prnGM00EbLzlLPj8XiBFodXUHQaXLFLJPBfZ4AsRQc6zXrrVY2byR/ ttyiGNpxapj6TKJXXE4hlbMJIFyTmjQLJszigMorup7+f/BhwkJz5v5KaMYxwzMZ N5BXEmuM/8SwbM4tQ8poAAPO6Tk6QIxsbeFlhrf8goAxD+GmYPegG5sJPwaSwNkm eFUwamz8mqyZj/ATOxr3f3A+e30EKNGQsGVW6Phndo5UQ06nGSQ= =+bqj -----END PGP SIGNATURE----- --=-=-=--