Opened 6 years ago
Closed 6 years ago
#18124 closed defect (fixed)
Nonfunctioning dot2tex breaks poset creation in an unclear way
Reported by:  novoselt  Owned by:  

Priority:  major  Milestone:  sage6.6 
Component:  combinatorics  Keywords:  
Cc:  sagecombinat, aschilling, nthiery, ncohen, leif, bsalisbury1, tscrim  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Nathann Cohen 
Report Upstream:  N/A  Work issues:  
Branch:  946f67d (Commits)  Commit:  946f67d03a407f165e4d280d64dd80536da41fda 
Dependencies:  Stopgaps: 
Description (last modified by )
On a system with optional package dot2tex installed, but no GraphViz?:
sage: P = posets.PentagonPoset() An exception has occurred, use %tb to see the full traceback. SystemExit: 1 To exit: use 'exit', 'quit', or CtrlD.
I believe the problem is coming from this:
sage: from sage.graphs.dot2tex_utils import have_dot2tex sage: have_dot2tex() An exception has occurred, use %tb to see the full traceback. SystemExit: 1 To exit: use 'exit', 'quit', or CtrlD.
which is obviously wrong and extremely confusing to users  surely poset creation is independent of TeX!
Change History (16)
comment:1 Changed 6 years ago by
comment:2 followup: ↓ 3 Changed 6 years ago by
Looking further, I assume dot2tex package actually installs dot2tex and it is just not present on the system. I am confused by versions:
sc_serv@sctest:~$ sage/sage igrep dot2tex dot2tex20120520 sc_serv@sctest:~$ sage/sage sh c "dot2tex version" Dot2tex version 2.9.0dev
while http://sagemath.org/packages/optional/ lists dot2tex2.8.7.p2.spkg
The system in question is SageMathCell: http://sagecell.sagemath.org/?z=eJxTVS3O4OUqTkxPVdDNrEkvSi1QSMkvMSpJreDlgjIUdHXLUouKM_PzAEdZDwg=&lang=sage
comment:3 in reply to: ↑ 2 ; followup: ↓ 4 Changed 6 years ago by
Replying to novoselt:
Looking further, I assume dot2tex package actually installs dot2tex and it is just not present on the system. I am confused by versions:
sc_serv@sctest:~$ sage/sage igrep dot2tex dot2tex20120520 sc_serv@sctest:~$ sage/sage sh c "dot2tex version" Dot2tex version 2.9.0devwhile http://sagemath.org/packages/optional/ lists dot2tex2.8.7.p2.spkg
That's "newstyle spkg" weirdness:
The old one (2.8.7.p2) is a real spkg, and listed on .../packages/optional/
.
The new one (2.9.0dev) has its package metadata only shipped with newer versions of Sage (part of the "unified" git tree, such that you cannot install it on older Sage versions); its corresponding upstream tarball is available as http://sagemath.org/packages/upstream/dot2tex/dot2tex20120520.tar.bz2.
Did you try to reinstall it with sage f dot2tex
? (Note that at least GraphViz is a prerequisite of it.)
comment:4 in reply to: ↑ 3 ; followup: ↓ 6 Changed 6 years ago by
Replying to leif:
Did you try to reinstall it with
sage f dot2tex
? (Note that at least GraphViz is a prerequisite of it.)
... which means you should better try sage f c dot2tex
.
comment:5 Changed 6 years ago by
You might be interested in #17171.
comment:6 in reply to: ↑ 4 ; followup: ↓ 7 Changed 6 years ago by
Replying to leif:
... which means you should better try
sage f c dot2tex
.
Tons of errors, GraphViz is not installed. The issue, however, is that I am not trying to make any pictures! Changes that I think have to be done (either one will suffice, but both are better):
 Check that things work properly, i.e. don't crash if they don't work.
 Check that prerequisites are installed during installation of dot2tex and fail if they are not available.
