Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-functioning dot2tex breaks poset creation in an unclear way #18124

Closed
novoselt opened this issue Apr 4, 2015 · 18 comments
Closed

Non-functioning dot2tex breaks poset creation in an unclear way #18124

novoselt opened this issue Apr 4, 2015 · 18 comments

Comments

@novoselt
Copy link
Member

novoselt commented Apr 4, 2015

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 Ctrl-D.

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 Ctrl-D.

which is obviously wrong and extremely confusing to users - surely poset creation is independent of TeX!

CC: @sagetrac-sage-combinat @anneschilling @nthiery @nathanncohen @nexttime @bsalisbury1 @tscrim

Component: combinatorics

Author: Jeroen Demeyer

Branch/Commit: 946f67d

Reviewer: Nathann Cohen

Issue created by migration from https://trac.sagemath.org/ticket/18124

@novoselt novoselt added this to the sage-6.6 milestone Apr 4, 2015
@novoselt
Copy link
Member Author

novoselt commented Apr 4, 2015

comment:1

And it looks like the optional package dot2tex IS installed, but there is no dot2tex itself.

@novoselt
Copy link
Member Author

novoselt commented Apr 4, 2015

comment:2

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 -i|grep dot2tex
dot2tex-20120520
sc_serv@sctest:~$ sage/sage -sh -c "dot2tex --version"
Dot2tex version 2.9.0dev

while http://sagemath.org/packages/optional/ lists dot2tex-2.8.7.p2.spkg

The system in question is SageMathCell:
http://sagecell.sagemath.org/?z=eJxTVS3O4OUqTkxPVdDNrEkvSi1QSMkvMSpJreDlgjIUdHXLUouKM_PzAEdZDwg=&lang=sage

@nexttime
Copy link
Mannequin

nexttime mannequin commented Apr 5, 2015

comment:3

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 -i|grep dot2tex
dot2tex-20120520
sc_serv@sctest:~$ sage/sage -sh -c "dot2tex --version"
Dot2tex version 2.9.0dev

while http://sagemath.org/packages/optional/ lists dot2tex-2.8.7.p2.spkg

That's "new-style 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/dot2tex-20120520.tar.bz2.


Did you try to reinstall it with sage -f dot2tex? (Note that at least GraphViz is a prerequisite of it.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Apr 5, 2015

comment:4

Replying to @nexttime:

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.

@tscrim
Copy link
Collaborator

tscrim commented Apr 5, 2015

comment:5

You might be interested in #17171.

@novoselt
Copy link
Member Author

novoselt commented Apr 7, 2015

comment:6

Replying to @nexttime:

... 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):

  1. Check that things work properly, i.e. don't crash if they don't work.
  2. 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.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Apr 7, 2015

comment:7

Replying to @novoselt:

Replying to @nexttime:

... 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 TeX-free 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)TeX-related 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):

  1. Check that things work properly, i.e. don't crash if they don't work.

Agreed, a non-working dot2tex installation shouldn't affect rather unrelated things, especially since you cannot (easily) uninstall dot2tex.

  1. 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 spkg-install. (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...

@nexttime
Copy link
Mannequin

nexttime mannequin commented Apr 7, 2015

comment:8

Replying to @nexttime:

Installing GraphViz alone didn't help; after installing a couple of additional (La)TeX-related 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.

@novoselt
Copy link
Member Author

novoselt commented Apr 7, 2015

comment:9

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.

@novoselt novoselt changed the title hasse_diagram and have_dot2tex problems without dot2tex Non-functioning dot2tex breaks poset creation in an unclear way Apr 7, 2015
@novoselt

This comment has been minimized.

@jdemeyer
Copy link

@jdemeyer
Copy link

Commit: db39f4d

@jdemeyer
Copy link

New commits:

db39f4dFix dot2tex tests by checking for SystemExit also

@jdemeyer
Copy link

Author: Jeroen Demeyer

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jun 1, 2015

Reviewer: Nathann Cohen

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2015

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

946f67dAdd one more "optional graphviz"

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2015

Changed commit from db39f4d to 946f67d

@vbraun
Copy link
Member

vbraun commented Jun 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants