From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uOVFJkFUQGT+fQEASxT56A (envelope-from ) for ; Wed, 19 Apr 2023 22:51:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cMg3JkFUQGRhPwAA9RJhRA (envelope-from ) for ; Wed, 19 Apr 2023 22:51:13 +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 536163F56A for ; Wed, 19 Apr 2023 22:51:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppElb-0002t6-Gn; Wed, 19 Apr 2023 16:51:03 -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 1ppEla-0002sj-Ip for bug-guix@gnu.org; Wed, 19 Apr 2023 16:51: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 1ppEla-0004DA-02 for bug-guix@gnu.org; Wed, 19 Apr 2023 16:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ppElZ-0004xX-Nx for bug-guix@gnu.org; Wed, 19 Apr 2023 16:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#62955: Guix Home Breaks Some Foreign Distros Resent-From: Zacchaeus Scheffer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 19 Apr 2023 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62955 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62955@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168193742818842 (code B ref -1); Wed, 19 Apr 2023 20:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Apr 2023 20:50:28 +0000 Received: from localhost ([127.0.0.1]:35984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppEl2-0004tp-5t for submit@debbugs.gnu.org; Wed, 19 Apr 2023 16:50:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:53120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppEkz-0004td-Ld for submit@debbugs.gnu.org; Wed, 19 Apr 2023 16:50:27 -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 1ppEkx-0002jJ-JX for bug-guix@gnu.org; Wed, 19 Apr 2023 16:50:23 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppEkv-00043i-JX for bug-guix@gnu.org; Wed, 19 Apr 2023 16:50:23 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1a6762fd23cso3879825ad.3 for ; Wed, 19 Apr 2023 13:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681937419; x=1684529419; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=QssWAlHSTO2mpfh2CvLqvyuPmn3npy8c2uiN7n7adKw=; b=A1BLiMfZzG+OMKyJur+3Nk/82rWbbIngza82OAlCqgiqN+8wnOvxCUbwMDcZ94RWkP sHmBuVSJTOSWKn9+O0teeK850AdFWkwVY9yrrF7RTpv4WsUMsk7+rFy1iyYFbmWii2wQ 2dXRW7C5SDeL3IdwtIuzu1VpeGWzHSKI+fo6gH/FOcd4cZLfAVfBDkRGa8MuYPfr9W0G xEoII/vywmmR/S/TF0GG9PAS7RLvHT2csnkozZms853QSIdmVINahbZsqDuPF7dcG9qS bzYynI+bVXuTS7zz5t3IoqdjV2Zfsga4SeVQLKLCONlcnke6W6lMlWFFQBX63Cktl39Y 2rXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681937419; x=1684529419; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QssWAlHSTO2mpfh2CvLqvyuPmn3npy8c2uiN7n7adKw=; b=U/FvNXEItSBkbr+FeZzdk4qzHaKzBqQqaiU9y30/Hfk5ItDhYC6cCe74Ag9OfX62Jb aGsd0/fGomPE+Hyz+jRAD+hklwLN7bSR9M8btiNlkA+/CfVMwcZXeZcCGnxeyeYIQDjG m31RtlQZFcqg5rFjOreP6fxadc8JPbsy/sY+2YCcRjbDZ2fAViB8eWRhkYexj63CLrAb O3EtIIYSO2guiQWBdKjYli82k8LKimRPdkf46Hus0gGH0L6lIDR1CWp9iMaRkt16f9EA Xu6Y+py40DcRf/pH2GdfeiKK57VaVMEyga0+nh2KsMwnssQF40M64po/ss24l1lwUSj7 +tzg== X-Gm-Message-State: AAQBX9c+nIZTKKB4nv5/9EYGTOo+GTbZpyb46KD8a9gFLr72AUwqtJ1o 3FEIawPV6eyDzEU6FkTRwq/GOSmlzIA= X-Google-Smtp-Source: AKy350baL9SmDumNJFBxjDRFvchJ3xpaK8if3vry7VJG9eoAlfE+9Ly4iZ4vr33b+jjHe1DhRLCTiA== X-Received: by 2002:a17:903:2094:b0:1a1:d624:2fe2 with SMTP id d20-20020a170903209400b001a1d6242fe2mr5262563plc.17.1681937419119; Wed, 19 Apr 2023 13:50:19 -0700 (PDT) Received: from igor ([192.147.44.15]) by smtp.gmail.com with ESMTPSA id bf5-20020a170902b90500b001a6f7744a27sm4253782plb.87.2023.04.19.13.50.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 13:50:18 -0700 (PDT) From: Zacchaeus Scheffer Date: Wed, 19 Apr 2023 13:50:17 -0700 Message-ID: <871qkfiol2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=zaccysc@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=A1BLiMfZ; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681937473; a=rsa-sha256; cv=none; b=GpwvVy4RqjFM622UfiKSH//vMWs/w3ySiiLEIQiARK8f+gkkFKuqim0k/dh2dzteBtvSTA 6Gl00yCEfWFHujBi5PmIIk6btG3wdQhtfVjeI1mzEvi2p9WhVX2Geo86LkGd0tD3QFwTq/ 4cLsdVwesz+gj7EuPR6WT/XcDbskBf3GbkH2sO/VBY7M77pLLh0ejMJIG/iy1MKzdB8MzF WS4Tm0gBYl6VppBIHD3Qm0FQ7O3s2M5KXzwaNScpVTG7WuXHCb9cbNAmBuC95p70a+FwWt GKLcBFuwG+v0vNyq+TBezklD8uyuhhowZb4tjya2NL4+kFW0ZimzJhObH7vjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681937473; 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:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=QssWAlHSTO2mpfh2CvLqvyuPmn3npy8c2uiN7n7adKw=; b=Y7dvDKoG6qOxm2LO1mXy/9M3HcEINkfbouKGI6LpzHtCnXMmDiBnX7OEvqGnna+uP90aov 8u1tDGIqN1p+3+gbPDqSj2U0+n4kfJQEbqLRC9Gemw34i52x61PBZPedrxnEjrC97rDzNU 4nwSDst7+AmnLbpWc8LiSeuR11AcUR2gRBpviiR+MID/nOBg4fDpmSbf9OxYbYnhcnGuSr kfMSeV4EyuGnHQwif/MQ2XZWK2r5ixlDk9In0cxh3ootcHLOrrBsMHHtcnZo0Ddlbn+N9w o8zEpjAREJ5nLw8xPZKLuTYp4nebPcplBB+ODFaI4It4qrWD1CMKUKp7ZnVQVA== X-Migadu-Spam-Score: 5.09 X-Spam-Score: 5.09 X-Migadu-Queue-Id: 536163F56A X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=A1BLiMfZ; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: V3eMubwQE7lL Hi all! $HOME/PROFILE/setup-environment contains the following lines: case $XDG_CONFIG_DIRS in *$HOME_ENVIRONMENT/profile/etc/xdg*) ;; *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:$XDG_CONFIG_DIRS ;; esac There are two bugs in this code. Both bugs revolve around what happens if XDG_CONFIG_DIRS is unset, as is the case in some foreign distros. The first problem is if, XDG_CONFIG_DIRS is unset, and $HOME_ENVIRONMENT/profile/etc/xdg does not exist, then the conditional resolves to "is the empty string in the empty string", so XDG_CONFIG_DIRS is prepended with $HOME_ENVIRONMENT/profile/etc/xdg, despite it not existing. I'm not sure if incuding a nonexistant path in XDG_CONFIG_DIRS should cause problems, but this scenario is not mentioned in the XDG specifications[1], so some programs are bound to crash because of this. The second problem (more important) relates to how XDG_CONFIG_DIRS is interpreted if empty vs set to a value. As per the xdg specifications[1], if XDG_CONFIG_DIRS is unset, then a value of /etc/xdg should be used. When an empty XDG_CONFIG_DIRS is set by guix home, programs find a non-empty value and ignore /etc/xdg. The above problem means that when I do a guix home reconfigure on my Librem 5 running PureOS, I get a black screen as Phosh fails to start as it needs files in /etc/xdg. I can fix it by adding: XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:/etc/xdg" to my .zlogin. A similar issue can be seen with the lines regarding XDG_DATA_DIRS in $HOME/PROFILE/setup-environment. I think a good step to resovling this issue is to set empty variables to their default value first. Maybe something like the following in gnu/home/services.scm:267 ... [ -f $PROFILE_FILE ] && . $PROFILE_FILE [ -z "$XDG_DATA_DIRS"] && XDG_DATA_DIRS=/usr/local/share/:/usr/share/ [ -z "$XDG_CONFIG_DIRS"] && XDG_CONFIG_DIRS=/etc/xdg case $XDG_DATA_DIRS in ... This addresses the second problem, but not the first. Someone may find a more elegant way to deal with both issues. -Zacchae [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html