From unknown Thu Jun 19 14:16:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54344] [PATCH 0/3] Add 'guix home extension-graph' and 'shepherd-graph' Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, guix-patches@gnu.org Resent-Date: Fri, 11 Mar 2022 21:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54344@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Andrew Tropin X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Andrew Tropin Received: via spool by submit@debbugs.gnu.org id=B.164703436515321 (code B ref -1); Fri, 11 Mar 2022 21:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Mar 2022 21:32:45 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmsP-0003z3-14 for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:32:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:48912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmsN-0003yv-1G for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:32:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmsM-0006MC-RL for guix-patches@gnu.org; Fri, 11 Mar 2022 16:32:42 -0500 Received: from [2001:470:142:3::e] (port=33198 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmsM-0000ge-7Q; Fri, 11 Mar 2022 16:32:42 -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:Subject:To:From:in-reply-to: references; bh=Yfee+EhcERbZxByXWNilW2MdH6ZEuMehVEnERg2nfPs=; b=Y60qUK8PsSTyLT omZrX6m1oTBCTUCxQDx7T775JzRuaI8dZ/5i5MI/n78otwypP2rgZsnsVNXr3rh7MX7sf/mI/zm+S H8xeb9dV0hP+7rv7nFUiuCrEHXe7ZRg5kTO9LiXKiIEoGAQPr0j3WzKSdhpGRf7MWwYZNSvgqsswq InjQxVuCVZ8iRBdurNvoLlANjT9o6llMWuFH412BS6Im96c36a4nCOxyU+QoDPsb9mEQ++JTQb3nI AC+KncFdzS4A/LUfrunW0sLiwOMPBPNEo3Jwcyrc5VsNvTOFR6Vd41rA5mcoNFde8dRMv/g20mGji iAb0CAfN5QFxr6YQ3bsg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:61902 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 1nSmsK-0002yu-Rs; Fri, 11 Mar 2022 16:32:41 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 11 Mar 2022 22:32:33 +0100 Message-Id: <20220311213233.12415-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! These patches implement ‘guix home extension-graph’ and ‘guix home shepherd-graph’, similar to what ‘guix system’ provides. Until now these two commands were silently ignored. Thoughts? Ludo’. Ludovic Courtès (3): graph: Factorize 'lookup-backend'. home: services: Export record type accessors. guix home: Implement the 'extension-graph' and 'shepherd-graph' actions. doc/guix.texi | 31 +++++++++ gnu/home/services/shepherd.scm | 21 +++++- guix/graph.scm | 14 +++- guix/scripts/graph.scm | 9 +-- guix/scripts/home.scm | 117 +++++++++++++++++++++++++-------- guix/scripts/system.scm | 14 ++-- po/guix/POTFILES.in | 1 + tests/guix-home.sh | 8 +++ 8 files changed, 165 insertions(+), 50 deletions(-) base-commit: 5397c18157f12e9127b5a9a59b0aa5a4eb058839 -- 2.34.0 From unknown Thu Jun 19 14:16:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54344] [PATCH 1/3] graph: Factorize 'lookup-backend'. References: <20220311213233.12415-1-ludo@gnu.org> In-Reply-To: <20220311213233.12415-1-ludo@gnu.org> Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Mar 2022 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54344@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54344-submit@debbugs.gnu.org id=B54344.164703447315548 (code B ref 54344); Fri, 11 Mar 2022 21:35:02 +0000 Received: (at 54344) by debbugs.gnu.org; 11 Mar 2022 21:34:33 +0000 Received: from localhost ([127.0.0.1]:38519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmu8-00042g-KJ for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmu7-00042O-Ij for 54344@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:32 -0500 Received: from [2001:470:142:3::e] (port=33216 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmu2-0000ov-A7; Fri, 11 Mar 2022 16:34:26 -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:Subject:To:From:in-reply-to: references; bh=MXM8oyYtSLL9FSzjt0xCobYF969sfKjV50Q+9x4wJ2U=; b=dZQeVWSrR1gXt9 laOTTWUDiWMMCk1l69cxu5VKG+gdY44pTzHQgSvDYPuuAlVQv7HgYf40uI5JT8eRmr1j1dkTKVxot EsuDTOeGude5Dq1x7ECZqp2fJxLfU/elDkyjIxuER+uC70ydEcFMfjzgqkeyFTwF377v/oyEgWlVc W9dbNAP1EQvuX2jGfhUielB/xSVhiJ33EHZ4x0iuoZ8HRTRzKsBKxE29Wrg+ayUC9LAjC0KDtrwl3 lyvBGUaL4fh9rfmgGHg8aJ7J0XtDKMRUFc6p9k76KUZYxwIC1puM2i5HHqtAh/raFSqKS8UEZMjNQ R5X8zI8cJUmygmSFTBtg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58671 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 1nSmu1-0003hy-Pj; Fri, 11 Mar 2022 16:34:25 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 11 Mar 2022 22:34:16 +0100 Message-Id: <20220311213418.12472-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/graph.scm (lookup-backend): New procedure. * guix/scripts/graph.scm (lookup-backend): Remove. * guix/scripts/system.scm (lookup-backend): Remove. * po/guix/POTFILES.in: Add 'guix/graph.scm'. --- guix/graph.scm | 14 +++++++++++++- guix/scripts/graph.scm | 9 +-------- guix/scripts/system.scm | 9 +-------- po/guix/POTFILES.in | 1 + 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/guix/graph.scm b/guix/graph.scm index 3a1cab244b..41219ab67d 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2020, 2021 Ludovic Courtès +;;; Copyright © 2015-2016, 2020-2022 Ludovic Courtès ;;; Copyright © 2016 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. @@ -22,10 +22,13 @@ (define-module (guix graph) #:use-module (guix monads) #:use-module (guix records) #:use-module (guix sets) + #:autoload (guix diagnostics) (formatted-message) + #:autoload (guix i18n) (G_) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (ice-9 match) #:use-module (ice-9 vlist) #:export (node-type @@ -47,6 +50,8 @@ (define-module (guix graph) %graph-backends %d3js-backend %graphviz-backend + lookup-backend + graph-backend? graph-backend graph-backend-name @@ -335,6 +340,13 @@ (define %graph-backends %d3js-backend %cypher-backend)) +(define (lookup-backend name) + "Return the graph backend called NAME. Raise an error if it is not found." + (or (find (lambda (backend) + (string=? (graph-backend-name backend) name)) + %graph-backends) + (raise (formatted-message (G_ "~a: unknown graph backend") name)))) + (define* (export-graph sinks port #:key reverse-edges? node-type (max-depth +inf.0) diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 8943e87099..535875c858 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2015-2022 Ludovic Courtès ;;; Copyright © 2019 Simon Tournier ;;; ;;; This file is part of GNU Guix. @@ -429,13 +429,6 @@ (define (lookup-node-type name) %node-types) (leave (G_ "~a: unknown node type~%") name))) -(define (lookup-backend name) - "Return the graph backend called NAME. Raise an error if it is not found." - (or (find (lambda (backend) - (string=? (graph-backend-name backend) name)) - %graph-backends) - (leave (G_ "~a: unknown backend~%") name))) - (define (list-node-types) "Print the available node types along with their synopsis." (display (G_ "The available node types are:\n")) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index a6e717d52c..6f7dcd4643 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -51,7 +51,7 @@ (define-module (guix scripts system) delete-matching-generations) #:autoload (guix scripts pull) (channel-commit-hyperlink) #:autoload (guix graph) (export-graph node-type - graph-backend-name %graph-backends) + graph-backend-name lookup-backend) #:use-module (guix scripts graph) #:use-module (guix scripts system reconfigure) #:use-module (guix build utils) @@ -887,13 +887,6 @@ (define bootcfg (register-root* (list output) gc-root)) (return output))))))))) -(define (lookup-backend name) ;TODO: factorize - "Return the graph backend called NAME. Raise an error if it is not found." - (or (find (lambda (backend) - (string=? (graph-backend-name backend) name)) - %graph-backends) - (leave (G_ "~a: unknown backend~%") name))) - (define* (export-extension-graph os port #:key (backend (lookup-backend "graphviz"))) "Export the service extension graph of OS to PORT using BACKEND." diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index d97ba8c209..49a8edfef3 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -66,6 +66,7 @@ guix/ci.scm guix/cve.scm guix/git-authenticate.scm guix/gnupg.scm +guix/graph.scm guix/lint.scm guix/scripts/download.scm guix/scripts/package.scm -- 2.34.0 From unknown Thu Jun 19 14:16:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54344] [PATCH 2/3] home: services: Export record type accessors. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Mar 2022 21:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54344@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54344-submit@debbugs.gnu.org id=B54344.164703447415562 (code B ref 54344); Fri, 11 Mar 2022 21:35:03 +0000 Received: (at 54344) by debbugs.gnu.org; 11 Mar 2022 21:34:34 +0000 Received: from localhost ([127.0.0.1]:38523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmuA-00042v-6R for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmu8-00042P-1f for 54344@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:32 -0500 Received: from [2001:470:142:3::e] (port=33218 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmu2-0000p1-Pv; Fri, 11 Mar 2022 16:34:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=/n+C3j+yTt9wDUCrwygMxduJh0mPz8d1Qcu1JXTUqQU=; b=NEBxqgilZ2fGunWqDkXR fXPWdhkzLp4IbY8bFOB8zV0mJCa5uIR67ALWRABjqsWVFuUgXn7puy6/Z66Tqxrcr2IghetqATHkN 4Tp6Z+JsLQ0lQHjNm5rN/Y1McGKl/mLYHto+Tz8SsVRb4VpDGAXjFSK0Xdj2oeIWLlphAulwNLGbl Aqu3eBZpDBVuqCqTJT4VEZ35k6mhPMksR7EZxCS2d0LvzE9dOCHhmCORt4x8G71XRHowEB6IPLFdr AArsJ9VZTE/cAy12W+JOqzjA5uZMH2ovJ79jMZ4ZgY1wxNNy4pQAuf7BBSFZNRju+DRgWEnLN8HSm NKgVaYuW0oKOrg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58671 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 1nSmu2-0003hy-CV; Fri, 11 Mar 2022 16:34:26 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 11 Mar 2022 22:34:17 +0100 Message-Id: <20220311213418.12472-2-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220311213418.12472-1-ludo@gnu.org> References: <20220311213418.12472-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/home/services/shepherd.scm: Export accessors. Re-export accessors. --- gnu/home/services/shepherd.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index 7a9cc064bb..feff130259 100644 --- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -24,12 +24,27 @@ (define-module (gnu home services shepherd) #:use-module (guix sets) #:use-module (guix gexp) #:use-module (guix records) - #:use-module (srfi srfi-1) - #:export (home-shepherd-service-type - home-shepherd-configuration) + + home-shepherd-configuration + home-shepherd-configuration? + home-shepherd-configuration-shepherd + home-shepherd-configuration-auto-start? + home-shepherd-configuration-services) #:re-export (shepherd-service + shepherd-service? + shepherd-service-documentation + shepherd-service-provision + shepherd-service-canonical-name + shepherd-service-requirement + shepherd-service-one-shot? + shepherd-service-respawn? + shepherd-service-start + shepherd-service-stop + shepherd-service-auto-start? + shepherd-service-modules + shepherd-action)) (define-record-type* -- 2.34.0 From unknown Thu Jun 19 14:16:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54344] [PATCH 3/3] guix home: Implement the 'extension-graph' and 'shepherd-graph' actions. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Mar 2022 21:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54344@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54344-submit@debbugs.gnu.org id=B54344.164703447815572 (code B ref 54344); Fri, 11 Mar 2022 21:35:03 +0000 Received: (at 54344) by debbugs.gnu.org; 11 Mar 2022 21:34:38 +0000 Received: from localhost ([127.0.0.1]:38525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmuA-00042x-Ea for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmu8-00042R-KN for 54344@debbugs.gnu.org; Fri, 11 Mar 2022 16:34:33 -0500 Received: from [2001:470:142:3::e] (port=33220 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmu3-0000pJ-Cz; Fri, 11 Mar 2022 16:34:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=bgMN7RQwj2jm+2+WatcTQlSz40Kns5hXaSha/yMFkk4=; b=q9m0L1S3odorCFrnu4Fy fXrf9fvy5aLxjqoI5L72m38xXH0crsA0RnsJgK4Q4uPPNvwefVDjLS/ldb69cff2sPLToVRslclnn qh6+fr3BQU7BZODUACRZ3O37XJl0XcrsWFY3GfiS6o/IMr3lazJy+FmYt855lpixSFgeYS8Wwaukj v1EtE3w7RfAnopNVl+36+gbQYLrMsYSQWdY/8QbYMX0bLLK19S//p7XSt8gvm/ut6tu4uY95eQXSL A6/1Bkc5Yhsy6929q4RDpEdT0TkrKdNLnB3mSVTQRm8xlP16n7+AHKdpYfVe5pAiIY3QMcQK8byhh Tc+dT+TXPkS+LQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58671 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 1nSmu2-0003hy-VY; Fri, 11 Mar 2022 16:34:27 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 11 Mar 2022 22:34:18 +0100 Message-Id: <20220311213418.12472-3-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220311213418.12472-1-ludo@gnu.org> References: <20220311213418.12472-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Until now these two actions were silently ignored. * guix/scripts/home.scm (show-help, %options): Add "--graph-backend". (%default-options): Add 'graph-backend' key. (export-extension-graph, export-shepherd-graph): New procedures. (perform-action): Add #:graph-backend parameter. Add cases for the 'extension-graph' and 'shepherd-graph' actions. (process-action): Pass #:graph-backend to 'perform-action'. * guix/scripts/system.scm (service-node-type) (shepherd-service-node-type): Export * tests/guix-home.sh: Add tests. * doc/guix.texi (Invoking guix home): Document it. --- doc/guix.texi | 31 +++++++++++ guix/scripts/home.scm | 117 ++++++++++++++++++++++++++++++---------- guix/scripts/system.scm | 5 +- tests/guix-home.sh | 8 +++ 4 files changed, 131 insertions(+), 30 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4b71fb7010..e7d862f5be 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -38848,7 +38848,38 @@ environment. Note that not every home service that exists is supported $ guix home import ~/guix-config guix home: '/home/alice/guix-config' populated with all the Home configuration files @end example +@end table +And there's more! @command{guix home} also provides the follow +sub-commands to visualize how the services of your home environment +relate to one another: + +@table @code +@cindex service extension graph, of a home environment +@item extension-graph +Emit to standard output the @dfn{service extension graph} of the home +environment defined in @var{file} (@pxref{Service Composition}, for more +information on service extensions). By default the output is in +Dot/Graphviz format, but you can choose a different format with +@option{--graph-backend}, as with @command{guix graph} (@pxref{Invoking +guix graph, @option{--backend}}): + +The command: + +@example +$ guix home extension-graph @var{file} | xdot - +@end example + +shows the extension relations among services. + +@cindex Shepherd dependency graph, for a home environment +@item shepherd-graph +Emit to standard output the @dfn{dependency graph} of shepherd services +of the home environment defined in @var{file}. @xref{Shepherd +Services}, for more information and for an example graph. + +Again, the default output format is Dot/Graphviz, but you can pass +@option{--graph-backend} to select a different one. @end table @var{options} can contain any of the common build options (@pxref{Common diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 837fd96361..db98a1df48 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Oleg Pykhalov +;;; Copyright © 2022 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,9 @@ (define-module (guix scripts home) #:use-module (gnu packages) #:use-module (gnu home) #:use-module (gnu home services) + #:autoload (gnu home services shepherd) (home-shepherd-service-type + home-shepherd-configuration-services + shepherd-service-requirement) #:use-module (guix channels) #:use-module (guix derivations) #:use-module (guix ui) @@ -33,13 +37,16 @@ (define-module (guix scripts home) #:use-module (guix profiles) #:use-module (guix store) #:use-module (guix utils) + #:autoload (guix graph) (lookup-backend export-graph) #:use-module (guix scripts) #:use-module (guix scripts package) #:use-module (guix scripts build) #:autoload (guix scripts system search) (service-type->recutils) #:use-module (guix scripts system reconfigure) #:autoload (guix scripts pull) (channel-commit-hyperlink) - #:use-module (guix scripts home import) + #:autoload (guix scripts system) (service-node-type + shepherd-service-node-type) + #:autoload (guix scripts home import) (import-manifest) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module (guix gexp) @@ -87,6 +94,10 @@ (define (show-help) build build the home environment without installing anything\n")) (display (G_ "\ import generates a home environment definition from dotfiles\n")) + (display (G_ "\ + extension-graph emit the service extension graph\n")) + (display (G_ "\ + shepherd-graph emit the graph of shepherd services\n")) (show-build-options-help) (display (G_ " @@ -97,6 +108,9 @@ (define (show-help) channel revisions")) (display (G_ " -v, --verbosity=LEVEL use the given verbosity LEVEL")) + (display (G_ " + --graph-backend=BACKEND + use BACKEND for 'extension-graph' and 'shepherd-graph'")) (newline) (display (G_ " -h, --help display this help and exit")) @@ -136,6 +150,10 @@ (define %options (alist-cons 'validate-reconfigure warn-about-backward-reconfigure result))) + (option '("graph-backend") #t #f + (lambda (opt name arg result) + (alist-cons 'graph-backend arg result))) + %standard-build-options)) (define %default-options @@ -147,18 +165,49 @@ (define %default-options (multiplexed-build-output? . #t) (verbosity . #f) ;default (debug . 0) - (validate-reconfigure . ,ensure-forward-reconfigure))) + (validate-reconfigure . ,ensure-forward-reconfigure) + (graph-backend . "graphviz"))) ;;; ;;; Actions. ;;; +(define* (export-extension-graph home port + #:key (backend (lookup-backend "graphviz"))) + "Export the service extension graph of HOME to PORT using BACKEND." + (let* ((services (home-environment-services home)) + (home (find (lambda (service) + (eq? (service-kind service) home-service-type)) + services))) + (export-graph (list home) (current-output-port) + #:backend backend + #:node-type (service-node-type services) + #:reverse-edges? #t))) + +(define* (export-shepherd-graph home port + #:key (backend (lookup-backend "graphviz"))) + "Export the graph of shepherd services of HOME to PORT using BACKEND." + (let* ((services (home-environment-services home)) + (root (fold-services services + #:target-type home-shepherd-service-type)) + ;; Get the list of . + (shepherds (home-shepherd-configuration-services + (service-value root))) + (sinks (filter (lambda (service) + (null? (shepherd-service-requirement service))) + shepherds))) + (export-graph sinks (current-output-port) + #:backend backend + #:node-type (shepherd-service-node-type shepherds) + #:reverse-edges? #t))) + (define* (perform-action action he #:key dry-run? derivations-only? use-substitutes? + (graph-backend "graphviz") (validate-reconfigure ensure-forward-reconfigure)) "Perform ACTION for home environment. " @@ -169,35 +218,43 @@ (define println (check-forward-update validate-reconfigure #:current-channels (home-provenance %guix-home))) - (mlet* %store-monad - ((he-drv (home-environment-derivation he)) - (drvs (mapm/accumulate-builds lower-object (list he-drv))) - (% (if derivations-only? - (return - (for-each (compose println derivation-file-name) drvs)) - (built-derivations drvs))) + (case action + ((extension-graph) + (export-extension-graph he (current-output-port) + #:backend (lookup-backend graph-backend))) + ((shepherd-graph) + (export-shepherd-graph he (current-output-port) + #:backend (lookup-backend graph-backend))) + (else + (mlet* %store-monad + ((he-drv (home-environment-derivation he)) + (drvs (mapm/accumulate-builds lower-object (list he-drv))) + (% (if derivations-only? + (return + (for-each (compose println derivation-file-name) drvs)) + (built-derivations drvs))) - (he-out-path -> (derivation->output-path he-drv))) - (if (or dry-run? derivations-only?) - (return #f) - (begin - (for-each (compose println derivation->output-path) drvs) + (he-out-path -> (derivation->output-path he-drv))) + (if (or dry-run? derivations-only?) + (return #f) + (begin + (for-each (compose println derivation->output-path) drvs) - (case action - ((reconfigure) - (let* ((number (generation-number %guix-home)) - (generation (generation-file-name - %guix-home (+ 1 number)))) + (case action + ((reconfigure) + (let* ((number (generation-number %guix-home)) + (generation (generation-file-name + %guix-home (+ 1 number)))) - (switch-symlinks generation he-out-path) - (switch-symlinks %guix-home generation) - (setenv "GUIX_NEW_HOME" he-out-path) - (primitive-load (string-append he-out-path "/activate")) - (setenv "GUIX_NEW_HOME" #f) - (return he-out-path))) - (else - (newline) - (return he-out-path))))))) + (switch-symlinks generation he-out-path) + (switch-symlinks %guix-home generation) + (setenv "GUIX_NEW_HOME" he-out-path) + (primitive-load (string-append he-out-path "/activate")) + (setenv "GUIX_NEW_HOME" #f) + (return he-out-path))) + (else + (newline) + (return he-out-path))))))))) (define (process-action action args opts) "Process ACTION, a sub-command, with the arguments are listed in ARGS. @@ -256,7 +313,9 @@ (define (ensure-home-environment file-or-exp obj) #:derivations-only? (assoc-ref opts 'derivations-only?) #:use-substitutes? (assoc-ref opts 'substitutes?) #:validate-reconfigure - (assoc-ref opts 'validate-reconfigure)))))) + (assoc-ref opts 'validate-reconfigure) + #:graph-backend + (assoc-ref opts 'graph-backend)))))) (warn-about-disk-space))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 6f7dcd4643..55e9b8ba30 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -88,7 +88,10 @@ (define-module (guix scripts system) #:use-module (ice-9 match) #:use-module (rnrs bytevectors) #:export (guix-system - read-operating-system)) + read-operating-system + + service-node-type + shepherd-service-node-type)) ;;; diff --git a/tests/guix-home.sh b/tests/guix-home.sh index f054d15172..48dbcbd28f 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -93,6 +93,14 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT "# the content of bashrc-test-config.sh")))))))) EOF + # Check whether the graph commands work as expected. + guix home extension-graph "home.scm" | grep 'label = "home-activation"' + guix home extension-graph "home.scm" | grep 'label = "home-symlink-manager"' + guix home extension-graph "home.scm" | grep 'label = "home"' + + # There are no Shepherd services so the one below must fail. + ! guix home shepherd-graph "home.scm" + guix home reconfigure "${test_directory}/home.scm" test -d "${HOME}/.guix-home" test -h "${HOME}/.bash_profile" -- 2.34.0 From unknown Thu Jun 19 14:16:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54344] [PATCH 3/3] guix home: Implement the 'extension-graph' and 'shepherd-graph' actions. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Mar 2022 05:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 54344@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54344-submit@debbugs.gnu.org id=B54344.164749410521583 (code B ref 54344); Thu, 17 Mar 2022 05:16:02 +0000 Received: (at 54344) by debbugs.gnu.org; 17 Mar 2022 05:15:05 +0000 Received: from localhost ([127.0.0.1]:52766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUiTV-0005bO-5W for submit@debbugs.gnu.org; Thu, 17 Mar 2022 01:15:04 -0400 Received: from mail-lf1-f45.google.com ([209.85.167.45]:36714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUiTS-0005b8-De for 54344@debbugs.gnu.org; Thu, 17 Mar 2022 01:14:59 -0400 Received: by mail-lf1-f45.google.com with SMTP id bt26so7191882lfb.3 for <54344@debbugs.gnu.org>; Wed, 16 Mar 2022 22:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=QxPfbSHeM/D9ZE3yO0Ned23c+JzwDW7gCIDzD33MC50=; b=LgbJ7f/RgmGMw79Fh7a4D6ld+v4S21tOLm6/XXzg0ikOqdGTqalI4lToypt0lrRBFQ O4R0fmC2Z12StTx1LjHtv2gy7a8v/Bgxi5HbNRqxfDVAQVAe2nBnGIpySgxsU0npPFft ZHRrii6CysVA7/QuY22htOPGNYDZ2HNzhklazGaG6A2WWEwfugloX+NlLACPE7tCbjFG bkv6aUsIs/AXxc7+sfJr7vgoAJmcSpYYYxEEYcpwsDvH/GW1yRWxFKVlMTbbsDZt2nSX 8JDYTAc/njvYkdDRE6P9QPDilWWR3Sfc+5+8TUpg02Lg9zNzqA6KdJWAwGzWanc5N+tK 0iIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=QxPfbSHeM/D9ZE3yO0Ned23c+JzwDW7gCIDzD33MC50=; b=6xrm0L1E5Yt72/tNIwmF4J+0tUqaMWoRgKFVq03YMutYBCMZR5DjMLWdevTfSxJoNe k/WZjnfKJ6CQ0QTHAxzsWY6WzmTXduf/bSFKTVGYNn/XGUevxSbcB+xuQWpXSAo9PJ4n RCVML8h1oyx1wYXBx9QytLwa9Th5X+qvSDzjhoXnd+8LkshuaBbks8QARczI2MA9ajUP /LwgFz9vGGH4ISze5aF37H9csGDyjCGhmCKQHNSv5+8y4MBpJj22CAyBYCQk0NjoT7rW hyjon9SEEAXpcTK6NRCaZ42D6KFAnTu5PrF5gkMg8L03EIydTQaDZxJbsMwnuM2ymXyq 9kRQ== X-Gm-Message-State: AOAM530Zj4avgu3A3lRquyUB+L0P02fSqxwR6fZ/mVHGst6jMn6UKuiR GATVrKkUWMwbf4f51RaRhUERZ/kNPvYd2c7X X-Google-Smtp-Source: ABdhPJxEzXwHsN3xjeKDGEH3NvrLO5ymxDrKBnefu55MXRSnBF+SYk0hfEHl8JLecRfF+Wx2uRcDVw== X-Received: by 2002:a05:6512:2383:b0:448:1d9e:589f with SMTP id c3-20020a056512238300b004481d9e589fmr1743360lfv.649.1647494091943; Wed, 16 Mar 2022 22:14:51 -0700 (PDT) Received: from localhost (109-252-132-136.dynamic.spd-mgts.ru. [109.252.132.136]) by smtp.gmail.com with ESMTPSA id u19-20020a197913000000b00448a1f20261sm339322lfc.34.2022.03.16.22.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:14:51 -0700 (PDT) From: Andrew Tropin In-Reply-To: <20220311213418.12472-3-ludo@gnu.org> References: <20220311213418.12472-1-ludo@gnu.org> <20220311213418.12472-3-ludo@gnu.org> Date: Thu, 17 Mar 2022 08:14:47 +0300 Message-ID: <874k3xjh2w.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2022-03-11 22:34, Ludovic =?UTF-8?Q?Court=C3=A8s?= wrote: > Until now these two actions were silently ignored. > > * guix/scripts/home.scm (show-help, %options): Add "--graph-backend". > (%default-options): Add 'graph-backend' key. > (export-extension-graph, [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.45 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.45 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-03-11 22:34, Ludovic Court=C3=A8s wrote: > Until now these two actions were silently ignored. > > * guix/scripts/home.scm (show-help, %options): Add "--graph-backend". > (%default-options): Add 'graph-backend' key. > (export-extension-graph, export-shepherd-graph): New procedures. > (perform-action): Add #:graph-backend parameter. Add cases for the > 'extension-graph' and 'shepherd-graph' actions. > (process-action): Pass #:graph-backend to 'perform-action'. > * guix/scripts/system.scm (service-node-type) > (shepherd-service-node-type): Export > * tests/guix-home.sh: Add tests. > * doc/guix.texi (Invoking guix home): Document it. > --- > doc/guix.texi | 31 +++++++++++ > guix/scripts/home.scm | 117 ++++++++++++++++++++++++++++++---------- > guix/scripts/system.scm | 5 +- > tests/guix-home.sh | 8 +++ > 4 files changed, 131 insertions(+), 30 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 4b71fb7010..e7d862f5be 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -38848,7 +38848,38 @@ environment. Note that not every home service t= hat exists is supported > $ guix home import ~/guix-config > guix home: '/home/alice/guix-config' populated with all the Home configu= ration files > @end example > +@end table >=20=20 > +And there's more! @command{guix home} also provides the follow s/follow/following > +sub-commands to visualize how the services of your home environment > +relate to one another: > + > +@table @code > +@cindex service extension graph, of a home environment > +@item extension-graph > +Emit to standard output the @dfn{service extension graph} of the home > +environment defined in @var{file} (@pxref{Service Composition}, for more > +information on service extensions). By default the output is in > +Dot/Graphviz format, but you can choose a different format with > +@option{--graph-backend}, as with @command{guix graph} (@pxref{Invoking > +guix graph, @option{--backend}}): > + > +The command: > + > +@example > +$ guix home extension-graph @var{file} | xdot - > +@end example > + > +shows the extension relations among services. > + > +@cindex Shepherd dependency graph, for a home environment > +@item shepherd-graph > +Emit to standard output the @dfn{dependency graph} of shepherd services > +of the home environment defined in @var{file}. @xref{Shepherd > +Services}, for more information and for an example graph. > + > +Again, the default output format is Dot/Graphviz, but you can pass > +@option{--graph-backend} to select a different one. > @end table >=20=20 > @var{options} can contain any of the common build options (@pxref{Common > diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm > index 837fd96361..db98a1df48 100644 > --- a/guix/scripts/home.scm > +++ b/guix/scripts/home.scm > @@ -3,6 +3,7 @@ > ;;; Copyright =C2=A9 2021 Xinglu Chen > ;;; Copyright =C2=A9 2021 Pierre Langlois > ;;; Copyright =C2=A9 2021 Oleg Pykhalov > +;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -25,6 +26,9 @@ (define-module (guix scripts home) > #:use-module (gnu packages) > #:use-module (gnu home) > #:use-module (gnu home services) > + #:autoload (gnu home services shepherd) (home-shepherd-service-type > + home-shepherd-configuration= -services > + shepherd-service-requiremen= t) > #:use-module (guix channels) > #:use-module (guix derivations) > #:use-module (guix ui) > @@ -33,13 +37,16 @@ (define-module (guix scripts home) > #:use-module (guix profiles) > #:use-module (guix store) > #:use-module (guix utils) > + #:autoload (guix graph) (lookup-backend export-graph) > #:use-module (guix scripts) > #:use-module (guix scripts package) > #:use-module (guix scripts build) > #:autoload (guix scripts system search) (service-type->recutils) > #:use-module (guix scripts system reconfigure) > #:autoload (guix scripts pull) (channel-commit-hyperlink) > - #:use-module (guix scripts home import) > + #:autoload (guix scripts system) (service-node-type > + shepherd-service-node-type) > + #:autoload (guix scripts home import) (import-manifest) > #:use-module ((guix status) #:select (with-status-verbosity)) > #:use-module ((guix build utils) #:select (mkdir-p)) > #:use-module (guix gexp) > @@ -87,6 +94,10 @@ (define (show-help) > build build the home environment without installing anyt= hing\n")) > (display (G_ "\ > import generates a home environment definition from dotfi= les\n")) > + (display (G_ "\ > + extension-graph emit the service extension graph\n")) > + (display (G_ "\ > + shepherd-graph emit the graph of shepherd services\n")) >=20=20 > (show-build-options-help) > (display (G_ " > @@ -97,6 +108,9 @@ (define (show-help) > channel revisions")) > (display (G_ " > -v, --verbosity=3DLEVEL use the given verbosity LEVEL")) > + (display (G_ " > + --graph-backend=3DBACKEND > + use BACKEND for 'extension-graph' and 'shepherd= -graph'")) > (newline) > (display (G_ " > -h, --help display this help and exit")) > @@ -136,6 +150,10 @@ (define %options > (alist-cons 'validate-reconfigure > warn-about-backward-reconfigure > result))) > + (option '("graph-backend") #t #f > + (lambda (opt name arg result) > + (alist-cons 'graph-backend arg result))) > + > %standard-build-options)) >=20=20 > (define %default-options > @@ -147,18 +165,49 @@ (define %default-options > (multiplexed-build-output? . #t) > (verbosity . #f) ;default > (debug . 0) > - (validate-reconfigure . ,ensure-forward-reconfigure))) > + (validate-reconfigure . ,ensure-forward-reconfigure) > + (graph-backend . "graphviz"))) >=20=20 > > ;;; > ;;; Actions. > ;;; >=20=20 > +(define* (export-extension-graph home port > + #:key (backend (lookup-backend "graphvi= z"))) > + "Export the service extension graph of HOME to PORT using BACKEND." > + (let* ((services (home-environment-services home)) > + (home (find (lambda (service) > + (eq? (service-kind service) home-service-type= )) > + services))) > + (export-graph (list home) (current-output-port) s/current-output-port/port > + #:backend backend > + #:node-type (service-node-type services) > + #:reverse-edges? #t))) > + > +(define* (export-shepherd-graph home port > + #:key (backend (lookup-backend "graphviz= "))) > + "Export the graph of shepherd services of HOME to PORT using BACKEND." > + (let* ((services (home-environment-services home)) > + (root (fold-services services > + #:target-type home-shepherd-service-t= ype)) > + ;; Get the list of . > + (shepherds (home-shepherd-configuration-services > + (service-value root))) > + (sinks (filter (lambda (service) > + (null? (shepherd-service-requirement servi= ce))) > + shepherds))) > + (export-graph sinks (current-output-port) s/current-output-port/port > + #:backend backend > + #:node-type (shepherd-service-node-type shepherds) > + #:reverse-edges? #t))) > + > (define* (perform-action action he > #:key > dry-run? > derivations-only? > use-substitutes? > + (graph-backend "graphviz") > (validate-reconfigure ensure-forward-reconfigur= e)) > "Perform ACTION for home environment. " >=20=20 > @@ -169,35 +218,43 @@ (define println > (check-forward-update validate-reconfigure > #:current-channels (home-provenance %guix-home= ))) >=20=20 > - (mlet* %store-monad > - ((he-drv (home-environment-derivation he)) > - (drvs (mapm/accumulate-builds lower-object (list he-drv))) > - (% (if derivations-only? > - (return > - (for-each (compose println derivation-file-name) d= rvs)) > - (built-derivations drvs))) > + (case action > + ((extension-graph) > + (export-extension-graph he (current-output-port) > + #:backend (lookup-backend graph-backend))) > + ((shepherd-graph) > + (export-shepherd-graph he (current-output-port) > + #:backend (lookup-backend graph-backend))) > + (else > + (mlet* %store-monad > + ((he-drv (home-environment-derivation he)) > + (drvs (mapm/accumulate-builds lower-object (list he-drv))) > + (% (if derivations-only? > + (return > + (for-each (compose println derivation-file-name= ) drvs)) > + (built-derivations drvs))) >=20=20 > - (he-out-path -> (derivation->output-path he-drv))) > - (if (or dry-run? derivations-only?) > - (return #f) > - (begin > - (for-each (compose println derivation->output-path) drvs) > + (he-out-path -> (derivation->output-path he-drv))) > + (if (or dry-run? derivations-only?) > + (return #f) > + (begin > + (for-each (compose println derivation->output-path) drvs) >=20=20 > - (case action > - ((reconfigure) > - (let* ((number (generation-number %guix-home)) > - (generation (generation-file-name > - %guix-home (+ 1 number)))) > + (case action > + ((reconfigure) > + (let* ((number (generation-number %guix-home)) > + (generation (generation-file-name > + %guix-home (+ 1 number)))) >=20=20 > - (switch-symlinks generation he-out-path) > - (switch-symlinks %guix-home generation) > - (setenv "GUIX_NEW_HOME" he-out-path) > - (primitive-load (string-append he-out-path "/activate")) > - (setenv "GUIX_NEW_HOME" #f) > - (return he-out-path))) > - (else > - (newline) > - (return he-out-path))))))) > + (switch-symlinks generation he-out-path) > + (switch-symlinks %guix-home generation) > + (setenv "GUIX_NEW_HOME" he-out-path) > + (primitive-load (string-append he-out-path "/activate"= )) > + (setenv "GUIX_NEW_HOME" #f) > + (return he-out-path))) > + (else > + (newline) > + (return he-out-path))))))))) >=20=20 > (define (process-action action args opts) > "Process ACTION, a sub-command, with the arguments are listed in ARGS. > @@ -256,7 +313,9 @@ (define (ensure-home-environment file-or-exp obj) > #:derivations-only? (assoc-ref opts 'derivat= ions-only?) > #:use-substitutes? (assoc-ref opts 'substitu= tes?) > #:validate-reconfigure > - (assoc-ref opts 'validate-reconfigure)))))) > + (assoc-ref opts 'validate-reconfigure) > + #:graph-backend > + (assoc-ref opts 'graph-backend)))))) > (warn-about-disk-space))) >=20=20 >=20=20 > diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm > index 6f7dcd4643..55e9b8ba30 100644 > --- a/guix/scripts/system.scm > +++ b/guix/scripts/system.scm > @@ -88,7 +88,10 @@ (define-module (guix scripts system) > #:use-module (ice-9 match) > #:use-module (rnrs bytevectors) > #:export (guix-system > - read-operating-system)) > + read-operating-system > + > + service-node-type > + shepherd-service-node-type)) >=20=20 > > ;;; > diff --git a/tests/guix-home.sh b/tests/guix-home.sh > index f054d15172..48dbcbd28f 100644 > --- a/tests/guix-home.sh > +++ b/tests/guix-home.sh > @@ -93,6 +93,14 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_di= rectory"' EXIT > "# the content of bashrc-test-config.sh")))))))) > EOF >=20=20 > + # Check whether the graph commands work as expected. > + guix home extension-graph "home.scm" | grep 'label =3D "home-activat= ion"' > + guix home extension-graph "home.scm" | grep 'label =3D "home-symlink= -manager"' > + guix home extension-graph "home.scm" | grep 'label =3D "home"' > + > + # There are no Shepherd services so the one below must fail. > + ! guix home shepherd-graph "home.scm" > + > guix home reconfigure "${test_directory}/home.scm" > test -d "${HOME}/.guix-home" > test -h "${HOME}/.bash_profile" =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIyw8gPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wuu4P/ie/6Ooyx8vn1a1G0dztbAr1nJsjoLkk5Wnc VE4hPa2l3bYnSLUW2cPNmKBT1+IqMIqL1QhGqTIpIed+rLsSvDWmj4RSW8JVCJt7 m4YomVdTiyKNQq2sl2T0iKeZeBBkepkQX3X+3Vz4/tRKLUTy/nMBAWDuakHLDkqx 5VmR0YaN8LGc62ft5r94vgredgw8+m3o2do7sh4l7aJkLoHSXsgytGFPQxO5qWY5 rs641XqqcP1xH5nMXamY8ATWhoUqKekhH0wPYrTzJi5TA5nKBKzlHb6EmAX3mBW0 K9EeFQB1ycenJRkPZM9z5ERoBnSsxh/4wr85FZ3d+tukmQ2fhY/TabkuD57Q3CCs RbmB3GSgD4N10KbBHN1wqiOrM9sRixVyugqffs5n9C85QPIj9ORk9JO19zRxDQ4r JPA7bye3Bo8A6SIILDSwJU20pI2NvIMr4rGjmVQ8PU7bl9j+UiToNGp1QvA+FSop rOw5TwzvQTvZxF1iuEpb7FDi2kHkPeyUd/7k3ExQc7bbdUJakG1H+A36NWUUvEJN rGKoAoWf/AF1CRIQDEi4x5t+TyUlDa3wN7imEeeJ0+LPFUu9CbnGFOXXm0c9bEDH w9Xh+6LnEfY0LPhLFm5KcKnmNRkjzNlkP6gjAtHRBZ+mX0VYF188Xorz9rXukTKg pnrCNXXo =fcYw -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Jun 19 14:16:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#54344: closed (Re: bug#54344: [PATCH 0/3] Add 'guix home extension-graph' and 'shepherd-graph') Message-ID: References: <87o823pa79.fsf_-_@gnu.org> <20220311213233.12415-1-ludo@gnu.org> X-Gnu-PR-Message: they-closed 54344 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 54344@debbugs.gnu.org Date: Fri, 18 Mar 2022 15:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1647616322-30935-1" This is a multi-part message in MIME format... ------------=_1647616322-30935-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #54344: [PATCH 0/3] Add 'guix home extension-graph' and 'shepherd-graph' which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 54344@debbugs.gnu.org. --=20 54344: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54344 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1647616322-30935-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 54344-done) by debbugs.gnu.org; 18 Mar 2022 15:11:32 +0000 Received: from localhost ([127.0.0.1]:58090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVEGK-00082E-Eg for submit@debbugs.gnu.org; Fri, 18 Mar 2022 11:11:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVEGJ-000820-Br for 54344-done@debbugs.gnu.org; Fri, 18 Mar 2022 11:11:31 -0400 Received: from [2001:470:142:3::e] (port=49818 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEGE-0003e6-22; Fri, 18 Mar 2022 11:11:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=g+lU/WLcP62m7QQW8S3hcHGI/n+2vT5pXCKNOX3esU4=; b=Bf3pDaYX1kk85mZYZHmH CSz7+2DWGcHdwzslo9+uGz7NeadB3ffiUkoAMZhqZx7wUQDmqGUlLU5KSDdG8d9PWGzcYwK8M5/5U RLV9zy+j4WsWzK3bIUn7jR8qxAk/EkOV9C9C7Gl1r2ZFBKdhtJ16rhknZVB03VQHUPrjlxnbSBaSZ Dm9ZhtJurEoL+5tEFdi3xXsMPBgmmW7PapytIUl2r47bQLgYRHIDMtXAZrbG3R5mbGn+3lmVokFcn beVbu+Jj2TwKawdbQiRnbdCrPINZb/gveH2NnJZOLRGurrD0IbxPeebmcpUiO3k7dae4AiZoTTmGp rN0PWfkyDMp9qA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:62065 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEGC-0002IH-25; Fri, 18 Mar 2022 11:11:25 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#54344: [PATCH 0/3] Add 'guix home extension-graph' and 'shepherd-graph' References: <20220311213418.12472-1-ludo@gnu.org> <20220311213418.12472-3-ludo@gnu.org> <874k3xjh2w.fsf@trop.in> Date: Fri, 18 Mar 2022 16:11:22 +0100 In-Reply-To: <874k3xjh2w.fsf@trop.in> (Andrew Tropin's message of "Thu, 17 Mar 2022 08:14:47 +0300") Message-ID: <87o823pa79.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54344-done Cc: 54344-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Andrew, Thanks for your feedback! I incorporated your suggestions and pushed as 25261cbf96a3bf58abc6e836d71bdabe9154a83c. Ludo=E2=80=99. ------------=_1647616322-30935-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Mar 2022 21:32:45 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmsP-0003z3-14 for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:32:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:48912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSmsN-0003yv-1G for submit@debbugs.gnu.org; Fri, 11 Mar 2022 16:32:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmsM-0006MC-RL for guix-patches@gnu.org; Fri, 11 Mar 2022 16:32:42 -0500 Received: from [2001:470:142:3::e] (port=33198 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmsM-0000ge-7Q; Fri, 11 Mar 2022 16:32:42 -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:Subject:To:From:in-reply-to: references; bh=Yfee+EhcERbZxByXWNilW2MdH6ZEuMehVEnERg2nfPs=; b=Y60qUK8PsSTyLT omZrX6m1oTBCTUCxQDx7T775JzRuaI8dZ/5i5MI/n78otwypP2rgZsnsVNXr3rh7MX7sf/mI/zm+S H8xeb9dV0hP+7rv7nFUiuCrEHXe7ZRg5kTO9LiXKiIEoGAQPr0j3WzKSdhpGRf7MWwYZNSvgqsswq InjQxVuCVZ8iRBdurNvoLlANjT9o6llMWuFH412BS6Im96c36a4nCOxyU+QoDPsb9mEQ++JTQb3nI AC+KncFdzS4A/LUfrunW0sLiwOMPBPNEo3Jwcyrc5VsNvTOFR6Vd41rA5mcoNFde8dRMv/g20mGji iAb0CAfN5QFxr6YQ3bsg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:61902 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 1nSmsK-0002yu-Rs; Fri, 11 Mar 2022 16:32:41 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/3] Add 'guix home extension-graph' and 'shepherd-graph' Date: Fri, 11 Mar 2022 22:32:33 +0100 Message-Id: <20220311213233.12415-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-Debbugs-Cc: Andrew Tropin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! These patches implement ‘guix home extension-graph’ and ‘guix home shepherd-graph’, similar to what ‘guix system’ provides. Until now these two commands were silently ignored. Thoughts? Ludo’. Ludovic Courtès (3): graph: Factorize 'lookup-backend'. home: services: Export record type accessors. guix home: Implement the 'extension-graph' and 'shepherd-graph' actions. doc/guix.texi | 31 +++++++++ gnu/home/services/shepherd.scm | 21 +++++- guix/graph.scm | 14 +++- guix/scripts/graph.scm | 9 +-- guix/scripts/home.scm | 117 +++++++++++++++++++++++++-------- guix/scripts/system.scm | 14 ++-- po/guix/POTFILES.in | 1 + tests/guix-home.sh | 8 +++ 8 files changed, 165 insertions(+), 50 deletions(-) base-commit: 5397c18157f12e9127b5a9a59b0aa5a4eb058839 -- 2.34.0 ------------=_1647616322-30935-1--