From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UD0bGzC9OGGU2QAAgWs5BA (envelope-from ) for ; Wed, 08 Sep 2021 15:40:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WJW1FjC9OGFOOAAA1q6Kng (envelope-from ) for ; Wed, 08 Sep 2021 13:40:00 +0000 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 B6A6A17A5C for ; Wed, 8 Sep 2021 15:39:59 +0200 (CEST) Received: from localhost ([::1]:47584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNxny-0003p3-T2 for larch@yhetil.org; Wed, 08 Sep 2021 09:39:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNxn5-0001lG-6y for guix-patches@gnu.org; Wed, 08 Sep 2021 09:39:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNxn4-0005Kv-Ur for guix-patches@gnu.org; Wed, 08 Sep 2021 09:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNxn3-0005NU-QB for guix-patches@gnu.org; Wed, 08 Sep 2021 09:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50286] [RFC PATCH] Let 'package-location' returns location of surrounding 'let'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Sep 2021 13:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50286 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: iskarian@mgsn.dev, 50286@debbugs.gnu.org Received: via spool by 50286-submit@debbugs.gnu.org id=B50286.163110833920658 (code B ref 50286); Wed, 08 Sep 2021 13:39:01 +0000 Received: (at 50286) by debbugs.gnu.org; 8 Sep 2021 13:38:59 +0000 Received: from localhost ([127.0.0.1]:59015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNxn0-0005N8-H5 for submit@debbugs.gnu.org; Wed, 08 Sep 2021 09:38:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNxmy-0005Mq-5L for 50286@debbugs.gnu.org; Wed, 08 Sep 2021 09:38:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42010) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNxmq-00058T-Rt; Wed, 08 Sep 2021 09:38:49 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35394 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNxmj-0004QE-6p; Wed, 08 Sep 2021 09:38:48 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <0b61652d751633f78e876a27be88ed14e47527b6.camel@telenet.be> <87o89681br.fsf@gnu.org> <875yvc4254.fsf_-_@gnu.org> Date: Wed, 08 Sep 2021 15:38:39 +0200 In-Reply-To: (Maxime Devos's message of "Tue, 07 Sep 2021 22:30:46 +0200") Message-ID: <87pmtj2nmo.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631108399; 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: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; bh=YWK+eQJTuyubIiREVgJA2YY+p2whGMkDaXYOsQODG04=; b=dwu+PgN776NsdsbqC9SHJNOKi7mwC3sTal99N8sRPzVwwVHnuOkU7qzssdidnM4bqxy+b8 /7SQx24CzIjvVSE3E7qvxecMhUAQf36TZKVvEZTunKdnFcZLkNUGomuQPndVMXOf9KmUvF fdrSGLW4ZD+Am7/kIBi9P+o3VE0/rHdoVhTwtHyz+LLBx+nFhtJVGKUpNFmGBWs/5vHPzU zZ3d1DVNZFN+o0FMMwVZU0KIG1hS1hZyvFo9rKqSJSvdmuQdrqK80PrfziNIyLmh+SuoLl 1DtUkrpljBlXFkZHO3/KgUjLzRjym/MxJFjqukdVB2mbzj7NLlAjRjIuHdJ70g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631108399; a=rsa-sha256; cv=none; b=VohYAj7MYX0g74CdGOk1dwUu6d1oydajqFuSyeFAqP8RRTWPqMzNqy9fLGlUor7pCGcIqd Tv4J6oGhU6bqkQUaYtn7wZISKDl1FqLt1lK/t94ksXvvNx2WbFqHYnw8IcYgyktu0xucXW om8GVrUlKX/jx8UHg3vyH9gih1EVCQGJHri6FkVQJCfDkt3ZvjvmdL54gS5KlLz1621Sxx 75NoQw1JV5Ti/s4jWmMYV33coDaWrbpjViafbXe/MkJOrPEzAjOMAK2wJCx3I6gB5GXPa3 Gc0Qa9uuhV2Cj2NQqn8UpbdbuEn68FpAUPfOYunVKVLymfq0Wpc/oydISSBo1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B6A6A17A5C X-Spam-Score: -2.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5MgM5UxDfgel Hello, Maxime Devos skribis: > Why not always let the location of a package be the location of the > surrounding define-public* form, instead of having two separate > locations? Letting the location of a package be the location of the > define-public* form (or 'let' form) seems more useful to people using > "guix edit minetest-etheral" for example, and the package-field-location > code can easily be adjusted to support 'define-public*' (or let) forms. > > If two separate package-definition-location and package-location are > introduced, what should "guix show minetest-ethereal" show? The location > of the 'package' form, the location of the 'let' form or the location > of the 'define-public' form? A package always has a =E2=80=98location=E2=80=99, but it may lack a defini= tion location, for instance if it=E2=80=99s produced by a procedure, or if it=E2= =80=99s not bound to a top-level variable. Things like =E2=80=98package-field-location=E2=80=99 are likely more accura= te if they start searching from the beginning of the (package =E2=80=A6) sexp. These patches leave the UIs unchanged (=E2=80=98guix show=E2=80=99, =E2=80= =98guix edit=E2=80=99, etc.) because I think =E2=80=98location=E2=80=99 is good for these. > Having two separate define-public* and define-public macros might be a > little confusing. Would it be possible to let 'define-public*' replace > 'define-public'? =E2=80=98define-public*=E2=80=99 is exported as =E2=80=98define-public=E2= =80=99, so package definitions do not need to be changed: #:replace ((define-public* . define-public)) > I don't really have an opinion on whether package-[field-]location should > return the location of the 'let' form or the location of the 'define-publ= ic' > form. I think 'package-location' should return the location of the 'let' > form (or a surrounding form), because the 'commit' and 'version' variable > from the 'let' form are part of the package -- change them, and you'll > get a different package. Yeah, I see what you mean. The work =E2=80=98guix refresh -u=E2=80=99 and = =E2=80=98guix style=E2=80=99 do is essentially correlating live objects (package records) to their source code. This is necessarily an approximation; it=E2=80=99s similar to version strings constructed with =E2=80=98string-append=E2=80=99: that=E2= =80=99s something that inspection of the live object cannot reveal, so we use heuristic to match common conventions. Thoughts? Thanks, Ludo=E2=80=99.