From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qAksCWmm52KuswAAbAwnHQ (envelope-from ) for ; Mon, 01 Aug 2022 12:09:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MHnzCGmm52IgyQAAauVa8A (envelope-from ) for ; Mon, 01 Aug 2022 12:09:45 +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 AF2A26FAF for ; Mon, 1 Aug 2022 12:09:44 +0200 (CEST) Received: from localhost ([::1]:36424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oISMp-0003TO-Ml for larch@yhetil.org; Mon, 01 Aug 2022 06:09:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISMA-0003Qi-IC for guix-patches@gnu.org; Mon, 01 Aug 2022 06:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oISMA-0000nG-8s for guix-patches@gnu.org; Mon, 01 Aug 2022 06:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oISMA-0003nT-2f for guix-patches@gnu.org; Mon, 01 Aug 2022 06:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56758] [PATCH 0/2] Don't try to mkdir XDG_RUNTIME_DIR Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Aug 2022 10:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56758 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin Cc: 56758@debbugs.gnu.org Received: via spool by 56758-submit@debbugs.gnu.org id=B56758.165934853414571 (code B ref 56758); Mon, 01 Aug 2022 10:09:02 +0000 Received: (at 56758) by debbugs.gnu.org; 1 Aug 2022 10:08:54 +0000 Received: from localhost ([127.0.0.1]:39377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oISM2-0003mx-0b for submit@debbugs.gnu.org; Mon, 01 Aug 2022 06:08:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oISLx-0003mT-Dc for 56758@debbugs.gnu.org; Mon, 01 Aug 2022 06:08:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISLr-0000lr-3A; Mon, 01 Aug 2022 06:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=kG/7fHYFS55sqAGcqUIEammUMi94hbPZxLdE1Xa3w4w=; b=PVL76ZTwuhwT6yGwdE3g msG+wSmQ3hkuA16VyipC2dV4qUKNKTAr6db2MK4rZCoD5uHEMxZycMok3PQLkSzYejpWV1VNViaRz o5rtQs9qu9Lp++ZdXUD0yCKk1KJq/ss5+jDligPIojIeVe35tv13KVTSe+XnB63l1B08DF10GSTY8 AmWn52Ka8yU9su9sZfTFEfkfxQTb2Z1QslLzUEfGsExDMFLQG0PxGucMjmT/xkOd9oAs5vGhlyBJZ 6eQscuzvzObX2W2dPKxNJCPykMVli1NnByeh+t5SEqhI0aJBMU5mTGkvtQeCNuu4/tUQdusqiH+rw fxp1jYLoh3SZag==; Received: from [193.50.110.235] (port=41056 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISLp-0006eQ-HZ; Mon, 01 Aug 2022 06:08:41 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87wnc1zfrh.fsf@trop.in> Date: Mon, 01 Aug 2022 12:08:39 +0200 In-Reply-To: <87wnc1zfrh.fsf@trop.in> (Andrew Tropin's message of "Mon, 25 Jul 2022 12:43:47 +0300") Message-ID: <87r120z36g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659348584; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=kG/7fHYFS55sqAGcqUIEammUMi94hbPZxLdE1Xa3w4w=; b=GV2LIe+WrNxpyckYQCjU6N0CaT9wuwbNgFm62rdxWiyOcmefwjXMBSsCm+5qGloDoB1rV3 F3qFqkYjEmGGhalkbQLdau5XhAUyqTC9kAuaH/VwsAPPSjotAQCOlRouS5BbBRThZrrYMM SAZhoYhfX94dTlfYUeY8wI9vYeTUM+x6oddbFwbm7DrDz4BbfyU0WrI/BHhHQPplijXE6d 83Xt6G8aN/7EkrcxNODE58OHUVMqnHGOIop9wI0wEnYu5pxo8v1q3e3u+AG3pNddny7Ajr bHRZOU71m79qeHrZwsajPVmvYwEsXDGSnugngPnnw/nLm4kUwxQmxi4zxufN/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659348584; a=rsa-sha256; cv=none; b=dBBc+X+R46BUpEtJLYAlvoB2OQTxxsRS2vrgavRe0HxAbtGmy763wgBZdPqebrdV2yDBQv B8CtQCUUe7byI/PT490BuCA91yIMEXyL/35fk3teeVeYhmTHh6dL7E6QaoF/v7xSw8RH3g sIfBvGihsV2uVbQ7M4E3wriBX3DP29sy9Xi6uku62JYF0VYrscagJtqrbAB89YOy4uNbQW sVW9TvkpbkTEq2ATzBCRw6gLP+IrAJkM85ANMh229Ff7u7oVCNiGsRtw3DP8bpnHOTDFpi uaT1YnNgh+fwSX6STkgOnND3JZPuzGDl73/QzCzPSLM9d473dK7ZwsHS9p5HWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PVL76ZTw; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PVL76ZTw; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AF2A26FAF X-Spam-Score: -2.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: dgrEms1Dkr1Z --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Andrew Tropin skribis: > From d08ed8de3ead1a704a96e0e6673dffb62f859597 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Thu, 21 Jul 2022 15:24:32 +0300 > Subject: [PATCH 1/2] home: xdg: Use closures in activation scripts. > > * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation, > home-xdg-user-directories-files-service): Use closures in activation scri= pts. [...] > (define (ensure-xdg-base-dirs-on-activation config) > - #~(map (lambda (xdg-base-dir-variable) > - ((@@ (guix build utils) mkdir-p) > - (getenv > - xdg-base-dir-variable))) > - '#$(map (lambda (field) > - (format > - #f "XDG_~a" > - (object->snake-case-string > - (configuration-field-name field) 'upper))) > - home-xdg-base-directories-configuration-fields))) > + (with-imported-modules '((guix build utils)) > + #~(map (lambda (xdg-base-dir-variable) > + ((@ (guix build utils) mkdir-p) This change doesn=E2=80=99t hurt but it=E2=80=99s apparently unnecessary. > + (with-imported-modules `((guix build utils) > + ,@(source-module-closure > + '((ice-9 string-fun)))) However this one is incorrect is it would lead (ice-9 string-fun) from the host Guile to be imported into the build environment, thereby making the result dependent on the version of Guile that is used =E2=80=9Coutside= =E2=80=9D (you may have seen a warning like =E2=80=9Cimporting (ice-9 string-fun) from the host=E2=80=9D.) > From da332f8272ea3c240fc4e3664051da3b3a4e18c6 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Thu, 21 Jul 2022 17:06:24 +0300 > Subject: [PATCH 2/2] home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation > script. > > * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Skip mk= dir > XDG_RUNTIME_DIR in activation script. > --- > gnu/home/services/xdg.scm | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm > index 5a41dc4994..541f64a379 100644 > --- a/gnu/home/services/xdg.scm > +++ b/gnu/home/services/xdg.scm > @@ -109,13 +109,18 @@ (define (ensure-xdg-base-dirs-on-activation config) > (with-imported-modules '((guix build utils)) > #~(map (lambda (xdg-base-dir-variable) > ((@ (guix build utils) mkdir-p) > - (getenv > - xdg-base-dir-variable))) > - '#$(map (lambda (field) > - (format > - #f "XDG_~a" > - (object->snake-case-string > - (configuration-field-name field) 'upper))) > + (getenv xdg-base-dir-variable))) > + '#$(filter-map > + (lambda (field) > + (let ((env-var-name > + (format > + #f "XDG_~a" > + (object->snake-case-string > + (configuration-field-name field) 'upper)))) > + ;; XDG_RUNTIME_DIR shouldn't be created during activa= tion > + ;; and will be provided by elogind or other service. > + (and (not (string=3D? "XDG_RUNTIME_DIR" env-var-name)) > + env-var-name))) > home-xdg-base-directories-configuration-fields)))) >=20=20 > (define (last-extension-or-cfg config extensions) I tweaked that accordingly (patch attached), but that leads to a test failure in =E2=80=98tests/guix-home.sh=E2=80=99 because there=E2=80=99s a w= arning about XDG_RUNTIME_DIR not existing that goes to standard output of =E2=80=98guix = home container=E2=80=99: --8<---------------cut here---------------start------------->8--- + guix home container home.scm -- false XDG_RUNTIME_DIR doesn't exists, on-first-login script won't execute anything. You can check if xdg runtime directory exists, XDG_RUNTIME_DIR variable is set to appropriate value and manually execute t= he script by running '$HOME/.guix-home/on-first-login'++ guix home container h= ome.scm -- echo '$HOME' guix home: warning: only 4.1 GiB of free space available on /gnu/store hint: Consider deleting old profile generations and collecting garbage, alo= ng these lines: guix gc --delete-generations=3D1m + test 'XDG_RUNTIME_DIR doesn'\''t exists, on-first-login script won'\''t execute anything. You can check if xdg runtime directory exists, XDG_RUNTIME_DIR variable is set to appropriate value and manually execute t= he script by running '\''$HOME/.guix-home/on-first-login'\''/home/ludo' =3D /h= ome/ludo --8<---------------cut here---------------end--------------->8--- Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-home-xdg-Skip-mkdir-XDG_RUNTIME_DIR-in-activation-sc.patch Content-Transfer-Encoding: quoted-printable Content-Description: the modified patch >From f6ff733aaaea7e5b8277b65430e7dc090dffa9aa Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 21 Jul 2022 17:06:24 +0300 Subject: [PATCH] home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Skip mkdir XDG_RUNTIME_DIR in activation script. Co-authored-by: Ludovic Court=C3=A8s --- gnu/home/services/xdg.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 71c028c788..0219bc93e0 100644 --- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -109,12 +109,18 @@ (define (ensure-xdg-base-dirs-on-activation config) ((@@ (guix build utils) mkdir-p) (getenv xdg-base-dir-variable))) - '#$(map (lambda (field) - (format - #f "XDG_~a" - (object->snake-case-string - (configuration-field-name field) 'upper))) - home-xdg-base-directories-configuration-fields))) + '#$(filter-map + (lambda (field) + (let ((variable + (string-append + "XDG_" + (object->snake-case-string + (configuration-field-name field) 'upper)))) + ;; XDG_RUNTIME_DIR shouldn't be created during activation + ;; and will be provided by elogind or other service. + (and (not (string=3D? "XDG_RUNTIME_DIR" variable)) + variable))) + home-xdg-base-directories-configuration-fields))) =20 (define (last-extension-or-cfg config extensions) "Picks configuration value from last provided extension. If there --=20 2.37.1 --=-=-=--