backtracking / mlpost

GNU Lesser General Public License v2.1
9 stars 4 forks source link

cairo 1.2.0 problem #8

Open slyfr opened 6 years ago

slyfr commented 6 years ago

Using ocaml 4.06.1, cairo 1.2.0 no longer compiles. Opam outputs the following error:

### stderr ###
# File "cairo_png.ml", line 16, characters 1-18:
# Warning 3: deprecated: String.unsafe_set
# File "cairo_png.ml", line 16, characters 19-20:
# Error: This expression has type string but an expression was expected of type
#          bytes

The dependency of mlpost to cairo 1.2.0 makes it difficult/impossible to install with opam with ocaml 4.06.1. Maybe it would be worth for mlpost to move to cairo2. Or maybe there is a work around to install cairo 1.2.0 with opam.

bobot commented 6 years ago

In fact I'm leaning at simplifying supported backends of mlpost by removing all but direct mps and pgf. For a start we could remove the dependency on cairo in the opam package.

Indeed cairo adds many complications such as converting tex font name to standard one. And I think mlpost is not used for that feature. The pgf backend fix many problems.

slyfr commented 6 years ago

Actually, in the many years I have used mlpost, I have only used the cairo backend. The metapost backend gets memory problems with large and complex figures. I also do like to produce autonomous pdf using the cairo backend. This allows me to debug figures without having to use LaTeX directly. This also makes the compilation time of a document generally much faster as figures are compiled just when they are modified and at the speed of ocaml (which is much better than metapost or LaTeX). Moreove, I also produce figures that are not meant to be included in documents, e.g. for observing results of experiments and in that case I also find the cairo backend very convenient.

bobot commented 6 years ago

Okay, in that case moving to cairo2 is the way to go.

slyfr commented 6 years ago

Thanks. But, maybe the least effort would consist in update cairo 1.2.0 by incorporating the move from string to byte.