unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70910: xdot has stopped working after update to 1.3
@ 2024-05-13  4:44 Ada Stevenson
  2024-05-13 10:18 ` Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ada Stevenson @ 2024-05-13  4:44 UTC (permalink / raw)
  To: 70910; +Cc: Ludovic Courtès

[-- Attachment #1: Type: text/plain, Size: 1828 bytes --]

Hi Guix,

I was trying to use `xdot` to view to output of `guix graph` (`guix 
graph bash | xdot -`). However, it crashed instantly with the following 
stack trace:

> dot: No such file or directory
> Traceback (most recent call last):
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/bin/.xdot-real", 
> line 33, in <module>
>     sys.exit(load_entry_point('xdot==1.3', 'gui_scripts', 'xdot')())
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/lib/python3.10/site-packages/xdot/__main__.py", 
> line 80, in main
>     win.set_dotcode(sys.stdin.buffer.read())
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/lib/python3.10/site-packages/xdot/ui/window.py", 
> line 712, in set_dotcode
>     if self.dotwidget.set_dotcode(dotcode, filename):
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/lib/python3.10/site-packages/xdot/ui/window.py", 
> line 148, in set_dotcode
>     if self._set_dotcode(dotcode, filename, center=center):
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/lib/python3.10/site-packages/xdot/ui/window.py", 
> line 134, in _set_dotcode
>     xdotcode = self.run_filter(dotcode)
>   File 
> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/lib/python3.10/site-packages/xdot/ui/window.py", 
> line 129, in run_filter
>     return xdotcode
> UnboundLocalError: local variable 'xdotcode' referenced before assignment

Using `guix time-machine` I was able to identify the regression commit 
as 2aeb9faa421635c0531d96658414e5bf288a3142 
<http://git.savannah.gnu.org/cgit/guix.git/commit/?id=2aeb9faa421635c0531d96658414e5bf288a3142> 
(when Ludo' updated it to 1.3). Using `xdot` within the time machine 
inside the parent commit works.

I've cc'd Ludo' and hopefully we can fix this!

Warmly,

Ada

[-- Attachment #2: Type: text/html, Size: 2373 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70910: xdot has stopped working after update to 1.3
  2024-05-13  4:44 bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
@ 2024-05-13 10:18 ` Ludovic Courtès
  2024-05-13 19:08 ` bug#70910: [PATCH] gnu: xdot: Bugfix: Add the directory containing "dot" to the PATH Artyom V. Poptsov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2024-05-13 10:18 UTC (permalink / raw)
  To: Ada Stevenson; +Cc: Artyom V. Poptsov, 70910

Hi Ada,

(Cc: Artyom, who updated xdot in
a47fe0fdc4b13c850da29c0e11ab63d2041534c1.)

Ada Stevenson <adanskana@gmail.com> skribis:

> I was trying to use `xdot` to view to output of `guix graph` (`guix
> graph bash | xdot -`). However, it crashed instantly with the
> following stack trace:
>
>> dot: No such file or directory
>> Traceback (most recent call last):
>>   File
>> "/gnu/store/r9mrqfpci65hsypgm7r5kpzxlm6fcd1l-xdot-1.3/bin/.xdot-real",
>> line 33, in <module>
>>     sys.exit(load_entry_point('xdot==1.3', 'gui_scripts', 'xdot')())

Looks like the problem is that ‘dot’ is not in $PATH in your case.

On my machine, ‘dot’ is in $PATH because I also have it in my profile,
and thus ‘guix graph bash | xdot -’ works fine.

Artyom, I think we should replace the reference to ‘dot’ in the source
with its absolute file name, ‘/gnu/store/…/bin/dot’.  That way xdot
would work whether or not one has installed ‘graphviz’ independently.

Could you take a look?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70910: [PATCH] gnu: xdot: Bugfix: Add the directory containing "dot" to the PATH.
  2024-05-13  4:44 bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
  2024-05-13 10:18 ` Ludovic Courtès
@ 2024-05-13 19:08 ` Artyom V. Poptsov
  2024-05-14  7:08 ` bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
  2024-05-16 22:25 ` Sharlatan Hellseher
  3 siblings, 0 replies; 5+ messages in thread
From: Artyom V. Poptsov @ 2024-05-13 19:08 UTC (permalink / raw)
  To: 70910; +Cc: Ludovic Courtès, Artyom V. Poptsov

"xdot" would always fail to run when graphviz "dot" binary is not available
directly in the user system.  This patch fixes it by adding graphviz binaries
from the inputs to the PATH environment variable in "xdot" wrapping script.

Reported by Ada Stevenson <adanskana@gmail.com> in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70910

* gnu/packages/graphviz.scm (xdot) [arguments]: Add the "bin" directory from
  the graphviz input to the xdot wrapping.

Change-Id: Iba4bbc37daf07407ad4c18b822956fbb730c0033
---
 gnu/packages/graphviz.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index 0fc5c6024e..18f4fc147d 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -314,9 +314,12 @@ (define-public xdot
                    (add-after 'install 'wrap
                      (lambda* (#:key inputs outputs #:allow-other-keys)
                        (let ((out (assoc-ref outputs "out"))
+                             (graphviz (assoc-ref inputs "graphviz"))
                              (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
                              (python-path (getenv "GUIX_PYTHONPATH")))
                          (wrap-program (string-append out "/bin/xdot")
+                           `("PATH" ":" prefix
+                             (,(string-append graphviz "/bin")))
                            `("GI_TYPELIB_PATH" ":" prefix
                              (,gi-typelib-path))
                            `("GUIX_PYTHONPATH" ":" prefix

base-commit: b23aa4c1d6ebbbee316d2f2bee87ad4ce7c67345
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#70910: xdot has stopped working after update to 1.3
  2024-05-13  4:44 bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
  2024-05-13 10:18 ` Ludovic Courtès
  2024-05-13 19:08 ` bug#70910: [PATCH] gnu: xdot: Bugfix: Add the directory containing "dot" to the PATH Artyom V. Poptsov
@ 2024-05-14  7:08 ` Ada Stevenson
  2024-05-16 22:25 ` Sharlatan Hellseher
  3 siblings, 0 replies; 5+ messages in thread
From: Ada Stevenson @ 2024-05-14  7:08 UTC (permalink / raw)
  To: 70910; +Cc: poptsov.artyom, Ludovic Courtès

Hi all,

I've tested the patch on a fresh checkout. LGTM!

Thanks for looking into this, Ludo', Artyom!

Warmly,

Ada





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70910: xdot has stopped working after update to 1.3
  2024-05-13  4:44 bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
                   ` (2 preceding siblings ...)
  2024-05-14  7:08 ` bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
@ 2024-05-16 22:25 ` Sharlatan Hellseher
  3 siblings, 0 replies; 5+ messages in thread
From: Sharlatan Hellseher @ 2024-05-16 22:25 UTC (permalink / raw)
  To: 70910-done

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]


Hi,

Pushed as 0846eaecd45783bf40e8dc67b0c16f71068524b7 to master.

--
Oleg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-16 22:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13  4:44 bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
2024-05-13 10:18 ` Ludovic Courtès
2024-05-13 19:08 ` bug#70910: [PATCH] gnu: xdot: Bugfix: Add the directory containing "dot" to the PATH Artyom V. Poptsov
2024-05-14  7:08 ` bug#70910: xdot has stopped working after update to 1.3 Ada Stevenson
2024-05-16 22:25 ` Sharlatan Hellseher

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).