From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 16:35:32 2023 Received: (at submit) by debbugs.gnu.org; 2 Nov 2023 20:35:32 +0000 Received: from localhost ([127.0.0.1]:56250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyePc-0000v3-CK for submit@debbugs.gnu.org; Thu, 02 Nov 2023 16:35:32 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyePY-0000un-G8 for submit@debbugs.gnu.org; Thu, 02 Nov 2023 16:35:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyeOs-0003GE-Ux for guix-patches@gnu.org; Thu, 02 Nov 2023 16:34:47 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyeOr-0007An-5G for guix-patches@gnu.org; Thu, 02 Nov 2023 16:34:46 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c508e76eb4so3426681fa.0 for ; Thu, 02 Nov 2023 13:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698957283; x=1699562083; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GsOA1a/1FOJ4y7NKLff+PK55ihPO4kc0ioM534KO7LY=; b=mJAAjlGzBTEjLNK+Z05RdCnUUwnu+bRibw4Jkc6AqsX5TMULM70fC9z6lq24dkKSzD qTyTZLfwT+DqN5NuWsovX0hsYsdAwgxsDlSCtnvY50NYSp6pgSCASmDVbobtZ2GU5ztU kOkYdeINSKmNZSAfzGrRwZJuIuA5Og7eB1Z46OZV8hIqaFDv1sHNIbHId6bFrTlKs6gZ jUvU6B9/xxMoAZ6//cgEtZwa4v8Z6NGZZ2gzdg+DE6VysdVxkcMykveBBEoC7M/8i23b JNI/JmKmKH737EwTW9cgd6vG9rJaR9JaReB6CaXuFmH0q5PjTcMstKdNTr+iCM7YfETL 0+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698957283; x=1699562083; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GsOA1a/1FOJ4y7NKLff+PK55ihPO4kc0ioM534KO7LY=; b=AsEtgZoHlUR8jhZTSFqfXR4v8uhBsriZhomQoQomyXVfmVWa5vSWwjGLIveQE/Z5zk SbECwp7N9uizVheENoejnzTvHe5L5DcJR+OBtrtcA8OmDV5SKeb0vMyLoTur1laNFV3H TezhG5ZGvefEf/rjETdADW1UuR3UJjDa2/WPTrsO0KHvG5BVx3Gui9pMXZTAMJKf81TZ JKzg98WLXTuiDPaZQnmYnanO91SdU27R/JNubYH7DG2KsimxqqJ1UTMD5tdeeZ9B9bgh ijyRMew5jPDch9NfE/wYrvIaIAWfsDCQpTWhJt/GgrbiuVWnBd7WNcs9o1DweulX0vWu bmWg== X-Gm-Message-State: AOJu0Yw9SlVeQmDJS5fi00b8SeG31ET6YN7HQKvItKX8L1G3rIEqvtdm Qntw8cYoxepcmYRgPgweGDrHBnd6HQE= X-Google-Smtp-Source: AGHT+IGzkDifpzh9W6CHcQ0zkWYejvoIX0RT0gSBlflNgrpsZ40ld2K8VHOKNBhg1cDQiOwlpQMCyw== X-Received: by 2002:a2e:3306:0:b0:2c5:519:bb1b with SMTP id d6-20020a2e3306000000b002c50519bb1bmr13802233ljc.2.1698957282457; Thu, 02 Nov 2023 13:34:42 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id bg19-20020a05600c3c9300b0040531f5c51asm252045wmb.5.2023.11.02.13.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 13:34:42 -0700 (PDT) From: Simon Tournier To: guix-patches@gnu.org Subject: [PATCH] scripts: edit: Fix relative file-name with 'load-path' option. Date: Thu, 2 Nov 2023 21:34:35 +0100 Message-ID: <0b6f9a9ec4d5146dfa3cf6182bba38ce889d6fac.1698956890.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=zimon.toutoune@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Simon Tournier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * guix/scripts/edit.scm (search-path*): Use 'canonicalize-path' if 'search-path' fails. Change-Id: I891d63d0d28577a7d1732fc59435828ecc0a5c5a --- guix/scripts/edit.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Hi, Using Guix aabfddb, consider: --8<---------------cut here---------------start------------->8--- $ guix show -L src/example hi name: hi version: 2.10 outputs: + out: everything systems: x86_64-linux i686-linux dependencies: gawk@5.2.1 location: src/example/first.scm:9:2 homepage: https://www.gnu.org/software/hello/ license: GPL 3+ synopsis: Hello, GNU world: An example GNU package description: Guess what GNU Hello prints! $ guix edit -L src/example hi guix edit: error: file 'src/example/first.scm' not found in search path ("src/example" "/gnu/store/yzib23ah0rlmim0j4737g2wrhx1r1q3r-guix-module-union/share/guile/site/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/share/guile/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/share/guile/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/share/guile/site/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/share/guile/site" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/share/guile" "/home/simon/.guix-profile/share/guile/site/3.0" "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0" "/home/simon/.guix-profile/share/guile/site/3.0" "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0") --8<---------------cut here---------------end--------------->8--- The issue is that the procedure 'search-path' returns #f. It looks similar as fixed bug #42543 [1] by d10474c38d58bdc676e64336769dc2e00cdfa8ed. Here, I do not know how to avoid 'canonicalize-path' when 'search-path' returns #f because some relative. WDYT? 1: https://issues.guix.gnu.org/42543 Cheers, simon diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index ff2d529bcf..7ec725fc08 100644 --- a/guix/scripts/edit.scm +++ b/guix/scripts/edit.scm @@ -64,7 +64,11 @@ (define %editor (define (search-path* path file) "Like 'search-path' but exit if FILE is not found." - (let ((absolute-file-name (search-path path file))) + (let ((absolute-file-name (or (search-path path file) + ;; It could be that FILE is a relative name + ;; i.e., not relative to an element of PATH. + (and (file-exists? file) + (canonicalize-path file))))) (unless absolute-file-name ;; Shouldn't happen unless somebody fiddled with the 'location' field. (leave (G_ "file '~a' not found in search path ~s~%") base-commit: 28ebbe2be8829a4767b9789c6353ad5e826d1164 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 09:59:02 2023 Received: (at 66901) by debbugs.gnu.org; 5 Nov 2023 14:59:02 +0000 Received: from localhost ([127.0.0.1]:37991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzeac-0005kS-5d for submit@debbugs.gnu.org; Sun, 05 Nov 2023 09:59:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzeaZ-0005js-UK for 66901@debbugs.gnu.org; Sun, 05 Nov 2023 09:59:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzeZs-0006Av-KC; Sun, 05 Nov 2023 09:58:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=/K4pL7OhPEoCAge3K7nFOJWgJys9/5lalntGG43n6gc=; b=fzJTRCxZ74aMrrFVEbOw BffMvDLBe2GXdnEgc5mwtm8LG1xSwPwuktC6kYOFg4rAOuWAExPztAIKwZ6pP07Ep8nYuVAqqJ/uv WpysR8hjj8fVUhOyzPyH+e7t62U76kIRdadLSK0imHxQ152ezez6ZZ3xJE1bP8U/X/ANIMvNGMGFY 3+sXnGFk8JGFK65gqv+yyqevQKJiM1oQuYVB+gHiQip3Mx5HCuZ5U73THGjDFKtNilFsdEBm0U/SX KA31tM5VCwWam2saZkuTdCxVTl0NXB4yecXQNPlCfSjF5SxqpQhW+4KxD1IENsHKYDDj5IhyNXsaY srHGXz0Wqc4+qQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Simon Tournier Subject: Re: [bug#66901] [PATCH] scripts: edit: Fix relative file-name with 'load-path' option. In-Reply-To: <0b6f9a9ec4d5146dfa3cf6182bba38ce889d6fac.1698956890.git.zimon.toutoune@gmail.com> (Simon Tournier's message of "Thu, 2 Nov 2023 21:34:35 +0100") References: <0b6f9a9ec4d5146dfa3cf6182bba38ce889d6fac.1698956890.git.zimon.toutoune@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 15 Brumaire an 232 de la =?utf-8?Q?R=C3=A9v?= =?utf-8?Q?olution=2C?= jour du Dindon X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 05 Nov 2023 15:58:12 +0100 Message-ID: <875y2g1c3f.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66901 Cc: Josselin Poiret , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 66901@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Simon Tournier skribis: > * guix/scripts/edit.scm (search-path*): Use 'canonicalize-path' if > 'search-path' fails. [...] > $ guix edit -L src/example hi > guix edit: error: file 'src/example/first.scm' not found in search path (= "src/example" "/gnu/store/yzib23ah0rlmim0j4737g2wrhx1r1q3r-guix-module-unio= n/share/guile/site/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-= 3.0.9/share/guile/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3= .0.9/share/guile/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.= 0.9/share/guile/site/3.0" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guil= e-3.0.9/share/guile/site" "/gnu/store/84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guil= e-3.0.9/share/guile" "/home/simon/.guix-profile/share/guile/site/3.0" "/hom= e/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0" "/home/simo= n/.guix-profile/share/guile/site/3.0" "/home/simon/.config/guix/profiles/em= acs/emacs/share/guile/site/3.0") > > > The issue is that the procedure 'search-path' returns #f. It looks simil= ar as > fixed bug #42543 [1] by d10474c38d58bdc676e64336769dc2e00cdfa8ed. > > Here, I do not know how to avoid 'canonicalize-path' when 'search-path' > returns #f because some relative. [...] > (define (search-path* path file) > "Like 'search-path' but exit if FILE is not found." > - (let ((absolute-file-name (search-path path file))) > + (let ((absolute-file-name (or (search-path path file) > + ;; It could be that FILE is a relative n= ame > + ;; i.e., not relative to an element of P= ATH. > + (and (file-exists? file) > + (canonicalize-path file))))) I think we can remove the =E2=80=98canonicalize-path=E2=80=99 call here sin= ce we know that FILE denotes a valid file at that point. (That=E2=80=99d avoid the ex= tra work =E2=80=98canonicalize-path=E2=80=99 does.) Otherwise LGTM! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 10:54:22 2023 Received: (at 66901-done) by debbugs.gnu.org; 5 Nov 2023 15:54:22 +0000 Received: from localhost ([127.0.0.1]:38034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzfSA-0007GU-DV for submit@debbugs.gnu.org; Sun, 05 Nov 2023 10:54:22 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzfS8-0007GG-QJ for 66901-done@debbugs.gnu.org; Sun, 05 Nov 2023 10:54:21 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32fc2720c47so379196f8f.0 for <66901-done@debbugs.gnu.org>; Sun, 05 Nov 2023 07:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699199618; x=1699804418; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xRLdWLk76PiYqUkPVvIPOHeETTzv3hkVDQ52F5UCgyE=; b=kgbNi+aCdorXiroDuHob+kJnvrrDhB/N9VQw/royXwHSl01eXeBMXg5tB4kE8A4sJ0 hwTs7ERG9B07Uff9iIOSGYdlnEJlBh4MeonyUI7s8bgfzelRHp/hsyd5EMT1rZ+U/JUU Xsj49ehgghursQ7ov3dba58WUjOZ8DKKlVDD6bcDiEFARg9RioGaowmbO1/xhD7zpN9z YRFMtK4IqUhiRxYQg8cyoEii/sdHMhuIm6VzPi57SJeS1K6cm/ZCyb8JY5Gm26oP0N6b KBfDJDqu1m+ccA1wIW8oFsc91QSy+fDcyDAKVkGvmjtasNxAsPQES1ZQNtNCZu5xNskx bLQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699199618; x=1699804418; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xRLdWLk76PiYqUkPVvIPOHeETTzv3hkVDQ52F5UCgyE=; b=WQVihUz4qXQIiVfwV5EBfjk0GFVIjx6KSs+Yf35FapAWMNG9N3j0OaQdLILCOl1sH6 Zakc5qjTGjGxT06gXQ9Iqp9z3LuWTqkEWosHhOyw4ViOKONolXxNf7c722ObASTlUB9W GFpWhdkqQWIxg0kROZgL9kI5aiMbOQCMaoIHWw59sCweHo98g1pV7Sma8j+BEH+9CHfV Lipfv2Evcb7k+dbFeXBdd2vUFttU5xu0tMq0AGchFczuCAXEtlhoBrbJYskcuz9RMUJ+ 1yM58N+LvFRfvl4N1afVL5F/zJrIsBGH6bcn412XA3Wk1ceIhfmZ/8OP10xVvyxRxtN9 +wuA== X-Gm-Message-State: AOJu0Yy2hISUZmXEDINGXd8XBsicrar9ab2XLB6bIcl+wqc3MgDt6YXa UsJSnb5wMx6GyaYeWqUc2tU= X-Google-Smtp-Source: AGHT+IFeORjjFtAOZMlTK3mqoyEmPoiMz4hIO2uAkzg7HBu244RSEonqE4SAIm0/LSsBYGSBM6+RWg== X-Received: by 2002:a05:6000:1867:b0:32d:e4b9:4851 with SMTP id d7-20020a056000186700b0032de4b94851mr24518983wri.7.1699199617752; Sun, 05 Nov 2023 07:53:37 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id s16-20020a5d5110000000b0032f7865a4c7sm7141653wrt.21.2023.11.05.07.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 07:53:37 -0800 (PST) From: Simon Tournier To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#66901] [PATCH] scripts: edit: Fix relative file-name with 'load-path' option. In-Reply-To: <875y2g1c3f.fsf@gnu.org> References: <0b6f9a9ec4d5146dfa3cf6182bba38ce889d6fac.1698956890.git.zimon.toutoune@gmail.com> <875y2g1c3f.fsf@gnu.org> Date: Sun, 05 Nov 2023 16:53:21 +0100 Message-ID: <87v8agtcwe.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66901-done Cc: Josselin Poiret , 66901-done@debbugs.gnu.org, Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Sun, 05 Nov 2023 at 15:58, Ludovic Court=C3=A8s wrote: > I think we can remove the =E2=80=98canonicalize-path=E2=80=99 call here s= ince we know > that FILE denotes a valid file at that point. (That=E2=80=99d avoid the = extra > work =E2=80=98canonicalize-path=E2=80=99 does.) Thanks for the review. Pushed without canonicalize-path as 1eb3133355ef14d6d4c8648504a7e013338779a8. Cheers, simon From unknown Sun Jun 22 08:00:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 04 Dec 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator