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 yAdtMRT5kmBbKAEAgWs5BA (envelope-from ) for ; Wed, 05 May 2021 21:59:16 +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 QEYkLRT5kmC+HgAA1q6Kng (envelope-from ) for ; Wed, 05 May 2021 19:59:16 +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 541E2FBA9 for ; Wed, 5 May 2021 21:59:16 +0200 (CEST) Received: from localhost ([::1]:47766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leNfu-00085u-R3 for larch@yhetil.org; Wed, 05 May 2021 15:59:14 -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 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=1620244756; 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=+sFtdXTIvI0GqW7bfnvnZRh4/6wE/uz02jOtoszAG3M=; b=AOa8/YOVdBQrivaw1v4HjoUhrDdONjw/dFkpn8sp5qeLNzIhI8M3FNoiIJej1En3LDRp9m 8Cj3pvsEZ796OQpP4AEmwMu4UhWAQiZGf6MLdwyRQreRl41dZZRy5IJb/MExVOPGA1g3w4 +cMFfdr2mxH4XeUueeDuf9f7aFJworg7T2NgOPkFHM7wQoie77aoDobJRj0Df0YTwDn/r6 oXyeUGYTy4Jzvgpny8AeuXtLjVBrkyrCgzon5eW/e3L4bTgqEdxQHwwOPlA7fPO7o/jWCN K8+23DyNTdKrhRijJJCPQSfNWvZRgWJ6pOuUIsZ00B5KcRGzFQmNY9MLkzVCYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620244756; a=rsa-sha256; cv=none; b=hnqq/gPxywVr0+VXoOKtSk1/Jj7rZjns/2gz3RyBw3SFibhwmEibsl+fAmRwqDG687BWLe mD9MulSMFUod/jwZxZA9Yw9UgpcvaZhoQMT3BYk96L8voy95Su2ph8eQoV8YoITUtfDThu hZ09ZPGOpa5KiiSWpJhaahx0DQJkLbLKf4awxs9NxQPhEbTiY9YDzeivI6ZJwmGZEdv+Hb bshCQL/KEWvM4ZFAiOdcL6Ahjpld6lDQSgy3iORWqaGGhv1TvXEu9/PZ6AksFPN8Xpc6NX kmjZvLVDcAZFObSDamLj3B/DjX0HF2G54tVw7PoR7lt8D+rFfeLwj7FRvhY7Zg== 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.97 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: 541E2FBA9 X-Spam-Score: -1.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: gMyuBXh44EyM * 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))) -- 2.31.1