GNOME Bugzilla – Bug 703688
valadoc does not compile against GraphViz 2.30 (shipped in Fedora 19)
Last modified: 2014-08-22 12:06:58 UTC
$ cd valadoc/ $ make ... yada yada ... charts/chart.c:527:2: error: too few arguments to function 'aginit' aginit (); ^ In file included from /usr/include/graphviz/types.h:49:0, from /usr/include/graphviz/gvc.h:17, from charts/chart.c:28: /usr/include/graphviz/cgraph.h:358:13: note: declared here extern void aginit(Agraph_t * g, int kind, char *rec_name, int rec_size, It appears that since 2.28, GraphViz has broken their API for aginit.
Created attachment 248498 [details] [review] Rough, working patch to let valadoc compile This is just a rough working patch, demonstrating the changes needed for Valadoc to compile and run without any obvious errors. To fix an error when compiling where cgraph.h cannot be found, I added $(LIBGVC_CFLAGS) to AM_CFLAGS in a few Makefile.am Gvc.init (aginit) now wants a bunch of parametres. So, I basically just commented it out (!), as I think it's now specific to a supplied Graph (Agraph_t), but I couldn't find any obvious explanations of this. When creating a new Gvc.Graph, Gvc.GraphKind no longer exists, and instead of using enumerated values, we're supposed to pass Agdesc_t instances that have been externed. So, Gvc.GraphKind.AGDIGRAPH became Gvc.Agdirected. There are new parametres for other methods, like create_node (agnode) and create_edge (agedge), but they seem to be able to default to null/0, so I added them to my local libgvc.vapi with defaulted values. I'll attach my modified libgvc.vapi in a second.
Created attachment 248499 [details] [review] Rough patch updating libgvc.vapi to 2.30's API So, the API changes that were included here were * change init (aginit)'s parametres, adding 4 * remove GraphKind * add an empty Desc class (in C it's a struct with 8 bit fields, each 1-bit wide) * define 4 Desc instances (these replace most of GraphKind's usage) * Graph's constructor (agopen) has a new parametre for user discipline, and changes from GraphKind to Desc; disc defaults to 0 (saw them do that a couple times) * create_node (agnode) adds a createflag defaulting to 0 * create_edge (agedge) adds a name (defaulting to null; their name checking function tests for null and doesn't die) and a createflag parametre defaulting to 0 There are probably other changes to the libgvc API, but these were the ones that prevented valadoc from compiling.
Created attachment 248502 [details] [review] Rough patch updating libgvc.vapi to 2.30's API So, it crashed when generating my docs. Using gdb and referring to the GraphViz documentation[0], I realised that I misunderstood what createflag was for, and it should probably default to 1 to match old behaviour. Here's a new patch for the .vapi. 0. http://www.graphviz.org/doc/libguide/libguide.pdf
Hey Richard, Thank you for your patches. libgvcs API actually does not depend on the version but rather on compile flags. (cgraph vs. graph) I modified both patches to support both APIs and applied them. Could you run a quick test?
In a fresh directory, I end up with this: make[5]: Entering directory `/home/richard/.local/src/valadoc/src/driver/0.20.x' CC initializerbuilder.lo In file included from /usr/include/graphviz/gvc.h:17:0, from ../../libvaladoc/valadoc-1.0.h:15, from initializerbuilder.c:30: /usr/include/graphviz/types.h:49:20: fatal error: cgraph.h: No such file or directory #include <cgraph.h> ^ compilation terminated. After checking what was different between my hack and your commit, src/driver/0.20.x/Makefile.am will work if I add $(LIBGVC_CFLAGS) to its AM_CFLAGS as well.
Created attachment 256154 [details] [review] Add LIBGVC_CFLAGS to src/driver/0.20.x/Makefile.am Let me know if there's a particular reason this was excluded from your commit.
File src/driver/0.22.x/Makefile.am also needs to be patched with LIBGVC_CFLAGS.
Hey, we actually have to fix all Makefile.ams in driver/*. The base of this error is the wrong header path in the vapi file.
I can build against graphviz version 2.34.0 now with the above pathes, but I still get the following error if I build agaist graphviz's git master: charts/chart.c: In function 'valadoc_charts_chart_class_init': charts/chart.c:527:2: error: too few arguments to function 'aginit' aginit (); ^ In file included from /usr/include/graphviz/types.h:37:0, from /usr/include/graphviz/gvc.h:17, from charts/chart.c:28: /usr/include/graphviz/cgraph.h:359:13: note: declared here extern void aginit(Agraph_t * g, int kind, char *rec_name, int rec_size, ^ Makefile:1428: recipe for target 'chart.lo' failed
This bug is blocking https://bugzilla.redhat.com/show_bug.cgi?id=988667 from being reviewed. Waiting for your good news.
Those issues are suppose to be gone with the recent changes.
Can it be closed it now?
(In reply to comment #12) > Can it be closed it now? I think so. There are a few resolved bugs I forgot to close. Sorry about that.