From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kIYBM4N6pmCk6gAAgWs5BA (envelope-from ) for ; Thu, 20 May 2021 17:04:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kMC8LoN6pmDzYgAA1q6Kng (envelope-from ) for ; Thu, 20 May 2021 15:04:35 +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 4AA671D297 for ; Thu, 20 May 2021 17:04:35 +0200 (CEST) Received: from localhost ([::1]:53512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljkDu-0007o6-B6 for larch@yhetil.org; Thu, 20 May 2021 11:04:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljk8c-0007wR-1W for guix-devel@gnu.org; Thu, 20 May 2021 10:59:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35212) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljk8a-0001Vj-KB; Thu, 20 May 2021 10:59:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45618 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ljk8V-0005bZ-Cv; Thu, 20 May 2021 10:58:59 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-devel@gnu.org Subject: [PATCH RFC 0/4] Getting rid of input labels? Date: Thu, 20 May 2021 16:58:26 +0200 Message-Id: <20210520145830.14108-1-ludo@gnu.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621523075; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=S/lWnvmQDEH5zLaAm6GhluXhfK3A99L7Ea1EQ2EtqZk=; b=VvVQHNzu/aJKVzAc7GmuN4yF2nwosGXbb1K4pQqPanL9wyaRPlivLM4iHdGKSwyN9HJbqL 9sZyBaB2BETgKyrO4sHHZbgitL6kD2rtU+J+SYCzb5ShuLFX+5DJNPApkUcCilYSKEhTC/ aDX0FFkitdtSNIvx4xpdxoHPELk+ZTelNn+EuHliBcs37SzPbX8IpjTZkL/abEr8ncKpY8 B//zXqJyn68aZjk5TOnH5ZllVrdkRq0agOUw2VuIbC65tAA6ntFBeVpDkrlvT+K8IcjLXG 4YfTstr2F1msJVdkU2dXzvSTxi/19xLnJYx3iAs7SnqmzDjhCNCrhSuZ3i7ShQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621523075; a=rsa-sha256; cv=none; b=VtnBPbMTuuHqnRUtbtdcqazp2O9ewEZlU0ovaRDfpmvobzfe4bTMNJSxNrgXZOOygYzWvl LMmoFSwuNxL2hbzMGPDFlV1M2i/MvusBXMp+uZAmFy2+zChEUp36fMnsfobIkv59aELYyn NCIKIEX5urm+tyVmOAc/a9XT81jwNdEqqK2twoLbnJv2VWEGhmnMaQsmcgpGBoApXtoaBc Y72NcuJm9AvDotv573KOWLj2LXqx6VTIBheZek/f5qBdW20cSC6B7RSAQ+JDbbgQdH9SGt GxZf0LWRgSxY515XAXcRkE1b0/GlLIaH8PzHIzSX+GCS9cOY3hLCl7PP9nslAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -0.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 4AA671D297 X-Spam-Score: -0.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: xagrJx1ZSHBn Hello Guix! Here’s a proposal for a soft revolution: getting rid of input labels in package definitions. Instead of writing: (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) ("guile" ,guile-3.0))) one can write: (native-inputs (list autoconf automake pkg-config guile-3.0)) With this patch set, this is just syntactic sugar: ‘package-inputs’ and friends still return a list of tuples. (These patches are against ‘core-updates’ but that works equally well on ‘master’, without a world rebuild.) My understanding of the code is that this change adds no overhead for packages written in the old style, and negligible overhead for packages written in the new style (calling ‘package-name’ instead of referring to a literal string for the label.) I haven’t tried to measure it though as it would require a massive conversion to the new style to be really measurable. I don’t think I need to expound on the benefits. :-) There are issues and open questions: • This hides labels, but they’re still visible as soon as one fiddles with ‘package-inputs’ & co. So this lowers the barrier to entry, but the difficulty of dealing with input tuples does not disappear entirely. • Both styles would be supported for a long time so contributors would still have to know about input tuples anyway. • There are packages that use custom labels as some sort of an abstraction. For instance, the “kernel-headers” label is associated either with ‘linux-libre-headers’ or with ‘hurd-headers’. In this case, the simplified style would use the package name as the label, which isn’t appropriate, or at least would require adjustments in packages that rely on this. • There are packages with same-named but different inputs, and they rely on having a different input label. • Some packages rely on labels that differ from the package name (this is what the ‘guix lint -c input-labels’ patch detects). For instance, commencement.scm has things like: `(("guile" ,%bootstrap-guile)) Automatic labeling would convert it to: `(("guile-bootstrap" ,%bootstrap-guile)) Not necessarily a problem: we can keep the old style for these. Common Lisp packages typically lack the “cl-” prefix in input labels but most likely they don’t actually refer to those labels, so we should be fine. • Packages such as ‘tzdata’ use labels to refer to non-package inputs. These cannot be converted to the automatic labeling style, or not without extra changes. • Currently, something like: (inputs (list glib)) is converted to: (inputs `(("glib" ,glib))) Should it, instead, be converted to: (inputs `(("glib" ,glib) ("glib:bin" ,glib "bin"))) ? This would make the concise style strictly less expressive, but maybe good enough? Ludovic Courtès (4): records: Support field sanitizers. DRAFT packages: Allow inputs to be plain package lists. DRAFT gnu: Change inputs of core packages to plain lists. DRAFT lint: Add 'input-labels' checker. gnu/packages/base.scm | 30 +++++++-------- gnu/packages/guile.scm | 87 ++++++++++-------------------------------- gnu/packages/mes.scm | 23 ++++------- guix/lint.scm | 35 +++++++++++++++++ guix/packages.scm | 35 +++++++++++++++-- guix/records.scm | 65 ++++++++++++++++++++++++------- tests/records.scm | 38 ++++++++++++++++++ 7 files changed, 198 insertions(+), 115 deletions(-) -- 2.31.1