From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2PhGJHtcg2WUyAAAkFu2QA (envelope-from ) for ; Wed, 20 Dec 2023 22:28:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id YMgcH3tcg2U9DQEAe85BDQ (envelope-from ) for ; Wed, 20 Dec 2023 22:28:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Hzov+PHN; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703107707; 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:dkim-signature; bh=yMCA0MawpkTk8xpTgpKCsTww0lQ21k1ulfUyhEntNpo=; b=iDTbqqm9B5L8a6cBdj9Qgwd30iZKUn8XC5M8ibpF4kfR0OChmzcZhqIzLQ4xEjcvnvsBV9 2fcfJgUvc6fPxD4ykcae1kV6zM3QLxo72aRA2cbs5WRwfj48Id1IR6ASaNMmn8QFm2duE9 7fMDzqT3zd2OoOJB0DQ9MDzT5K61CjFqQLEpye9gVJ3DZG6H83V/hVvudSy/QrgPW6sRrR gUPkApFGhavAxpTIlvayOLQQU/RuE5MZ4E0q1M1zoyOnq9/E72xdNpyBT50Fj5A+AVvJcM sYv5AW/I8MdEObrkz+NVXUSEjLjMklRMxsJZuZZecP9b9k5+9K9nE0B1uwQSvQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703107707; a=rsa-sha256; cv=none; b=IjdpmsqQdUt1S/OuLkQgzG8epeHeT5HhM/mzPypk7Cxr+wg9xenZKK9BmxMFo2s7bmBxsN pGSvgxOlS/MT7ObRheEPpk7SW7QOdMof1Goby9iO4xxt3OfNeQuJDJs+/GVwMSwt8bIceY aoSCVdYVwkfxq9XEj+DZSMLUGsQlfbhSuCxJGG24/wb83Qk/i1wJRj0IHDhSlAUckhlQ7q qirQa7Qg/Fd8vVTROQE2Ma1UcHLgxR3tanx2VfOmlTi76jwA25KzI4kb8yjq02Rq5D85j4 gJtqXP91xCRF4W3JfIzv1Py90p2UHFzwN0nAhYuHwe8lW1FU+iTQEM6/ott3HA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Hzov+PHN; 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"; dmarc=pass (policy=none) header.from=gnu.org 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 300C6316F0 for ; Wed, 20 Dec 2023 22:28:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rG46i-0005C6-3a; Wed, 20 Dec 2023 16:28:00 -0500 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 1rG46h-0005Bp-3B for guix-patches@gnu.org; Wed, 20 Dec 2023 16:27:59 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rG46g-00019g-Q0 for guix-patches@gnu.org; Wed, 20 Dec 2023 16:27:58 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rG46j-0002HB-Ry for guix-patches@gnu.org; Wed, 20 Dec 2023 16:28:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#65062] [PATCH core-updates] packages: Lookup inputs by specification. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Dec 2023 21:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65062 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Hilton Chain Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 65062@debbugs.gnu.org, Christopher Baines Received: via spool by 65062-submit@debbugs.gnu.org id=B65062.17031076298676 (code B ref 65062); Wed, 20 Dec 2023 21:28:01 +0000 Received: (at 65062) by debbugs.gnu.org; 20 Dec 2023 21:27:09 +0000 Received: from localhost ([127.0.0.1]:41943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG45t-0002Fr-FB for submit@debbugs.gnu.org; Wed, 20 Dec 2023 16:27:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG45o-0002FK-Vq for 65062@debbugs.gnu.org; Wed, 20 Dec 2023 16:27:08 -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 1rG45e-00012N-Uy; Wed, 20 Dec 2023 16:26:54 -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=yMCA0MawpkTk8xpTgpKCsTww0lQ21k1ulfUyhEntNpo=; b=Hzov+PHNyWcxWhoRgDjZ iRFvQWu/4+P9ul9BfJGz02+7HGWudGHLFO+Hc5XrqnWnDgC+hh6V4UuiMZsUXHbKhn+RpM8D4wplX 3Q8EEqxpInYGsqvWsECKttiZ7zhdet0mjDxXBEKxwFx5UM08s+tVpr+c8LDgKtabYNpVPV814iWyX Fg6vbEBAAIUiLtvN8qXlwsrFMWxmNl5VJSk+2gGBGS8RQLhhHGl9bjg/Glvj3Jb9AwjQQwQgBigol 5MefnUJ6CBg71vQqb6NuEEOHVN8s/YLtpEGR/WIuVEk5oqlRXXkH21e+J9jgMSv8/OAM+b8iB1oqh 4eBZ0ouwGWbyAA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Hilton Chain's message of "Tue, 3 Oct 2023 17:17:02 +0800") References: Date: Wed, 20 Dec 2023 22:26:51 +0100 Message-ID: <87msu4ftus.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-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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.93 X-Spam-Score: -3.93 X-Migadu-Queue-Id: 300C6316F0 X-Migadu-Scanner: mx12.migadu.com X-TUID: 9OZvPA15svhm Hi, Hilton Chain skribis: > * guix/packages.scm (specification->inputs): New procedure. > (lookup-input,replace-input): Use it. > (delete-input): New procedure. > (modify-inputs)[delete]: Use it. I=E2=80=99ve been thinking about this change lately. The problem we have now is that it looks like input labels are gone, but they=E2=80=99re not; in particular =E2=80=98modify-inputs=E2=80=99 preserve= s labels, which is a source of confusion. For instance, if you do: (modify-inputs x (replace "openmpi" mpich)) then =E2=80=98mpich=E2=80=99 remains associated with the =E2=80=9Copenmpi= =E2=80=9D label. Ugh. So I sympathize with the goal. I think we can do something simpler though: > (define (lookup-input inputs name) > "Lookup NAME among INPUTS, an input list." > ;; Note: Currently INPUTS is assumed to be an input list that contains= input > ;; labels. In the future, input labels will be gone and this procedur= e will > ;; check package names. > - (match (assoc-ref inputs name) > - ((obj) obj) > - ((obj _) obj) > - (#f #f))) > + (let ((candidates (specification->inputs name inputs))) > + (and (not (null? candidates)) > + (second (first candidates))))) How about: (find (match-lambda ((_ (? package? package) . _) (string=3D? (package-name package) name)) (_ #f)) inputs) ? That way, =E2=80=98lookup-input=E2=80=99 would honor package names and igno= re labels. > +(define (delete-input name inputs) > + "Delete input NAME within INPUTS." > + (let ((to-delete (specification->inputs name inputs))) > + (lset-difference equal? inputs to-delete))) And we do something similar here. Thus, no need to fiddle with specifications. How does that sound? Now, I think this is the way forward, but I also think it=E2=80=99s going to break many packages and workflows (=E2=80=98--with-input=E2=80=99=E2=80=A6)= . So it should go hand in hand with an effort to fully remove labels in Guix. Thanks, Ludo=E2=80=99.