From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 eGMcOv/e52LAngAAbAwnHQ (envelope-from ) for ; Mon, 01 Aug 2022 16:11:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0HIeOv/e52L6ngAA9RJhRA (envelope-from ) for ; Mon, 01 Aug 2022 16:11:11 +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 59CBEE067 for ; Mon, 1 Aug 2022 16:11:11 +0200 (CEST) Received: from localhost ([::1]:42416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIW8U-0007JN-FJ for larch@yhetil.org; Mon, 01 Aug 2022 10:11:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIW8M-0007J9-Ff for guix-patches@gnu.org; Mon, 01 Aug 2022 10:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIW8M-0001Hd-5q for guix-patches@gnu.org; Mon, 01 Aug 2022 10:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIW8L-0007GH-U4 for guix-patches@gnu.org; Mon, 01 Aug 2022 10:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56758] [PATCH 0/2] Don't try to mkdir XDG_RUNTIME_DIR Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Aug 2022 14:11:01 +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.165936301327819 (code B ref 56758); Mon, 01 Aug 2022 14:11:01 +0000 Received: (at 56758) by debbugs.gnu.org; 1 Aug 2022 14:10:13 +0000 Received: from localhost ([127.0.0.1]:41338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIW7Y-0007Ed-9V for submit@debbugs.gnu.org; Mon, 01 Aug 2022 10:10:13 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:42673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIW7V-0007EJ-UP for 56758@debbugs.gnu.org; Mon, 01 Aug 2022 10:10:10 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id EB8A3C0016; Mon, 1 Aug 2022 14:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1659363004; 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:references:references; bh=MaKWsg/IkCLa6gHPLIoycpn5h4NFnP6v5TntcXNq08w=; b=lq1P7sxn5JvfCuQFdIxXlLShNNSyQKy7/c/9PdnYmlpFeu09Z5gJn1yrJUYFRZzFRV1fQi K5PhmljZMTmVN8lkLqGO0Cgw97arL3cwlcBrlLhPHyhI+Bm1SVywp/5EdArmqmvce263Dq C5aqfKjT04SD1M2Mauq/I/WwQgt9TpAcT9cq7V3Ojly7tpbXdzZyYZOpQN5zGfkwn6qg/X 2DACVrR2eUPqbYsViV13UFcaTzgFgz5wZVp5DSiqnMgOJMjFXLNwuW3NBFB1kmT8ue+ALD C7/RCtOc2QeyrwQPlprTxERboH/MGw9xcVl8Q3hoZuzuo7iTJRd1sqPZ0oXlBA== From: Andrew Tropin In-Reply-To: <87r120b039.fsf@trop.in> References: <87wnc1zfrh.fsf@trop.in> <87r120z36g.fsf@gnu.org> <87r120b039.fsf@trop.in> Date: Mon, 01 Aug 2022 17:09:59 +0300 Message-ID: <87o7x4awco.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=1659363071; 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=MaKWsg/IkCLa6gHPLIoycpn5h4NFnP6v5TntcXNq08w=; b=gZ8tdEdtAx/yq/ybhingJYakOSSxbvsc0PPbt5t7gUmQCQJeEpkVqWweBoMCAbyapywPJb OtdoDE+wAcKt6tg+g8xEWqhNCmvH/HHFasiow1CdGSqaU+lv/fIDskDYDp+i49Vih9l0qt nt5+6uF3AZMa+2v2bJHw9qAMmMS9wgvAqoCNJ+9/LQng6O8MNsmnN92Ai+tUeii3CxnrRJ FhH3dyjFBp0+W0faCRKp5Rs9ummkKECIYrtjk8ATekDZd12DmKBAlwECLJy9TPb3Zoq1I7 wUu640mQBW16Zk+Tb3YbywWCHsXIHIBFf1RSGLNAXApplgQhnmWBHiMj2PuXPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659363071; a=rsa-sha256; cv=none; b=DVBqwHrxVu0HD0UXuLbhrQZU4nca8tusutMB51G73lRrXUUKVzP9ZmJJZt9KuYV2t2MHLU fJrI6W17dvSboTC8TVlJo9q1di/OruboWcpOXR/wTo48W/da0ocIMiG/1UPUCY6ySHoQyu u+iU1YC0Lgx6dDv7QDpLktlnpI4EgeRJqefeOxRq2ICpg4SMfbWQ+hQbi6W3IvmRxyA4tX /BUDJtNFy9pfQrGy6uU9JYAPfefxuSfeM2oGU/EA1u+giZOKTxnpSzUd5jZjRFtOv0fM69 aWZADZVO/q31VkuzXwlF2Pi3TQTvZB8ZpFW/DSj6XGd84JYYyc5ePNF3qmg2Vg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=lq1P7sxn; 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: -1.72 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=lq1P7sxn; 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: 59CBEE067 X-Spam-Score: -1.72 X-Migadu-Scanner: scn0.migadu.com X-TUID: 122thshllwhb --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-08-01 15:49, Andrew Tropin wrote: > On 2022-08-01 12:08, Ludovic Court=C3=A8s wrote: > >> 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 sc= ripts. >> >> [...] >> >>> (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. > > At least it removes the usage of @@ :) > >> >>> + (with-imported-modules `((guix build utils) >>> + ,@(source-module-closure >>> + '((ice-9 string-fun)))) >> >> However this one is incorrect as 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=9Coutsi= de=E2=80=9D (you >> may have seen a warning like =E2=80=9Cimporting (ice-9 string-fun) from = the >> host=E2=80=9D.) > > Why so? I expected modules closure to be compiled on build side and > provided to activation script via preset load-path. > > BTW, I don't see this warning. > >> >>> 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 = mkdir >>> 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 confi= g) >>> (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 acti= vation >>> + ;; and will be provided by elogind or other service. >>> + (and (not (string=3D? "XDG_RUNTIME_DIR" env-var-nam= e)) >>> + 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 warning about >> XDG_RUNTIME_DIR not existing that goes to standard output of =E2=80=98gu= ix 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 execut= e the >> script by running '$HOME/.guix-home/on-first-login'++ guix home containe= r home.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, = along >> 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 exist= s, >> XDG_RUNTIME_DIR variable is set to appropriate value and manually execut= e the >> script by running '\''$HOME/.guix-home/on-first-login'\''/home/ludo' =3D= /home/ludo >> --8<---------------cut here---------------end--------------->8--- >> >> Thoughts? > > Hm, I tried with both your and my patches, but I don't get a test fail. > > --8<---------------cut here---------------start------------->8--- > make check TESTS=3D"tests/guix-home.sh" > make check-recursive > make[1]: Entering directory '/home/bob/work/gnu/guix' > Making check in po/guix > make[2]: Entering directory '/home/bob/work/gnu/guix/po/guix' > make[2]: Nothing to be done for 'check'. > make[2]: Leaving directory '/home/bob/work/gnu/guix/po/guix' > Making check in po/packages > make[2]: Entering directory '/home/bob/work/gnu/guix/po/packages' > make[2]: Nothing to be done for 'check'. > make[2]: Leaving directory '/home/bob/work/gnu/guix/po/packages' > make[2]: Entering directory '/home/bob/work/gnu/guix' > Compiling Scheme modules... > Compiling Scheme modules... > Compiling Scheme modules... > Compiling Scheme modules... > make check-TESTS check-local > make[3]: Entering directory '/home/bob/work/gnu/guix' > make[4]: Entering directory '/home/bob/work/gnu/guix' > PASS: tests/guix-home.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > Testsuite summary for GNU Guix 1.3.0.22216-446db > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > # TOTAL: 1 > # PASS: 1 > # SKIP: 0 > # XFAIL: 0 > # FAIL: 0 > # XPASS: 0 > # ERROR: 0 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > make[4]: Leaving directory '/home/bob/work/gnu/guix' > make[3]: Nothing to be done for 'check-local'. > make[3]: Leaving directory '/home/bob/work/gnu/guix' > make[2]: Leaving directory '/home/bob/work/gnu/guix' > make[1]: Leaving directory '/home/bob/work/gnu/guix' > > Compilation finished at Mon Aug 1 15:42:20 > --8<---------------cut here---------------end--------------->8--- > > > The same with guix home container. > > --8<---------------cut here---------------start------------->8--- > guix home container ~/tmp/he.scm -- false > WARNING: (guile-user): imported module (guix build utils) overrides core = binding `delete' > Symlinking /home/bob/.profile -> /gnu/store/dann7r1095xll0kji5yl0ql07096r= c8j-shell-profile... done > Symlinking /home/bob/.bash_profile -> /gnu/store/q0i9j1fbxwdr7sqin1hi16zh= ir8b4qwd-bash_profile... done > Symlinking /home/bob/.bashrc -> /gnu/store/0hblljbzbbrbawhcv2hlz14narb78s= 2m-bashrc... done > Symlinking /home/bob/.config/fontconfig/fonts.conf -> /gnu/store/4261pxaf= ny0g2myhh9yj1771ry7k05lc-fonts.conf... done > done > Finished updating symlinks. > > Comparing /gnu/store/non-existing-generation/profile/share/fonts and > /gnu/store/f2bc4zy8hqv3in72yg4kxdxppigfafn1-home/profile/share/= fonts... done (same) > Evaluating on-change gexps. > > On-change gexps evaluation finished. > --8<---------------cut here---------------end--------------->8--- Ok, I found the problem. guix container uses hosts $SHELL variable, which in my case is zsh and this makes the shell inside container not to source ~/.profile, so on-first-login isn't executed. I was able to reproduce test fail and message inside container. My thoughts: 1. home container in tests must always use bash. 2. Error message should be printed to stderr. 3. Right now I experiment with elogind-less system, trying out seatd and greetd, and try to figure out when and how process (especially shepherd) should be started and killed. I'll share my findings on this later, but it's very likely that we will get rid of on-first-login at all (or at least won't source it automatically by login shell in all or some the cases). Do you want me to prepare patch for #2? =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLn3rcACgkQIgjSCVjB 3rBH4A//YpW40v0B7AGpnlc4Btqy9Ud/ZDDg/mTmRd+j2zCKAHzB7p2P5tEFtf67 kcrg8kDJ2E+XW0DJ8ruIULymuM0Q5igltyTjUfCs52SajYyNVv72LnIkAQB5iWhJ 1rWI8F3eIPMklfewWJ89QDwywXO/runUcEzJxboR9uySmspZCakdAACqJVQwMx+i KPzTcYKXclp4n6FnRifPZSHO//tOi14w+amYHIL52NJ5uNpEbmuyTPQarCueCnpX fcxAGRSoeSkVBSatsYcnFtpUaF02wSRs9gjMbuJrQ6ovYJ88rQObCvJtiVamitLu 5uVJiPAOT+9hPRg8JQI4QYO8DpozRFs0dtxcPtzSiNf/JqmiTq8Yk6C1tP3yhNRP SkMX3ThWxdvTR0cESbGiLrQaa3OvAYWQN0NoeqthqwpJuF9ikawMMK3z8zPJKYje eLabrvFbGqtplSsQR3PYGknyB6Nbql7pAgCFs+TpQ6kbMaU4uZla7uoL/mDiIGGY EY981owxArCTLRDaJ6Bf20Rc92B4CIqAs6v+n5Ih10AYM4PM8eQ3TjVoV8E3edv4 OSHN897Eu6f6xhMXNBl7mToLwFU4ezyx1rspD8dR+6SNke3kKs6GeujWVfnnXye7 fOVQVoHWc9rBs+kJ5qEzppdpV9nnAGkBalISK7MJ9BvvqqtDYoY= =eCwA -----END PGP SIGNATURE----- --=-=-=--