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 MG61JHCn0WCEJgAAgWs5BA (envelope-from ) for ; Tue, 22 Jun 2021 11:03:44 +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 sOZwIHCn0WC0JQAA1q6Kng (envelope-from ) for ; Tue, 22 Jun 2021 09:03:44 +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 9FD7019C05 for ; Tue, 22 Jun 2021 11:03:43 +0200 (CEST) Received: from localhost ([::1]:41674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvcJq-000592-9Q for larch@yhetil.org; Tue, 22 Jun 2021 05:03:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvcJC-00058J-Up for guix-patches@gnu.org; Tue, 22 Jun 2021 05:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvcJC-0007xm-Nn for guix-patches@gnu.org; Tue, 22 Jun 2021 05:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvcJC-0007cE-0Q for guix-patches@gnu.org; Tue, 22 Jun 2021 05:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49169] [PATCH 00/11] Removing input labels from package definitions Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Jun 2021 09:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49169 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49169@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162435256229245 (code B ref -1); Tue, 22 Jun 2021 09:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jun 2021 09:02:42 +0000 Received: from localhost ([127.0.0.1]:37771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvcIs-0007bc-Gi for submit@debbugs.gnu.org; Tue, 22 Jun 2021 05:02:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:57332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvcIq-0007bU-Ai for submit@debbugs.gnu.org; Tue, 22 Jun 2021 05:02:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvcIp-00053V-Vh for guix-patches@gnu.org; Tue, 22 Jun 2021 05:02:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52572) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvcIo-0007he-Q9; Tue, 22 Jun 2021 05:02:39 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49336 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 1lvcIj-0007d9-P0; Tue, 22 Jun 2021 05:02:38 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 22 Jun 2021 11:02:21 +0200 Message-Id: <20210622090221.15182-1-ludo@gnu.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=1624352623; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fI6ll7/D5E+ClITNTOYXi+pfPiOwygAOWoZh1rdquvc=; b=rBUl3teZL8f2wJKmmFhQQP8FPb4gsUWofLd9dX1G9henGGia41EUNtVLZzkfsz8vKBIJkr lelsVh8r5X5Nelzer+ZJgX1pV6sYswq0BEqt4TOJCZDiMs6ZjyXBrVb6ureJPr/wnqHgbq 3xDQ4iC5qjCLGt1fUkCV+xY5fOXoutIgxXiEu3Bc64csY9R828QNZzUVmikvC2g+QqG5Ej RIdlDJGJV4XMHuSX7pgNcn/3QEtdHcuH9nklbXCdw7AWfC07oq1On4hTrlvbgMAZrVvXQC zxq+vRhsYG4YxNPxF9kVSN24lUNyk3eGo5TCRbh8AkfzfQWSwbFYgZsXr7ZHfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624352623; a=rsa-sha256; cv=none; b=Q4JkD9JY75cFZj6ibip2tECIrvDacvWTJzgY6pufCUvY5PeSfM9ZC0fHUqsDuJd8uGxiFs DIYizpDbPsS2dbi/th4yDOECVGdCT7GzupmOyIxmZtLQ0vmkB+TTPojXQKr1g1XtEs3g/C myWeR0act2YZl+RTvskS5oOIyZ9Xrz86Q+S/InnfEtzr+MjAOBQHL0prinds/fdyWIpSeA 1OG1vn9fluDgZwZ+cSv223h6bv2545wMWTK0M+GT+CMYvxoz2Eq65pLtmJPphfjz0kLvZF PqVrxw0xV8mYKwwI8UTZMHQE5COGF9IGwh64XMV9IWylZuBadq7ij3XSAyIsQw== 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: -1.93 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: 9FD7019C05 X-Spam-Score: -1.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: c0e+veJiCxUT Hello Guix! This patch series does the ground work to remove input labels from package definitions. In other words: (package ;; … (inputs `(("libunistring" ,libunistring) ("libffi" ,libffi)))) becomes: (package ;; … (inputs (list libunistring libffi))) Note that it does not change the value returned by ‘package-inputs’ & co.: that still includes input labels. Likewise, build-side code does not see any difference (there are still input alists). Previous discussions at: https://lists.gnu.org/archive/html/guix-devel/2021-05/msg00343.html https://lists.gnu.org/archive/html/guix-devel/2021-06/msg00072.html The main change is the addition of ‘guix style’, based on the script I posted earlier. ‘guix style’ is able to systematically preserve comments (margin comments and line comments). It recognizes and “translates” several common idioms. In the long term, the goal is to remove input labels also from APIs like ‘package-inputs’. With an eye on this, I introduced the ‘modify-inputs’ macro as a replacement for idioms such as: `(("guile" ,guile-2.2) ,@(alist-delete "guile" (package-inputs foo))) which becomes: (modify-inputs (package-inputs foo) (replace "guile" guile-2.2)) Code that uses ‘modify-inputs’ does not assume that ‘package-inputs’ returns an alist. Thus, when we eventually change that, that code won’t need to be changed. (‘guix style’ performs this translation, too.) ‘guix style’ processes all 17K packages in ~3mn, leading to this: 447 files changed, 33385 insertions(+), 44079 deletions(-) This does not incur a single rebuild. Some packages are not handled by ‘guix style’ because the code pattern is not recognized or because input labels don’t match package names (often for no good reason). I don’t know what fraction of the packages is left behind; I’d guess less than a third of them. At this stage we have everything to start the migration and to even complete it rather quickly. What’s needed now is to look at corner cases and idioms that have no obvious translation in the new style. But you can help! 1. Check out the ‘wip-simplified-packages’ branch (based on ‘core-updates’). 2. Run ‘./pre-inst-env guix style’ (you can also list package names) and see whether your favorite packages are handled. 3. If you see packages not handled by ‘guix style’, try to convert them by hand. If you find an idiom that you don’t know how to “translate”, let’s discuss it! Thanks in advance! :-) Ludo’. Ludovic Courtès (11): records: Support field sanitizers. packages: Allow inputs to be plain package lists. lint: Add 'input-labels' checker. packages: Add 'lookup-package-input' & co. packages: Add 'modify-inputs'. gnu: Change inputs of core packages to plain lists. utils: 'edit-expression' no longer leaks file ports. utils: Add 'go-to-location' with source location caching. utils: 'edit-expression' modifies the file only if necessary. utils: 'edit-expression' copies part of the original source map. Add 'guix style'. Makefile.am | 2 + doc/guix.texi | 174 +++++++++++++-- gnu/packages/base.scm | 48 ++--- gnu/packages/guile.scm | 103 +++------ gnu/packages/mes.scm | 25 +-- guix/lint.scm | 36 ++++ guix/packages.scm | 145 ++++++++++++- guix/records.scm | 65 ++++-- guix/scripts/style.scm | 475 +++++++++++++++++++++++++++++++++++++++++ guix/utils.scm | 151 ++++++++++--- po/guix/POTFILES.in | 1 + tests/lint.scm | 14 ++ tests/packages.scm | 86 ++++---- tests/records.scm | 38 ++++ tests/style.scm | 328 ++++++++++++++++++++++++++++ 15 files changed, 1455 insertions(+), 236 deletions(-) create mode 100644 guix/scripts/style.scm create mode 100644 tests/style.scm base-commit: d1827d5c636adb395153a4ed6064629ed5b7664b -- 2.32.0