Message ID | 87tu74z479.fsf@trop.in |
---|---|
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 93FB827BBEA; Tue, 26 Jul 2022 09:09:37 +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 60FB827BBE9 for <patchwork@mira.cbaines.net>; Tue, 26 Jul 2022 09:09:37 +0100 (BST) Received: from localhost ([::1]:49600 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 1oGFdI-00041G-EL for patchwork@mira.cbaines.net; Tue, 26 Jul 2022 04:09:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46266) 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 1oGFcp-0003zS-Cy for guix-patches@gnu.org; Tue, 26 Jul 2022 04:09:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34180) 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 1oGFck-0003Et-IM for guix-patches@gnu.org; Tue, 26 Jul 2022 04:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oGFck-00081E-Cj for guix-patches@gnu.org; Tue, 26 Jul 2022 04:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56777] [PATCH] Use absolute path for home activation script. Resent-From: Andrew Tropin <andrew@trop.in> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jul 2022 08:09:02 +0000 Resent-Message-ID: <handler.56777.B.165882292730800@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56777 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56777@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165882292730800 (code B ref -1); Tue, 26 Jul 2022 08:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Jul 2022 08:08:47 +0000 Received: from localhost ([127.0.0.1]:52162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1oGFcU-00080i-Tu for submit@debbugs.gnu.org; Tue, 26 Jul 2022 04:08:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:36910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <andrew@trop.in>) id 1oGFcT-00080b-8t for submit@debbugs.gnu.org; Tue, 26 Jul 2022 04:08:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <andrew@trop.in>) id 1oGFcT-0003yc-2u for guix-patches@gnu.org; Tue, 26 Jul 2022 04:08:45 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:36003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <andrew@trop.in>) id 1oGFcM-0003Dc-Js for guix-patches@gnu.org; Tue, 26 Jul 2022 04:08:44 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 25A7F240002 for <guix-patches@gnu.org>; Tue, 26 Jul 2022 08:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1658822910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=MhmXPr+aELpAnlFHdmo1Ljrh9cdSQyFJgOFw3cp/GiE=; b=Oqb5pHuwCZssRViwG5APggPDRDmHA0gnSPUVLloqgDJcas2pwUlzh9jhTWe/VSkJR0CYBJ V5nuQRhH29fL8moEyu+fXmJ7VAclgDYPZr7l/98rjq/4cI3aY0rYvVq7zVQ9L7BM77KJZr 1l4Le92ViDQSrp3DbANNx8UMaIT16aumuravpEvOTIdAtysJznVHf5UwN1t2622FiGuuU1 JjW1oZhgATEPYpO/fUZjtCWH1aAqkWc4Yfqry8I7g/mprcj1RBnevEGv8ZmayReqnhI/qX 3AqON15l5ec4NBGeH6ZXtDVBd/n/2N958HeD7d6tVEnzsv4Kh3eeFTS0IZ71Bg== From: Andrew Tropin <andrew@trop.in> Date: Fri, 14 Jan 2022 09:16:32 +0300 Message-ID: <87tu74z479.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=andrew@trop.in; helo=relay1-d.mail.gandi.net X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: 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 |
Series |
[bug#56777] Use absolute path for home activation script.
|
|
Commit Message
Andrew Tropin
Jan. 14, 2022, 6:16 a.m. UTC
* gnu/home/services.scm (compute-activation-script): Use absolute path for home activation script. --- gnu/home/services.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Andrew, Andrew Tropin <andrew@trop.in> skribis: > * gnu/home/services.scm (compute-activation-script): Use absolute path for > home activation script. > > --- > gnu/home/services.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/home/services.scm b/gnu/home/services.scm > index b05ec53e2a..6d5e4308a0 100644 > --- a/gnu/home/services.scm > +++ b/gnu/home/services.scm > @@ -418,7 +418,7 @@ (define (compute-activation-script init-gexp gexps) > (new-home-env (getenv "GUIX_NEW_HOME")) > (new-home (or new-home-env > ;; Path of the activation file if called interactively > - (dirname (car (command-line))))) > + (canonicalize-path (dirname (car (command-line)))))) Just wondering: what’s the rationale? This is harmless-looking and perhaps it’s all fine, but IME calling ‘canonicalize-path’ might sometimes paper over problems related to file name handling. Thanks, Ludo’.
On 2022-08-29 23:24, Ludovic Courtès wrote: > Hi Andrew, > > Andrew Tropin <andrew@trop.in> skribis: > >> * gnu/home/services.scm (compute-activation-script): Use absolute path for >> home activation script. >> >> --- >> gnu/home/services.scm | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gnu/home/services.scm b/gnu/home/services.scm >> index b05ec53e2a..6d5e4308a0 100644 >> --- a/gnu/home/services.scm >> +++ b/gnu/home/services.scm >> @@ -418,7 +418,7 @@ (define (compute-activation-script init-gexp gexps) >> (new-home-env (getenv "GUIX_NEW_HOME")) >> (new-home (or new-home-env >> ;; Path of the activation file if called interactively >> - (dirname (car (command-line))))) >> + (canonicalize-path (dirname (car (command-line)))))) > > Just wondering: what’s the rationale? It's been a while since I posted it, but IIRC, in case the activation script called manually from other directory without this change the relative new-home can be set, which can fail later if some of activation code changes the current working directory, but reference home environment by relative path. Probably I faced this one, when was working on prototype for https://issues.guix.gnu.org/56669 Another hypothetical case, which can fail: ln -s /gnu/store/...-home ~/tmp/he ~/tmp/he/activate rm ~/tmp/he # Dangling symlink ~/.guix-home -> ~/tmp/he Last one can be solved by resolving full path of new-home in symlink-manager, but always setting new-home to absolute path to home item in the store seems as a way to avoid both potential problems mentioned above. This change is pushed as ffc391500ac7eae1ef100d8d36f6c01f4f606170 > > This is harmless-looking and perhaps it’s all fine, but IME calling > ‘canonicalize-path’ might sometimes paper over problems related to file > name handling. Will keep it in mind.
diff --git a/gnu/home/services.scm b/gnu/home/services.scm index b05ec53e2a..6d5e4308a0 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -418,7 +418,7 @@ (define (compute-activation-script init-gexp gexps) (new-home-env (getenv "GUIX_NEW_HOME")) (new-home (or new-home-env ;; Path of the activation file if called interactively - (dirname (car (command-line))))) + (canonicalize-path (dirname (car (command-line)))))) (old-home-env (getenv "GUIX_OLD_HOME")) (old-home (or old-home-env (if (file-exists? (he-init-file he-path))