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 6LstJAG/6GJjPQAAbAwnHQ (envelope-from ) for ; Tue, 02 Aug 2022 08:06:57 +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 UEL5IwG/6GIwXwEAauVa8A (envelope-from ) for ; Tue, 02 Aug 2022 08:06:57 +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 F1BB6812A for ; Tue, 2 Aug 2022 08:06:56 +0200 (CEST) Received: from localhost ([::1]:47448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIl3P-0000Yh-Mf for larch@yhetil.org; Tue, 02 Aug 2022 02:06:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIl2Z-0000VX-4f for guix-patches@gnu.org; Tue, 02 Aug 2022 02:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIl2Y-0002tf-Pi for guix-patches@gnu.org; Tue, 02 Aug 2022 02:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIl2Y-0008Dh-Hd for guix-patches@gnu.org; Tue, 02 Aug 2022 02:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56758] [PATCH v2 0/4] Don't try to mkdir XDG_RUNTIME_DIR References: <87wnc1zfrh.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Aug 2022 06:06: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 56758@debbugs.gnu.org Received: via spool by 56758-submit@debbugs.gnu.org id=B56758.165942032231548 (code B ref 56758); Tue, 02 Aug 2022 06:06:02 +0000 Received: (at 56758) by debbugs.gnu.org; 2 Aug 2022 06:05:22 +0000 Received: from localhost ([127.0.0.1]:42069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIl1t-0008Cl-GL for submit@debbugs.gnu.org; Tue, 02 Aug 2022 02:05:22 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIl1p-0008CU-2V for 56758@debbugs.gnu.org; Tue, 02 Aug 2022 02:05:20 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 04B4440002; Tue, 2 Aug 2022 06:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1659420311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=rWUhI/JRigSbeUHE5Lk/EyDUZ+NEBx3Dm30QzEW/jYM=; b=WB5X46dHYN8NkYJzwAEIoFN1yTdgorCFEKMf/Ud/G/tXkgZHhA15KjZ1qv72+oeeSUc9NX Oft2vVbwg+lxrADJmxvj5vRQNLByDkIeAobfM/GnkRGBimML5DIG4AK8wsOFw9YayC2gZT pszoIb8OY4x0ak/Qw9kSFiee5k4ySn/IsGyfsKVhNMbvGs2M7w+o9iNza39/EaJgUTm6fd JLtSPgKzdRRn8Ucy9Fb6KcvIdwFrcGVJEBjV/RsUz9qZZ3fbESvwsPVLi/NNBDuPx6xerv qUw6WBllvNW+XirNGBzBfmRnKhoA1Br4vziHIeSdcXuUHh3inT1xpIzrh1z5KA== From: Andrew Tropin In-Reply-To: <87r120z36g.fsf@gnu.org> Date: Tue, 2 Aug 2022 09:00:17 +0300 Message-ID: <875yjbi3ji.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: 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=1659420417; 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=rWUhI/JRigSbeUHE5Lk/EyDUZ+NEBx3Dm30QzEW/jYM=; b=X4pNl4APTh7SjkA7thV8TlPXXq+BnCPj9T5qDAgjHqfJHmOaFOSyu8VtyP+XJrZxtujsVP ptbD+worBF+q5Synh5R/zBPip+MVKr+oa4rMF9/+N3cfChfbSkVv2gM9JtP341fp5uEoP6 wxoiKZ240ZZfVLGlAnC2Y7ulfyEkstK2JJ2stjnp4QDEMbRKDWBngxbvDBv10S9qDG6ZCa zq+DiQT9D0PR1P/2UBtH4QE6KseARuagJtQkHEEmhxTgSRFnCm3A1xaXy3R4h6P0+OnWNu I8dtwwQGSwt8W4STP/h5FhRF1/V7hmxmrXJ6EMHMTWEYyEwIHy/ltI/rzEvVMg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659420417; a=rsa-sha256; cv=none; b=PubgzO1UV5Dkk5aAbQD6QMp1tPJ9TSgbOWS85buej5AoJhNadDngBJMPljhT6as99riD1V xaylrHZoOaJ17zdGjKT9Kd8xgAFlk4hO+hrGgWejtH+3PxnbxcTEiSzFQMvKyB+8Hw7In8 vi91XTrS0Mbusj1n0c8w5PM5IgO50KSn9kccq/w1FG6ZBTrSeWWq1x+QPk9yi5OdWH2+B6 rgOb4pLUBCR1nGmzFlHvTbt/UKPG+dQkeoMcNdOnK8PmDRd3749HcR/VA2o7Ae/qHW0acG M4p8ZwmnVfCmKGf+sZOdXXJeZVE2u52Q7yCfxpofNA2dyvbuNvT5cK4tj9S9pQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=WB5X46dH; dmarc=none; 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: -0.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=WB5X46dH; dmarc=none; 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: F1BB6812A X-Spam-Score: -0.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: BC2Cr530v7s6 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Changes since v1: =2D Don't use modules closure. =2D Use string-append instead of format. =2D Use warning instead of display. =2D Hardcode SHELL=3Dbash for home tests inside container. Andrew Tropin (4): home: xdg: Use single @ intsead of @@. home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script. home: Use warning instead of display. tests: Make tests inside container reproducible. gnu/home/services.scm | 8 +++++--- gnu/home/services/xdg.scm | 25 ++++++++++++++++--------- tests/guix-home.sh | 5 ++++- 3 files changed, 25 insertions(+), 13 deletions(-) =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-home-xdg-Use-single-intsead-of.patch Content-Transfer-Encoding: quoted-printable From=20e4b582654903d2cc227f8824df7873bf75f8b100 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 21 Jul 2022 15:24:32 +0300 Subject: [PATCH v2 1/4] home: xdg: Use single @ intsead of @@. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation, home-xdg-user-directories-files-service): Use single @ intsead of @@. =2D-- gnu/home/services/xdg.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 71c028c788..04cf9d0aed 100644 =2D-- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -23,6 +23,7 @@ (define-module (gnu home services xdg) #:use-module (gnu packages freedesktop) #:use-module (gnu home services utils) #:use-module (guix gexp) + #:use-module (guix modules) #:use-module (guix records) #:use-module (guix i18n) #:use-module (guix diagnostics) @@ -106,7 +107,7 @@ (define (home-xdg-base-directories-environment-variable= s-service config) =20 (define (ensure-xdg-base-dirs-on-activation config) #~(map (lambda (xdg-base-dir-variable) =2D ((@@ (guix build utils) mkdir-p) + ((@ (guix build utils) mkdir-p) (getenv xdg-base-dir-variable))) '#$(map (lambda (field) @@ -207,8 +208,8 @@ (define (home-xdg-user-directories-activation-service c= onfig) home-xdg-user-directories-configuration-fields))) #~(let ((ensure-dir (lambda (path) =2D (mkdir-p =2D ((@@ (ice-9 string-fun) string-replace-substring) + ((@ (guix build utils) mkdir-p) + ((@ (ice-9 string-fun) string-replace-substring) path "$HOME" (getenv "HOME")))))) (display "Creating XDG user directories...") (map ensure-dir '#$dirs) =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0002-home-xdg-Skip-mkdir-XDG_RUNTIME_DIR-in-activation.patch Content-Transfer-Encoding: quoted-printable From=2035125e96522c0539308f09a151ff67571a865900 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 2 Aug 2022 08:00:21 +0300 Subject: [PATCH v2 2/4] home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Skip mkdir XDG_RUNTIME_DIR in activation script. =2D-- 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 04cf9d0aed..63c6041cd4 100644 =2D-- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -110,12 +110,18 @@ (define (ensure-xdg-base-dirs-on-activation config) ((@ (guix build utils) mkdir-p) (getenv xdg-base-dir-variable))) =2D '#$(map (lambda (field) =2D (format =2D #f "XDG_~a" =2D (object->snake-case-string =2D (configuration-field-name field) 'upper))) =2D 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 =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0003-home-Use-warning-instead-of-display.patch Content-Transfer-Encoding: quoted-printable From=20b67b8217830ee6e1afdf7532a961835fd77a5519 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 2 Aug 2022 08:20:38 +0300 Subject: [PATCH v2 3/4] home: Use warning instead of display. * gnu/home/services/xdg.scm (compute-on-first-login-script): Use warning instead of display. =2D-- gnu/home/services.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 6fbc91fab2..4376422014 100644 =2D-- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -368,9 +368,11 @@ (define %initialize-gettext (define (compute-on-first-login-script _ gexps) (program-file "on-first-login" =2D (with-imported-modules (source-module-closure '((guix i18n))) + (with-imported-modules (source-module-closure '((guix i18n) + (guix diagnostics))) #~(begin =2D (use-modules (guix i18n)) + (use-modules (guix i18n) + (guix diagnostics)) #$%initialize-gettext =20 (let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") @@ -387,7 +389,7 @@ (define (compute-on-first-login-script _ gexps) (begin #$@gexps (touch flag-file-path))) ;; TRANSLATORS: 'on-first-login' is the name of a service and ;; shouldn't be translated =2D (display (G_ "XDG_RUNTIME_DIR doesn't exists, on-first-logi= n script + (warning (G_ "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 = the script by running '$HOME/.guix-home/on-first-login'")))))))) =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0004-tests-Make-tests-inside-container-reproducible.patch Content-Transfer-Encoding: quoted-printable From=204c7084308338aa3eaedb3097b43117c421c39580 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 2 Aug 2022 08:40:31 +0300 Subject: [PATCH v2 4/4] tests: Make tests inside container reproducible. * tests/guix-home.sh: Make tests inside container reproducible. =2D-- tests/guix-home.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/guix-home.sh b/tests/guix-home.sh index 1d1acbfd6e..d5e2dadbb5 100644 =2D-- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -107,7 +107,10 @@ EOF =20 if container_supported then =2D # Run the home in a container. + # Run the home in a container. Always use bash inside container for + # reproducibility of the tests. + # TODO: Make container independent from external environment varia= bles. + SHELL=3Dbash guix home container home.scm -- true ! guix home container home.scm -- false test "$(guix home container home.scm -- echo '$HOME')" =3D "$HOME" =2D-=20 2.37.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLovpEACgkQIgjSCVjB 3rB/aA//QxSig+eZBo1FoDfHDQ7JKPxLbDS+nqj50QBceJxQnXVe6orXzgJYbYNm sTRiYBhf81GmtojMcssMk0bQM8CBhRTSUmw5tWa+aX1ssVaNFdH6qltPiz3ECwjz 3aZZnRfpoSZ6KMll9W2OEF0Rm3kJdI2yFgFUih4YCfYB4H0Az+3KbXR/n3qwcrhc bDNQsGnzEr9ycURqq1rf6GlCkysFp6maLj7Jm/YTegQSLLrFtF3/skMw/ROj2gNs nVChUGQaKQG0DyH29ZeCzSflaBGQJ2vFFzRkEf/iw3Tr8+glS0BvUjfJfhcw0Dkb QsWYl6rZmtbALBtm7rJl1GHEiasOPX/RWbnglZmtafQNu+H0Odh2Tf6RdOmNU3Yl u5wct2gH0hfggfKaP+brdCuDydrstNzyAB2E0djJKHjx6Otxn/2VjzFUJU+WaJgM Mz1ZmAR9ZTJMNDu4l/goFWclKChfKy/JmNXOcUe7k3s2HfhAiuoas1hEBLMO1T5o Kn6dI8xurAlh4adlq+BxFUQREJbuUyDy+PAH7W5CGQlV8ZAs3qQTNGDd/ugmTvbA 6Qi3hUyIs/dtTGdKvwDghyaaThm4bnU6SZpuMlZMSzfNExUZPNpU9dwsGCkW7zZZ SWzqpoFCfRZq5pQsU/bfhGH9Tp8oMso9AAvyMRDgvDx1XXfy5d0= =9dQS -----END PGP SIGNATURE----- --==-=-=--