From patchwork Wed May 5 19:58:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 29140 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 36E7127BC82; Wed, 5 May 2021 20:59:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B450B27BC81 for ; Wed, 5 May 2021 20:59:17 +0100 (BST) Received: from localhost ([::1]:47766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leNfw-00085u-TD for patchwork@mira.cbaines.net; Wed, 05 May 2021 15:59:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leNfi-00085m-Da for guix-patches@gnu.org; Wed, 05 May 2021 15:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leNfi-0002T7-5w for guix-patches@gnu.org; Wed, 05 May 2021 15:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1leNfi-0001ir-4m for guix-patches@gnu.org; Wed, 05 May 2021 15:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48243] [PATCH] weather: '--display-missing' shows the system type of missing items. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 May 2021 19:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48243 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48243@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.16202447126608 (code B ref -1); Wed, 05 May 2021 19:59:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 May 2021 19:58:32 +0000 Received: from localhost ([127.0.0.1]:34123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leNfE-0001iW-BV for submit@debbugs.gnu.org; Wed, 05 May 2021 15:58:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:49368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leNfB-0001iQ-TH for submit@debbugs.gnu.org; Wed, 05 May 2021 15:58:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leNfA-00083V-QD for guix-patches@gnu.org; Wed, 05 May 2021 15:58:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60146) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leNf7-00024T-VJ; Wed, 05 May 2021 15:58:27 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39168 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1leNf7-0002GW-4B; Wed, 05 May 2021 15:58:25 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 5 May 2021 21:58:19 +0200 Message-Id: <20210505195819.10924-1-ludo@gnu.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/weather.scm (store-item-system): New procedure. (report-server-coverage): Use it to print the system type of each missing item. --- guix/scripts/weather.scm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) Hi! The result of this change is an extra column, when using ‘--display-missing’, that shows the system type of missing items: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix weather --display-missing guix libreoffice inkscape linux-libre -s armhf-linux -s powerpc64le-linux -s x86_64-linux -s aarch64-linux [...] Substitutes are missing for the following items: /gnu/store/n317afb5f14h7hkxz7ycscd6mhda9plm-libreoffice-6.4.7.2 aarch64-linux /gnu/store/xwx5qsalgp3v7vyn6hpvsdy2j59b1973-inkscape-1.0.2 aarch64-linux /gnu/store/8zvik3qkh24jrp1dxqmqg17cw002xs90-linux-libre-5.11.18 aarch64-linux /gnu/store/463m6ikbvi071jq5m8cj4gpgcgd0lw6a-guix-1.2.0-21.4dff6ec powerpc64le-linux /gnu/store/lblmg73hbrf051zmzicdp8pfzc47knnx-libreoffice-6.4.7.2 powerpc64le-linux /gnu/store/rbf85wfw1v59035l8jz1rcxf72ajbhsp-inkscape-1.0.2 powerpc64le-linux /gnu/store/mxjlc83k40xgjq5qilvp65v82794p1jd-guix-1.2.0-21.4dff6ec armhf-linux /gnu/store/d2ap2kdv1rm39awc4lz5psrsq7l3mklc-libreoffice-6.4.7.2 armhf-linux /gnu/store/mvdwc2zyg5brkxfp7cazba8bxn9fp4wk-inkscape-1.0.2 armhf-linux /gnu/store/d5ximwvsizr4my1ib4i4mnwk0hdzmn00-linux-libre-5.11.18 armhf-linux --8<---------------cut here---------------end--------------->8--- I find the extra info to be very useful, in particular when looking at the weather of ‘etc/release-manifest.scm’, which targets all the supported architectures. Thoughts? Ludo’. diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 5164fe0494..6d925d416c 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2018 Kyle Meyer ;;; Copyright © 2020 Simon Tournier @@ -171,6 +171,16 @@ about the derivations queued, as is the case with Hydra." #f ;no derivation information (lset-intersection string=? queued items))) +(define (store-item-system store item) + "Return the system (a string such as \"aarch64-linux\")) ITEM targets, +or #f if it could not be determined." + (match (valid-derivers store item) + ((drv . _) + (and=> (false-if-exception (read-derivation-from-file drv)) + derivation-system)) + (() + #f))) + (define* (report-server-coverage server items #:key display-missing?) "Report the subset of ITEMS available as substitutes on SERVER. @@ -270,7 +280,22 @@ are queued~%") (when (and display-missing? (not (null? missing))) (newline) (format #t (G_ "Substitutes are missing for the following items:~%")) - (format #t "~{ ~a~%~}" missing)) + + ;; Display two columns: store items, and their system type. + (format #t "~:{ ~a ~a~%~}" + (zip (map (let ((width (max (- (current-terminal-columns) + 20) + 0))) + (lambda (item) + (if (> (string-length item) width) + item + (string-pad-right item width)))) + missing) + (with-store store + (map (lambda (item) + (or (store-item-system store item) + (G_ "unknown system"))) + missing))))) ;; Return the coverage ratio. (let ((total (length items)))