From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0N2aEWyvyGZwRQEAqHPOHw:P1 (envelope-from ) for ; Fri, 23 Aug 2024 15:49:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0N2aEWyvyGZwRQEAqHPOHw (envelope-from ) for ; Fri, 23 Aug 2024 17:49:00 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pelzflorian.de header.s=key2 header.b=Ue2vdR8y; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1724428140; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=C5Ar47zvHjI3CF8u2R2wOoMVUzQF9swrCQBFJCWNXMg=; b=JoVXl/LidyVsFESJ800K4g8Da9BHl6p5ISIFAWKvfd7zu0gzjoZ8GVeXKc7mlVdHK++zzE k1r+sRRI3RXWlmGzqopypRZ8PaZiv8SZjCDKnBovLEZdD6a+jggV1oNN/Hs4xJNvQpjETY 3Fb9OiCoQp6dyvKW5RPQvsGhW9G6ui3KeYB2Yzu0hWhTbBHsz5ZAOut5DhiJiw55RENrmz bACFCICthDuAz+ePBejhl740h1VPAZV0idQD/Uqc0HGLjT4qKCBZg75NFd3jvBv2j9UrZq Pk6GRzdupGVEH0cYSrkJJLzUZpFE0u2nFvhkWPlTw5rtDLn2q4OwXIjEJ1KI4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pelzflorian.de header.s=key2 header.b=Ue2vdR8y; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724428140; a=rsa-sha256; cv=none; b=R1/85i5lAv+Fq++7QUe9bIqIfRX6d7P2TZqvTrWuxUFz3VUh4pr3/VL8S38Zt7NXpFCz8E W5HqBtyylEP7jOq/boxrZ3vCZ+Scq8LXdezDb+kwl5GG3M/O6djWuX7XWjQR7lesd1VfX/ ndDPrMoPEP0FA4FjIBI5H7qS6AiQmQGUnhK6oR6bxrQU5sbCf1U51lmrNLqzLxgk4h1Gad sp2ohCifgmZPY7l1R+z9CRvfRob51ZIKtfbcpC9Wunnwk5rmQShOIKQLpfeLTHYJlFB45t wUkBXmV1GWujmRgwbsu+LxV5k0ZiiJr0AcpgAVb2vo7ncwwNusNgEtDBYhrAZQ== 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 11A9F2239B for ; Fri, 23 Aug 2024 17:49:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shWW4-0001Fg-0B; Fri, 23 Aug 2024 11:47:56 -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 1shWW1-0001FS-J9 for guix-devel@gnu.org; Fri, 23 Aug 2024 11:47:53 -0400 Received: from relay.yourmailgateway.de ([188.68.63.170]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shWVz-0007wc-6v for guix-devel@gnu.org; Fri, 23 Aug 2024 11:47:53 -0400 Received: from mors-relay8203.netcup.net (localhost [127.0.0.1]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4Wr4G93hXxz8cL0; Fri, 23 Aug 2024 15:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1724428065; bh=TYPOkYINXIKj79cUhA4dQUtpgcoZPImgF2+mCM0Gjjk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ue2vdR8yibm2aL4+35yjy5FKFinjtTPEblsdUcDeac8rofqXl2FLCiUZ/NFWbN/VB b06oxi7lK51j9f58JIVI66TtATHUayodXvn3By8fSimL8suh+KG+sFG3rtk32RDS0W veed2IsVVbLzcKa/LR+nObq3EhX7cJEijKgVvhp0ABypRqkLcKS+WJBLtBIrs63Jk3 q75aCSRekhZaHtsTPWiARiPwcEdDj0UyYN8p+24yi5EHzqqnwU3Y703LJgGyyEtBPa ciBQNTCXkdq+1qarwNNJE6djxKW6XTalQGrC+mnYW5AU2CQSOWAJu48fmlFj5DT8Il pdKRsH2ck3Dzw== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4Wr4G92zwMz8cKy; Fri, 23 Aug 2024 15:47:45 +0000 (UTC) Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Wr4G90Xyrz8sZw; Fri, 23 Aug 2024 17:47:45 +0200 (CEST) Received: from florianhp (ipb2186896.dynamic.kabel-deutschland.de [178.24.104.150]) by mxe217.netcup.net (Postfix) with ESMTPSA id BEB2A8254C; Fri, 23 Aug 2024 17:47:38 +0200 (CEST) From: "pelzflorian (Florian Pelz)" To: Nigko Yerden Cc: Attila Lendvai , guix-devel@gnu.org Subject: Re: Cookbook recipe from "The Repository as a Channel" section does not work for Guix with properly configured GUILE_LOAD_PATH In-Reply-To: <5224b08c-90bb-4822-a89f-f6cf1bf8a6a9@gmail.com> (Nigko Yerden's message of "Fri, 23 Aug 2024 10:07:49 +0500") References: <63d4684d-7e8e-437b-91f5-ce20607ab882@gmail.com> <87ed6sebdp.fsf@pelzflorian.de> <4d2eb8d0-1bed-429d-a99e-a1ea182dec1c@gmail.com> <87ttfotjw1.fsf@pelzflorian.de> <87cymbyv57.fsf@pelzflorian.de> <87y14yq4wm.fsf@pelzflorian.de> <6fe218cd-2995-4d46-ba5f-3e262b730faf@gmail.com> <87sev1qzxm.fsf@pelzflorian.de> <8e565865-b601-46df-a4ce-2635f24151ff@gmail.com> <87ttfgwbvk.fsf@pelzflorian.de> <07bd739e-2444-46e3-beda-ff853b34f2cd@gmail.com> <87bk1np2a5.fsf@pelzflorian.de> <87bk1l88sx.fsf@pelzflorian.de> <26f24821-13e6-4afe-82a4-57cf60bf2064@gmail.com> <87cym0czto.fsf@pelzflorian.de> <5224b08c-90bb-4822-a89f-f6cf1bf8a6a9@gmail.com> Date: Fri, 23 Aug 2024 17:47:28 +0200 Message-ID: <87ed6f5jhr.fsf@pelzflorian.de> 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-Rspamd-Queue-Id: BEB2A8254C X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: 13uLuMNtutHhgSzY5w69Fycsktmgq/GJ+i1OEvYmcOnmk+5zgAVc3ZQG Received-SPF: pass client-ip=188.68.63.170; envelope-from=pelzflorian@pelzflorian.de; helo=relay.yourmailgateway.de 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.50 X-Migadu-Queue-Id: 11A9F2239B X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.50 X-TUID: 19MwaiCds5zC Hello Nigko. I believe that it is natural to think local-file were the right procedure to use, and it could be used with relative path. Your work-around puts in an absolute path, which perhaps really is what we should put in the cookbook and guile-channel and blog post. If a relative path is bad, we should warn against `local-file' with relative paths in the manual and cookbook, and not just change the example. Or yet rather make a change to `local-file' so calling it with "../.." relative paths is treated right in all cases. Your diff makes it right in more cases. I believe `local-file' already is symlink-resolving in most cases: Nigko Yerden writes: > pelzflorian (Florian Pelz) wrote: >> But then again, the current current-source-directory >> already does follow symlinks in nearly all cases, even in configuration >> files > Don't see it neither in the code nor in our examples. 'syntax-source' doe= sn't > do this. The second branch of 'if' in 'absolute-dirname' bringing in > 'canonicalize-path' is never executed in the examples (remember, the orig= inal > patch didn't work because of this). > >> but actually I do not know why `local-file', when >> calling `absolute-dirname', takes this case of `if'. > Only the first branch of 'if' is executed in all practical cases I can > imagine. While processing guile-package.scm, (search-path %load-path "guile-package.scm") returns an absolute path if and only if guile-package.scm is in the load-path, like when using it from a channel. Then, your diff makes it resolve symlinks. If the configuration or package file is not in the load-path, guile-package.scm is returned, absolute-dirname=E2=80=99s other `if' branch calls `canonicalize-path' on all but the basename and directory symlinks already got resolved. Do I misunderstand? I think symlinks are followed by design here. (I wonder if such non-channel evaluation might cause problems when a non-channel scheme file has the same name as a file in a channel. This might be a rationale for never using local-file with relative paths.) In a guix repl evaluating a file at a path with symlinks, containing a call to the built-in pk procedure on (current-source-directory), (let ((f (open-input-file "/tmp/a/b/c/a/b/c/d.scm"))) (eval (read f) (interaction-environment)) (eval (read f) (interaction-environment)) (eval (read f) (interaction-environment)) (eval (read f) (interaction-environment)) ) all unnecessary path components remain, no symlinks are resolved and absolute-dirname is not called at all. This weird usage is unlike guix home/system reconfigure or what normal people do. >> Why does current-source-directory use syntax-source? > What can it use instead? Related syntaxes such as > 'current-source-location' and 'current-filename' are all using > 'syntax-source' under the hood. `current-module' from your work-around does not use syntax-source, but outside modules cannot replace more powerful current-source-directory. Regards, Florian