I does not look like #17171 addresses the first point, not sure about the second one.
comment:7 in reply to: ↑ 6 ; followup: ↓ 8 Changed 6 years ago by
Replying to novoselt:
Replying to leif:
... which means you should better try
sage f c dot2tex
.Tons of errors, GraphViz is not installed.
Yes. I could reproduce the errors you reported on a previously TeXfree system, but only after installing dot2tex (without c
, otherwise the installation would have failed).
Installing GraphViz alone didn't help; after installing a couple of additional (La)TeXrelated packages the errors in Sage finally vanished, while the number of failures in dot2tex's test suite only decreased.
The issue, however, is that I am not trying to make any pictures!
Yep, that's odd, although you must have installed dot2tex at some point... ;) (So the ticket's title is somewhat misleading.)
Changes that I think have to be done (either one will suffice, but both are better):
 Check that things work properly, i.e. don't crash if they don't work.
Agreed, a nonworking dot2tex installation shouldn't affect rather unrelated things, especially since you cannot (easily) uninstall dot2tex.
 Check that prerequisites are installed during installation of dot2tex and fail if they are not available.
Yep, some minimal prerequisite check should probably be performed in its spkginstall
. (Test suite failures don't necessarily mean dot2tex would be completely unusable, and we normally don't want to run a test suite unless the user explicitly asked for doing so.)
I does not look like #17171 addresses the first point, not sure about the second one.
Well, not yet, still needs review...
comment:8 in reply to: ↑ 7 Changed 6 years ago by
Replying to leif:
Installing GraphViz alone didn't help; after installing a couple of additional (La)TeXrelated packages the errors in Sage finally vanished, while the number of failures in dot2tex's test suite only decreased.
P.S.: From dot2tex's SPKG.txt
:
== Dependencies == graphviz (www.graphviz.org) should be installed and in the path (for example via the graphviz spkg). preview, a LaTeX package for extracting parts of a document.
Necessary, but presumably not sufficient (at least to make 2.9.0dev's test suite pass), but perhaps the packages I installed are also too old.
comment:9 Changed 6 years ago by
 Summary changed from hasse_diagram and have_dot2tex problems without dot2tex to Nonfunctioning dot2tex breaks poset creation in an unclear way
Agreed about the title  my understanding of the issue improved as I was writing the description ;)
Listing dependencies is not enough  the point of packaging systems is to take care of them automatically. I've installed dot2tex because it is installed in the cloud and in general the goal is to provide as many useful packages as possible through SageMathCell. So I will install GraphViz on the next update, but the issues here still have to be fixed: the code in have_dot2tex
obviously tries to catch all exceptions, but it is not sufficient.
comment:10 Changed 6 years ago by
 Description modified (diff)
comment:11 Changed 6 years ago by
 Branch set to u/jdemeyer/non_functioning_dot2tex_breaks_poset_creation_in_an_unclear_way
comment:12 Changed 6 years ago by
 Commit set to db39f4d82cee705cabcc763ab30afd22defe680b
 Status changed from new to needs_review
New commits:
db39f4d  Fix dot2tex tests by checking for SystemExit also

comment:13 Changed 6 years ago by
 Reviewers set to Nathann Cohen
 Status changed from needs_review to positive_review
comment:14 Changed 6 years ago by
 Commit changed from db39f4d82cee705cabcc763ab30afd22defe680b to 946f67d03a407f165e4d280d64dd80536da41fda
 Status changed from positive_review to needs_review
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
946f67d  Add one more "optional graphviz"

comment:15 Changed 6 years ago by
 Status changed from needs_review to positive_review
comment:16 Changed 6 years ago by
 Branch changed from u/jdemeyer/non_functioning_dot2tex_breaks_poset_creation_in_an_unclear_way to 946f67d03a407f165e4d280d64dd80536da41fda
 Resolution set to fixed
 Status changed from positive_review to closed
And it looks like the optional package dot2tex IS installed, but there is no dot2tex itself.