From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 wJXkEPq1DWP0kAAAbAwnHQ (envelope-from ) for ; Tue, 30 Aug 2022 09:02:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iD4BEPq1DWM6DAAAG6o9tA (envelope-from ) for ; Tue, 30 Aug 2022 09:02:18 +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 B4A5BE552 for ; Tue, 30 Aug 2022 09:02:17 +0200 (CEST) Received: from localhost ([::1]:45730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSvGG-0002Jj-WD for larch@yhetil.org; Tue, 30 Aug 2022 03:02:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSvG6-0002Jb-GP for guix-patches@gnu.org; Tue, 30 Aug 2022 03:02:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSvG6-0006vI-7D for guix-patches@gnu.org; Tue, 30 Aug 2022 03:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSvG5-0004VZ-UE for guix-patches@gnu.org; Tue, 30 Aug 2022 03:02:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56777] [PATCH] Use absolute path for home activation script. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 Aug 2022 07:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56777 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 56777@debbugs.gnu.org Received: via spool by 56777-submit@debbugs.gnu.org id=B56777.166184290617307 (code B ref 56777); Tue, 30 Aug 2022 07:02:01 +0000 Received: (at 56777) by debbugs.gnu.org; 30 Aug 2022 07:01:46 +0000 Received: from localhost ([127.0.0.1]:34560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSvFp-0004V5-MA for submit@debbugs.gnu.org; Tue, 30 Aug 2022 03:01:45 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:33203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSvFm-0004Uq-SS for 56777@debbugs.gnu.org; Tue, 30 Aug 2022 03:01:43 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 12E10FF806; Tue, 30 Aug 2022 07:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1661842896; 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=gIsmC+O76EZz/s+feE7CvgfrTDvkGz6+wEth/77mKaU=; b=YUu02wbwzJKSmnIQs3py5ULlwmrmyBGOfkb+OpZwtyGV3ws7DoSCP771epochgkcok9Wq2 7hAp1EjxvU6hiF4spZTS6YfSa5VSV21uFHRlbODRm0xgrHlwsZ838KVk3G8iVscMn5oqlH xENOLsF/IEq/ZCLdXKQqtd4fVstnRnaBD8fxTBRJ8kyHPcbWZeQk0K15Yf5ZuFsckOkBFy /UMzg7tlrDVulhPr6Tg269OE32YaqZZMrJZrJsHH3cm35qF/ettus3GA4c62orxxLZ0Yys eyXoYBT7m80q4XSzwmO7g/N7FMyZQrtksQhD/6U+7LrDwBB47qjADjq7xZDGww== From: Andrew Tropin In-Reply-To: <871qsy68wd.fsf@gnu.org> References: <87tu74z479.fsf@trop.in> <871qsy68wd.fsf@gnu.org> Date: Tue, 30 Aug 2022 10:01:31 +0300 Message-ID: <87pmgi2p10.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=1661842938; 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=gIsmC+O76EZz/s+feE7CvgfrTDvkGz6+wEth/77mKaU=; b=SLrisryHFqmxckI1KTOBjU6lKZUSABMjU2/AvKbv5GH1RTz7bCr3/nlDPYI/gNfaFeLR66 8TcIgGB6Pued260TFfkZuVaU3uX30GsDbXfxDppDK9J4tr9D4MIBmmYbwBhyZc2wBk+h8C On2RJXtZMXnrUWYw8oWlDPKKnf50oRPEEW0UPI9/A7wlFBRChuXzHJm0NKsA+dLV6/h+zk Tix/32+3mLz/Qb1wFCi6SzsT/ANBFOoZ1uxmOI/5fLgFze+E3I48ELuE0Bmenl636OeMos c40j0Zt1yestLvxydfqa8m7QlPIchGkAJcVBMWhMtKu3/S3uhQNz9GCrM8mdzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661842938; a=rsa-sha256; cv=none; b=cNXvLFpdhosLEiKLzDGW4fN4Ra8nQ4IqbuSr2BJO3p1f2XOMEdYt80rDjlPlSI31jjDK3P xyBHdyGubACYbViZ3bU42fYHai0N6r0DoEbAzB48yXSSRDgng7CeYMInBNoraXRp+hy7Jf 4STC09iZATFXqO7R4fvERBXStOnHRYtub7AWe7Am6XZMfDsEo3DZzotJNinhtUjCSMpZxr UVpHhjlCEKA+G3QB+icnIA9a0bOoIgUBPEHdOVHkcBuKaVM/8Z2KCBiRgcKHkAdNVAyAV1 vdgTJVnKSB4FnRukWMWfoqK8Z4uHW6tGq/J1shilX1EcDLw/ZaDIaIAnPZZ1WA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=YUu02wbw; 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.99 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=YUu02wbw; 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: B4A5BE552 X-Spam-Score: -0.99 X-Migadu-Scanner: scn1.migadu.com X-TUID: S7XP4F/xDuvu --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-08-29 23:24, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > Andrew Tropin skribis: > >> * gnu/home/services.scm (compute-activation-script): Use absolute path f= or >> 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 inte= ractively >> - (dirname (car (command-line))))) >> + (canonicalize-path (dirname (car (command-lin= e)))))) > > Just wondering: what=E2=80=99s 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=E2=80=99s all fine, but IME calli= ng > =E2=80=98canonicalize-path=E2=80=99 might sometimes paper over problems r= elated to file > name handling. Will keep it in mind. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmMNtcwACgkQIgjSCVjB 3rBfIw//VXg1ZYs8D3ednwtwK/+yiNin/j1LmPtGk8D5wgHQuommMvxw6sMTXIve TiGgBcoJI/4HiSD1RfOgAT2EpoO8XkYNmmPRztkYSMFVfSQ+C90ELv2//sFXgEqN qGjOnS+fa+/hpSPgaUl1XFRznNj4RGjE3Bt/l28qML/hr/MBlXu/Tjv3sYbjm36n VDgeV7lWU3ieaXNNkhymRZ691I3lXL/09xoMvBvmnm6Ww49PQKUEORkDfvx12ZVD ySQYOTwZvN74owc21aa5hscimePnwBS0o+gfmt/KmIFte7tgxGn8roMaDKKhYes1 Z4oEbmVnC0lI1HEvfl+B33Pn0DdZwYFcd9EXsLRfqnY2EfaM9PuS9RSlX8lfLr+6 HTWx+Fy48XvMgfATTNk1W4GavpTRH8StggIHNhALVtGQ9p5+gHNqA5OBwH1xWpdr 9vTHzGjUXycDln/MDuuhjGHLCnM8RLzVGpbCFVmXO1wn1cmW6h1GRiKrqNH4DdrR 8QSrHBuZzYMoO/LVA96kAXi/6WCGjj3iWK2AwXLb2zLAbDuSHIjgkIQDFVY3SSpo jIEpEj+9914sayp4f2/EKpvkA5rZX2tL5RedD/Lj3cpoxf7bRgjhtdOZDhZ3cqz6 Atm5Ta1Tf6zbMnu2xAozx6PIw10uZ1ypdBJtaxo5oVeJgB++JDY= =7yv2 -----END PGP SIGNATURE----- --=-=-=--