Message ID | 87r120z36g.fsf@gnu.org |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 18D5827BBEA; Mon, 1 Aug 2022 11:09:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6993827BBE9 for <patchwork@mira.cbaines.net>; Mon, 1 Aug 2022 11:09:43 +0100 (BST) Received: from localhost ([::1]:36424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1oISMo-0003TO-Fl for patchwork@mira.cbaines.net; Mon, 01 Aug 2022 06:09:42 -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 <Debian-debbugs@debbugs.gnu.org>) 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 <Debian-debbugs@debbugs.gnu.org>) 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 <Debian-debbugs@debbugs.gnu.org>) 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?= <ludo@gnu.org> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Aug 2022 10:09:02 +0000 Resent-Message-ID: <handler.56758.B56758.165934853414571@debbugs.gnu.org> 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 <andrew@trop.in> 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 <debbugs-submit-bounces@debbugs.gnu.org>) 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 <ludo@gnu.org>) 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 <ludo@gnu.org>) 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 <ludo@gnu.org>) id 1oISLp-0006eQ-HZ; Mon, 01 Aug 2022 06:08:41 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org> 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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Commit Message
Ludovic Courtès
Aug. 1, 2022, 10:08 a.m. UTC
Hi, Andrew Tropin <andrew@trop.in> skribis: > From d08ed8de3ead1a704a96e0e6673dffb62f859597 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin <andrew@trop.in> > 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 scripts. [...] > (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’t hurt but it’s 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 “outside” (you may have seen a warning like “importing (ice-9 string-fun) from the host”.) > From da332f8272ea3c240fc4e3664051da3b3a4e18c6 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin <andrew@trop.in> > 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 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 activation > + ;; and will be provided by elogind or other service. > + (and (not (string=? "XDG_RUNTIME_DIR" env-var-name)) > + env-var-name))) > home-xdg-base-directories-configuration-fields)))) > > (define (last-extension-or-cfg config extensions) I tweaked that accordingly (patch attached), but that leads to a test failure in ‘tests/guix-home.sh’ because there’s a warning about XDG_RUNTIME_DIR not existing that goes to standard output of ‘guix home container’: --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 the script by running '$HOME/.guix-home/on-first-login'++ guix home container 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=1m + 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 the script by running '\''$HOME/.guix-home/on-first-login'\''/home/ludo' = /home/ludo --8<---------------cut here---------------end--------------->8--- Thoughts? Ludo’.
Comments
On 2022-08-01 12:08, Ludovic Courtès wrote: > Hi, > > Andrew Tropin <andrew@trop.in> skribis: > >> From d08ed8de3ead1a704a96e0e6673dffb62f859597 Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin <andrew@trop.in> >> 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 scripts. > > [...] > >> (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’t hurt but it’s 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 “outside” (you > may have seen a warning like “importing (ice-9 string-fun) from the > host”.) 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 <andrew@trop.in> >> 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 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 activation >> + ;; and will be provided by elogind or other service. >> + (and (not (string=? "XDG_RUNTIME_DIR" env-var-name)) >> + env-var-name))) >> home-xdg-base-directories-configuration-fields)))) >> >> (define (last-extension-or-cfg config extensions) > > I tweaked that accordingly (patch attached), but that leads to a test > failure in ‘tests/guix-home.sh’ because there’s a warning about > XDG_RUNTIME_DIR not existing that goes to standard output of ‘guix home > container’: > > --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 the > script by running '$HOME/.guix-home/on-first-login'++ guix home container 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=1m > > + 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 the > script by running '\''$HOME/.guix-home/on-first-login'\''/home/ludo' = /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="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 ============================================================================ Testsuite summary for GNU Guix 1.3.0.22216-446db ============================================================================ # TOTAL: 1 # PASS: 1 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ 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/dann7r1095xll0kji5yl0ql07096rc8j-shell-profile... done Symlinking /home/bob/.bash_profile -> /gnu/store/q0i9j1fbxwdr7sqin1hi16zhir8b4qwd-bash_profile... done Symlinking /home/bob/.bashrc -> /gnu/store/0hblljbzbbrbawhcv2hlz14narb78s2m-bashrc... done Symlinking /home/bob/.config/fontconfig/fonts.conf -> /gnu/store/4261pxafny0g2myhh9yj1771ry7k05lc-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---
On 2022-08-01 15:49, Andrew Tropin wrote: > On 2022-08-01 12:08, Ludovic Courtès wrote: > >> Hi, >> >> Andrew Tropin <andrew@trop.in> skribis: >> >>> From d08ed8de3ead1a704a96e0e6673dffb62f859597 Mon Sep 17 00:00:00 2001 >>> From: Andrew Tropin <andrew@trop.in> >>> 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 scripts. >> >> [...] >> >>> (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’t hurt but it’s 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 “outside” (you >> may have seen a warning like “importing (ice-9 string-fun) from the >> host”.) > > 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 <andrew@trop.in> >>> 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 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 activation >>> + ;; and will be provided by elogind or other service. >>> + (and (not (string=? "XDG_RUNTIME_DIR" env-var-name)) >>> + env-var-name))) >>> home-xdg-base-directories-configuration-fields)))) >>> >>> (define (last-extension-or-cfg config extensions) >> >> I tweaked that accordingly (patch attached), but that leads to a test >> failure in ‘tests/guix-home.sh’ because there’s a warning about >> XDG_RUNTIME_DIR not existing that goes to standard output of ‘guix home >> container’: >> >> --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 the >> script by running '$HOME/.guix-home/on-first-login'++ guix home container 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=1m >> >> + 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 the >> script by running '\''$HOME/.guix-home/on-first-login'\''/home/ludo' = /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="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 > ============================================================================ > Testsuite summary for GNU Guix 1.3.0.22216-446db > ============================================================================ > # TOTAL: 1 > # PASS: 1 > # SKIP: 0 > # XFAIL: 0 > # FAIL: 0 > # XPASS: 0 > # ERROR: 0 > ============================================================================ > 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/dann7r1095xll0kji5yl0ql07096rc8j-shell-profile... done > Symlinking /home/bob/.bash_profile -> /gnu/store/q0i9j1fbxwdr7sqin1hi16zhir8b4qwd-bash_profile... done > Symlinking /home/bob/.bashrc -> /gnu/store/0hblljbzbbrbawhcv2hlz14narb78s2m-bashrc... done > Symlinking /home/bob/.config/fontconfig/fonts.conf -> /gnu/store/4261pxafny0g2myhh9yj1771ry7k05lc-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?
On 01-08-2022 14:49, Andrew Tropin wrote: >> 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 “outside” (you >> may have seen a warning like “importing (ice-9 string-fun) from the >> host”.) > Why so? I expected modules closure to be compiled on build side and > provided to activation script via preset load-path. This is true, and this causes the problem that Ludo' describes: Two problems: * (ice-9 string-fun) is part of Guile, so compiling it again is pointless (and potentially harmful, if ice-9/string-fun.scm contains a reference /gnu/store/.../some-target-specific-library.so) * a form of non-determinism and non-reproducibility -- you are copying the modules from the Guile that 'guix' is run with, instead of always using the modules from the Guile that is defined inside Guix. * additionally, maybe the inside-Guix and what-Guix-is-compiled-with Guile expect different behaviour of (ice-9 string-fun), causing bugs Greetings, Maxime.
From f6ff733aaaea7e5b8277b65430e7dc090dffa9aa Mon Sep 17 00:00:00 2001 From: Andrew Tropin <andrew@trop.in> 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=UTF-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ès <ludo@gnu.org> --- 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=? "XDG_RUNTIME_DIR" variable)) + variable))) + home-xdg-base-directories-configuration-fields))) (define (last-extension-or-cfg config extensions) "Picks configuration value from last provided extension. If there -- 2.37.1