From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 17 04:19:09 2021 Received: (at submit) by debbugs.gnu.org; 17 Sep 2021 08:19:09 +0000 Received: from localhost ([127.0.0.1]:58427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mR95Q-0001gP-HH for submit@debbugs.gnu.org; Fri, 17 Sep 2021 04:19:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:52132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mR95O-0001gG-1a for submit@debbugs.gnu.org; Fri, 17 Sep 2021 04:19:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mR95N-0007yk-2m for guix-patches@gnu.org; Fri, 17 Sep 2021 04:19:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53532) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mR95L-0002uV-Bq; Fri, 17 Sep 2021 04:19:03 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35746 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 1mR95K-0007Au-Ty; Fri, 17 Sep 2021 04:19:03 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH] graph: Add '--max-depth'. Date: Fri, 17 Sep 2021 10:18:48 +0200 Message-Id: <20210917081848.14264-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 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 (---) From: Ludovic Courtès * guix/graph.scm (export-graph): Add #:max-depth and honor it, adding 'depths' argument to 'loop'. * guix/scripts/graph.scm (%options, show-help): Add '--max-depth'. (%default-options): Add 'max-depth'. (guix-graph): Pass #:max-depth to 'export-graph'. * tests/graph.scm ("package DAG, limited depth"): New test. * doc/guix.texi (Invoking guix graph): Document it. --- doc/guix.texi | 14 +++++++++++++ guix/graph.scm | 45 ++++++++++++++++++++++++++---------------- guix/scripts/graph.scm | 11 ++++++++++- tests/graph.scm | 21 +++++++++++++++++++- 4 files changed, 72 insertions(+), 19 deletions(-) Hello! This patch adds a long-overdue ‘--max-depth’ option to ‘guix graph’, which helps visualization somewhat. Trimming of nodes beyond the max depth happens at export time. The implementation is a bit naive (with a list containing the depth of each node) but performance is mostly unchanged. Feedback welcome! Ludo’. diff --git a/doc/guix.texi b/doc/guix.texi index 2fc9687910..6c0a581463 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12598,6 +12598,20 @@ $ guix graph --path -t references emacs libunistring /gnu/store/@dots{}-libunistring-0.9.10 @end example +Sometimes you still want to visualize the graph but would like to trim +it so it can actually be displayed. One way to do it is via the +@option{--max-depth} (or @option{-M}) option, which lets you specify the +maximum depth of the graph. In the example below, we visualize only +@code{libreoffice} and the nodes whose distance to @code{libreoffice} is +at most 2: + +@example +guix graph -M 2 libreoffice | xdot -f fdp - +@end example + +Mind you, that's still a big ball of spaghetti, but at least +@command{dot} can render it quickly and it can be browsed somewhat. + The available options are the following: @table @option diff --git a/guix/graph.scm b/guix/graph.scm index 0d4cd83667..3a1cab244b 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -337,11 +337,12 @@ nodeArray.push(nodes[\"~a\"]);~%" (define* (export-graph sinks port #:key - reverse-edges? node-type + reverse-edges? node-type (max-depth +inf.0) (backend %graphviz-backend)) "Write to PORT the representation of the DAG with the given SINKS, using the given BACKEND. Use NODE-TYPE to traverse the DAG. When REVERSE-EDGES? is -true, draw reverse arrows." +true, draw reverse arrows. Do not represent nodes whose distance to one of +the SINKS is greater than MAX-DEPTH." (match backend (($ _ _ emit-prologue emit-epilogue emit-node emit-edge) (emit-prologue (node-type-name node-type) port) @@ -349,6 +350,7 @@ true, draw reverse arrows." (match node-type (($ node-identifier node-label node-edges) (let loop ((nodes sinks) + (depths (make-list (length sinks) 0)) (visited (set))) (match nodes (() @@ -356,20 +358,29 @@ true, draw reverse arrows." (emit-epilogue port) (store-return #t))) ((head . tail) - (mlet %store-monad ((id (node-identifier head))) - (if (set-contains? visited id) - (loop tail visited) - (mlet* %store-monad ((dependencies (node-edges head)) - (ids (mapm %store-monad - node-identifier - dependencies))) - (emit-node id (node-label head) port) - (for-each (lambda (dependency dependency-id) - (if reverse-edges? - (emit-edge dependency-id id port) - (emit-edge id dependency-id port))) - dependencies ids) - (loop (append dependencies tail) - (set-insert id visited))))))))))))) + (match depths + ((depth . depths) + (mlet %store-monad ((id (node-identifier head))) + (if (set-contains? visited id) + (loop tail depths visited) + (mlet* %store-monad ((dependencies + (if (= depth max-depth) + (return '()) + (node-edges head))) + (ids + (mapm %store-monad + node-identifier + dependencies))) + (emit-node id (node-label head) port) + (for-each (lambda (dependency dependency-id) + (if reverse-edges? + (emit-edge dependency-id id port) + (emit-edge id dependency-id port))) + dependencies ids) + (loop (append dependencies tail) + (append (make-list (length dependencies) + (+ 1 depth)) + depths) + (set-insert id visited))))))))))))))) ;;; graph.scm ends here diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 66de824ef4..439fae0b52 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -500,6 +500,10 @@ package modules, while attempting to retain user package modules." (lambda (opt name arg result) (alist-cons 'backend (lookup-backend arg) result))) + (option '(#\M "max-depth") #t #f + (lambda (opt name arg result) + (alist-cons 'max-depth (string->number* arg) + result))) (option '("list-backends") #f #f (lambda (opt name arg result) (list-backends) @@ -537,6 +541,8 @@ Emit a representation of the dependency graph of PACKAGE...\n")) -t, --type=TYPE represent nodes of the given TYPE")) (display (G_ " --list-types list the available graph types")) + (display (G_ " + --max-depth=DEPTH limit to nodes within distance DEPTH")) (display (G_ " --path display the shortest path between the given nodes")) (display (G_ " @@ -559,6 +565,7 @@ Emit a representation of the dependency graph of PACKAGE...\n")) (define %default-options `((node-type . ,%package-node-type) (backend . ,%graphviz-backend) + (max-depth . +inf.0) (system . ,(%current-system)))) @@ -582,6 +589,7 @@ Emit a representation of the dependency graph of PACKAGE...\n")) (with-store store (let* ((transform (options->transformation opts)) + (max-depth (assoc-ref opts 'max-depth)) (items (filter-map (match-lambda (('argument . (? store-path? item)) item) @@ -613,7 +621,8 @@ nodes (given ~a)~%") (export-graph (concatenate nodes) (current-output-port) #:node-type type - #:backend backend))) + #:backend backend + #:max-depth max-depth))) #:system (assq-ref opts 'system))))) #t) diff --git a/tests/graph.scm b/tests/graph.scm index e374dad1a5..fadac265f9 100644 --- a/tests/graph.scm +++ b/tests/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -94,6 +94,25 @@ edges." (list p3 p3 p2) (list p2 p1 p1)))))))) +(test-assert "package DAG, limited depth" + (let-values (((backend nodes+edges) (make-recording-backend))) + (let* ((p1 (dummy-package "p1")) + (p2 (dummy-package "p2" (inputs `(("p1" ,p1))))) + (p3 (dummy-package "p3" (inputs `(("p1" ,p1))))) + (p4 (dummy-package "p4" (inputs `(("p2" ,p2) ("p3" ,p3)))))) + (run-with-store %store + (export-graph (list p4) 'port + #:max-depth 1 + #:node-type %package-node-type + #:backend backend)) + ;; We should see nothing more than these 3 packages. + (let-values (((nodes edges) (nodes+edges))) + (and (equal? nodes (map package->tuple (list p4 p2 p3))) + (equal? edges + (map edge->tuple + (list p4 p4) + (list p2 p3)))))))) + (test-assert "reverse package DAG" (let-values (((backend nodes+edges) (make-recording-backend))) (run-with-store %store -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 11:00:47 2021 Received: (at 50632) by debbugs.gnu.org; 20 Sep 2021 15:00:47 +0000 Received: from localhost ([127.0.0.1]:43813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSKmk-0007zc-N6 for submit@debbugs.gnu.org; Mon, 20 Sep 2021 11:00:46 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:34590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSKmj-0007tG-3p for 50632@debbugs.gnu.org; Mon, 20 Sep 2021 11:00:45 -0400 Received: by mail-qt1-f178.google.com with SMTP id 2so15821382qtw.1 for <50632@debbugs.gnu.org>; Mon, 20 Sep 2021 08:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=oDeulhE14bSStetOnGHUyQAlAYJ33D4EslWpMB+y0ns=; b=iInoT9TjMohFXGPiWGf2mJ+BBwMZqXH4qtylmysW7lvDso8G30yjvUHtS68FWjR9/Y aa+UGSzoeZRkTgI1PJ07Hobt2GzfTZwazH8vfpZzR+st5yqe6MjAc9qkhYb2/EppJhIN wmTIqoz0iudEoFxwCJlU6pD40mQ7fxZeNuVrFIxGLBbJMGhh4xrhMh2H7wAMYsurECCP OLaFm3jdOzp6JJVPda0YLe6bpa8xR7simVorLy2qElDBQgmx85gOGIsCYGOl4hnQF43D MywLzYhMG+faixisLnLmkcNkUxOLLeaYlLG5wf3Q7x39SrARBynzxOgD0S3oo990IPD0 joQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=oDeulhE14bSStetOnGHUyQAlAYJ33D4EslWpMB+y0ns=; b=PxqXlBICguictTzllvaJV6dMW1wVlVrfvuPyvAAv2fOEr+bnnO667qWuxkOPe9yrAO fE2U4RXLa2PRuqFPbnxxTJJ1RPWr0g5uRUhHsYc4lcyJIvRpIMxK1RpqKOkvdv9LBNaW QfEcS4MoVjvsbFrOu7h3Zqg633W5BaR8spbvaoTi0ae5LmwUmNDxMgWsBDlOFsBh2l1a VEiJ0J7wCUXQtvpCs92/dlaQWpF5YERMbyp4BHXFhEyOrgEEWQpoVBJR7GjHrEqve1Kz v99ScAANfOAY99GczXiYm81DDWSdf2LwBNzbFtzlhuoY6T2jkqC3BPTRRlfCK8jhi91K di2Q== X-Gm-Message-State: AOAM532DCPtZ++ZWniVDSnkYZ1gNZ7GN2RC+CyT/FUGjh/LliYSvANkf 1he6ZtJvDhREZ8H6hSFpDtxwN+dVxPyECAAL+YjEKQCP4CE= X-Google-Smtp-Source: ABdhPJyCwBtiPx3FAIhKrCkx17i0ueJ04kDnjXWnbRaP1o+1Fqd/M1dRb7Xjqgs2Z19CpmukQ2eJTvVFqEz/XyhLL/I= X-Received: by 2002:ac8:570f:: with SMTP id 15mr23705024qtw.335.1632150039395; Mon, 20 Sep 2021 08:00:39 -0700 (PDT) MIME-Version: 1.0 References: <20210917081848.14264-1-ludo@gnu.org> In-Reply-To: <20210917081848.14264-1-ludo@gnu.org> From: zimoun Date: Mon, 20 Sep 2021 17:00:27 +0200 Message-ID: Subject: Re: [bug#50632] [PATCH] graph: Add '--max-depth'. To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50632 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 50632@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: -1.0 (-) Hi, On Fri, 17 Sept 2021 at 10:38, Ludovic Court=C3=A8s wrote: > * guix/graph.scm (export-graph): Add #:max-depth and honor it, adding > 'depths' argument to 'loop'. > * guix/scripts/graph.scm (%options, show-help): Add '--max-depth'. > (%default-options): Add 'max-depth'. > (guix-graph): Pass #:max-depth to 'export-graph'. > * tests/graph.scm ("package DAG, limited depth"): New test. > * doc/guix.texi (Invoking guix graph): Document it. > --- > doc/guix.texi | 14 +++++++++++++ > guix/graph.scm | 45 ++++++++++++++++++++++++++---------------- > guix/scripts/graph.scm | 11 ++++++++++- > tests/graph.scm | 21 +++++++++++++++++++- > 4 files changed, 72 insertions(+), 19 deletions(-) LGTM! > Trimming of nodes beyond the max depth happens at export time. The > implementation is a bit naive (with a list containing the depth of > each node) but performance is mostly unchanged. Well, I do not see how it could be better. :-) And export time is also walk time, IIUC. :-) > diff --git a/doc/guix.texi b/doc/guix.texi > index 2fc9687910..6c0a581463 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -12598,6 +12598,20 @@ $ guix graph --path -t references emacs libunist= ring > /gnu/store/@dots{}-libunistring-0.9.10 > @end example > > +Sometimes you still want to visualize the graph but would like to trim > +it so it can actually be displayed. One way to do it is via the > +@option{--max-depth} (or @option{-M}) option, which lets you specify the > +maximum depth of the graph. In the example below, we visualize only > +@code{libreoffice} and the nodes whose distance to @code{libreoffice} is > +at most 2: > + > +@example > +guix graph -M 2 libreoffice | xdot -f fdp - > +@end example I am not sure 'xdot' is part of the GraphViz toolsuite. Instead, +@example +guix graph -M 2 libreoffice | fdp -Tsvg > libreoffice.svg +@end example Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 04:44:43 2021 Received: (at 50632) by debbugs.gnu.org; 21 Sep 2021 08:44:43 +0000 Received: from localhost ([127.0.0.1]:44858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSbOM-0000zo-Vm for submit@debbugs.gnu.org; Tue, 21 Sep 2021 04:44:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSbOL-0000za-Lw for 50632@debbugs.gnu.org; Tue, 21 Sep 2021 04:44:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34230) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSbOG-0004Ha-CQ; Tue, 21 Sep 2021 04:44:36 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47296 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSbOG-0006cg-33; Tue, 21 Sep 2021 04:44:36 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: [bug#50632] [PATCH] graph: Add '--max-depth'. References: <20210917081848.14264-1-ludo@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour des =?utf-8?Q?R=C3=A9compenses?= de =?utf-8?Q?l?= =?utf-8?Q?'Ann=C3=A9e?= 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 21 Sep 2021 10:44:34 +0200 In-Reply-To: (zimoun's message of "Mon, 20 Sep 2021 17:00:27 +0200") Message-ID: <87a6k6nwr1.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: 50632 Cc: 50632@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, zimoun skribis: > On Fri, 17 Sept 2021 at 10:38, Ludovic Court=C3=A8s wrote: [...] >> +@example >> +guix graph -M 2 libreoffice | xdot -f fdp - >> +@end example > > I am not sure 'xdot' is part of the GraphViz toolsuite. Instead, True, it=E2=80=99s a separate program, but it=E2=80=99s mentioned since c2b2c19a7b8b75ef6dd153ca121dd8765cdcd746 because it=E2=80=99s more convenie= nt IMO. Thanks for taking a look! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 05:26:19 2021 Received: (at 50632) by debbugs.gnu.org; 21 Sep 2021 09:26:19 +0000 Received: from localhost ([127.0.0.1]:44920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSc2d-0002Dx-GP for submit@debbugs.gnu.org; Tue, 21 Sep 2021 05:26:19 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:42622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSc2b-0002Dg-Vg for 50632@debbugs.gnu.org; Tue, 21 Sep 2021 05:26:18 -0400 Received: by mail-wr1-f48.google.com with SMTP id q11so37142675wrr.9 for <50632@debbugs.gnu.org>; Tue, 21 Sep 2021 02:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=C5KNmRdQHBWzlEnE7303EN0DwfEfEU7qNtJJH9egpAo=; b=pz4cZEeJ7aXbJ/hD4ezr0TFESq7Ii8cKUMN8ekSnsqZuOhdkXbdtP8T0he7xOVRuzZ TC8gC80LP7FPxP1S1ccqgxpJjRvsIFjgbbU3BJPM/Ua6Vo4berFDi08cYbXHp0YkXqm9 T8IstIo9qxA83MNNMWBiH34rqHy4i8TG/X+gGmWlmg2oOgM3GXtGxERXJMeZKULoBKbs t8NkNtW5YfdH3FJGnt+m3wJfird7CBI9ybgA+DTSVMUfR0MVxxgMVqeGoUavhXZsl0tj TcvCt/becGdaqFyLR6bavuwmyolbYyhtG6FHhv75KKTJOB5WJoQ5KAsbp+isEgfZEOUt h+uw== 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:content-transfer-encoding; bh=C5KNmRdQHBWzlEnE7303EN0DwfEfEU7qNtJJH9egpAo=; b=EQ+k3oExYnT8701YD+KeO+8wtbJpeZazxyFUQwzpZduC5fvt/4M2t3sqVKK7J4Cswl FAwlGvd6l5bB588q6prJgdLDYICDkKdfdhvD/dww9TdV9z16k6SEOlsRVIdO8h4QtBmB QpDiyCTq9InXsxatt43iCIAb2wUE7y6miHkSTzVIXJiRlMck4LqPlWXQSPjZIGvysnnn jFZn9sCqgQoXQDoxEnrSe86gKNjcIiVo0GQlUJDGj9MJPVjXvxvEeMl2cqMpBnmiLC7S CXXTu7kieMtr7P8bVYR0Kq701w46e4hCtbq8lHErHkklOW2gln0aor1WlwXEGWLP9Qmf LAOQ== X-Gm-Message-State: AOAM531Q7PS9tN9lRqKDwvOLneAlkT8wMA31SeRIkpKdRGZHGXC7jRsv t8zwHOaeqm3KGbLvulN5WE5PP65U2yJuGg== X-Google-Smtp-Source: ABdhPJy9+1xEHVfoyZbKHeoU3mGY+cOnCsJZyL52AGJ7BJwmZBb44Mmn3+FJHryIUQ+ojWS4U866NQ== X-Received: by 2002:a1c:3b87:: with SMTP id i129mr3468976wma.115.1632216372148; Tue, 21 Sep 2021 02:26:12 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id k1sm19027644wrz.61.2021.09.21.02.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 02:26:11 -0700 (PDT) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#50632] [PATCH] graph: Add '--max-depth'. In-Reply-To: <87a6k6nwr1.fsf@gnu.org> References: <20210917081848.14264-1-ludo@gnu.org> <87a6k6nwr1.fsf@gnu.org> Date: Tue, 21 Sep 2021 11:19:45 +0200 Message-ID: <86v92ub80e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50632 Cc: 50632@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: -1.0 (-) Hi Ludo, On Tue, 21 Sep 2021 at 10:44, Ludovic Court=C3=A8s wrote: > True, it=E2=80=99s a separate program, but it=E2=80=99s mentioned since > c2b2c19a7b8b75ef6dd153ca121dd8765cdcd746 because it=E2=80=99s more conven= ient > IMO. Ah, I should have missed this. However, it does not work out of the box: --8<---------------cut here---------------start------------->8--- $ guix environment --ad-hoc xdot $ guix graph coreutils | xdot - Traceback (most recent call last): File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/bin/.xdot-real= ", line 11, in load_entry_point('xdot=3D=3D1.1', 'gui_scripts', 'xdot')() File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.8/= site-packages/xdot/__main__.py", line 70, in main win =3D DotWindow(width=3Dwidth, height=3Dheight) File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.8/= site-packages/xdot/ui/window.py", line 546, in __init__ self.dotwidget =3D widget or DotWidget() File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.8/= site-packages/xdot/ui/window.py", line 67, in __init__ self.connect("draw", self.on_draw) TypeError: : unknown signal name: draw (.xdot-real:5940): Gtk-WARNING **: 11:09:08.420: A floating object was fina= lized. This means that someone called g_object_unref() on an object that had only a floating reference; the initial floating reference is not owned by anyone and must be removed with g_object_ref_sink(). guix graph: error: fport_write: Broken pipe Segmentation fault --8<---------------cut here---------------end--------------->8--- That=E2=80=99s why I suggest to keep examples in the manual as simple as possible. From my point of view, this package should be mentioned but should not be part of the example. The core of the comment is when releasing. Examples involving a complex stack are harder to fix. And from my point of view, release broken examples in the manual is not acceptable*; for an instance of this, see . *not acceptable: well, it is not GNU high standard; even if we can live with them. ;-) Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 09:45:13 2021 Received: (at 50632-done) by debbugs.gnu.org; 21 Sep 2021 13:45:13 +0000 Received: from localhost ([127.0.0.1]:45449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSg5B-0005ym-Ao for submit@debbugs.gnu.org; Tue, 21 Sep 2021 09:45:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSg5A-0005yT-3F for 50632-done@debbugs.gnu.org; Tue, 21 Sep 2021 09:45:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50614) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSg54-0007iU-MD for 50632-done@debbugs.gnu.org; Tue, 21 Sep 2021 09:45:06 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47316 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSg52-0004fr-O4 for 50632-done@debbugs.gnu.org; Tue, 21 Sep 2021 09:45:06 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 50632-done@debbugs.gnu.org Subject: Re: bug#50632: [PATCH] graph: Add '--max-depth'. References: <20210917081848.14264-1-ludo@gnu.org> Date: Tue, 21 Sep 2021 15:45:01 +0200 In-Reply-To: <20210917081848.14264-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cou?= =?utf-8?Q?rt=C3=A8s=22's?= message of "Fri, 17 Sep 2021 10:18:48 +0200") Message-ID: <87sfxyjb4y.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: 50632-done 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 (---) Ludovic Court=C3=A8s skribis: > * guix/graph.scm (export-graph): Add #:max-depth and honor it, adding > 'depths' argument to 'loop'. > * guix/scripts/graph.scm (%options, show-help): Add '--max-depth'. > (%default-options): Add 'max-depth'. > (guix-graph): Pass #:max-depth to 'export-graph'. > * tests/graph.scm ("package DAG, limited depth"): New test. > * doc/guix.texi (Invoking guix graph): Document it. Pushed as 5b32ad4f6f555d305659cee825879df075b06331 followed by a news entry! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 09:49:23 2021 Received: (at 50632) by debbugs.gnu.org; 21 Sep 2021 13:49:23 +0000 Received: from localhost ([127.0.0.1]:45477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSg9D-000691-1v for submit@debbugs.gnu.org; Tue, 21 Sep 2021 09:49:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSg9B-00068o-Pw for 50632@debbugs.gnu.org; Tue, 21 Sep 2021 09:49:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51074) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSg96-0003Lq-Ge; Tue, 21 Sep 2021 09:49:16 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47318 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSg96-0005C0-7r; Tue, 21 Sep 2021 09:49:16 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#50632: [PATCH] graph: Add '--max-depth'. References: <20210917081848.14264-1-ludo@gnu.org> <87a6k6nwr1.fsf@gnu.org> <86v92ub80e.fsf@gmail.com> Date: Tue, 21 Sep 2021 15:49:14 +0200 In-Reply-To: <86v92ub80e.fsf@gmail.com> (zimoun's message of "Tue, 21 Sep 2021 11:19:45 +0200") Message-ID: <87o88mjaxx.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: 50632 Cc: 50632@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 (---) zimoun skribis: > On Tue, 21 Sep 2021 at 10:44, Ludovic Court=C3=A8s wrote: > >> True, it=E2=80=99s a separate program, but it=E2=80=99s mentioned since >> c2b2c19a7b8b75ef6dd153ca121dd8765cdcd746 because it=E2=80=99s more conve= nient >> IMO. > > Ah, I should have missed this. However, it does not work out of the > box: > > $ guix environment --ad-hoc xdot > $ guix graph coreutils | xdot - > Traceback (most recent call last): > File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/bin/.xdot-re= al", line 11, in > load_entry_point('xdot=3D=3D1.1', 'gui_scripts', 'xdot')() > File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.= 8/site-packages/xdot/__main__.py", line 70, in main > win =3D DotWindow(width=3Dwidth, height=3Dheight) > File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.= 8/site-packages/xdot/ui/window.py", line 546, in __init__ > self.dotwidget =3D widget or DotWidget() > File "/gnu/store/gm49bvwdgjpx23wlcfrm8mbf8n75a77n-xdot-1.1/lib/python3.= 8/site-packages/xdot/ui/window.py", line 67, in __init__ > self.connect("draw", self.on_draw) > TypeError: : unknown signal name: draw > > (.xdot-real:5940): Gtk-WARNING **: 11:09:08.420: A floating object was fi= nalized. This means that someone > called g_object_unref() on an object that had only a floating > reference; the initial floating reference is not owned by anyone > and must be removed with g_object_ref_sink(). > guix graph: error: fport_write: Broken pipe > Segmentation fault Could you report a bug? This works for me: --8<---------------cut here---------------start------------->8--- $ guix describe Generacio 189 Aug 30 2021 12:09:27 (nuna) guix f91ae94 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: f91ae9425bb385b60396a544afe27933896b8fa3 $ guix graph coreutils | guix environment --pure -E ^DISPLAY -E ^XAUTH --ad= -hoc xdot -- xdot - --8<---------------cut here---------------end--------------->8--- > That=E2=80=99s why I suggest to keep examples in the manual as simple as > possible. From my point of view, this package should be mentioned but > should not be part of the example. > > The core of the comment is when releasing. Examples involving a complex > stack are harder to fix. And from my point of view, release broken > examples in the manual is not acceptable*; for an instance of this, see > . I sympathize with the general feeling. I think =E2=80=98xdot=E2=80=99 is n= ot that bad though, plus the first example in that section still uses =E2=80=98dot=E2= =80=99. Thanks, Ludo=E2=80=99. From unknown Sat Jun 14 03:54:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 20 Oct 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator