After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703688 - valadoc does not compile against GraphViz 2.30 (shipped in Fedora 19)
valadoc does not compile against GraphViz 2.30 (shipped in Fedora 19)
Status: RESOLVED FIXED
Product: valadoc
Classification: Other
Component: libvaladoc
git master
Other Linux
: Normal normal
: ---
Assigned To: valadoc-maint
valadoc-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-05 21:36 UTC by Richard Schwarting
Modified: 2014-08-22 12:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rough, working patch to let valadoc compile (3.61 KB, patch)
2013-07-06 00:20 UTC, Richard Schwarting
needs-work Details | Review
Rough patch updating libgvc.vapi to 2.30's API (3.05 KB, patch)
2013-07-06 00:29 UTC, Richard Schwarting
needs-work Details | Review
Rough patch updating libgvc.vapi to 2.30's API (3.05 KB, patch)
2013-07-06 02:22 UTC, Richard Schwarting
needs-work Details | Review
Add LIBGVC_CFLAGS to src/driver/0.20.x/Makefile.am (388 bytes, patch)
2013-10-01 05:37 UTC, Richard Schwarting
none Details | Review

Description Richard Schwarting 2013-07-05 21:36:16 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.
Comment 1 Richard Schwarting 2013-07-06 00:20:21 UTC
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.
Comment 2 Richard Schwarting 2013-07-06 00:29:15 UTC
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.
Comment 3 Richard Schwarting 2013-07-06 02:22:43 UTC
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
Comment 4 Florian Brosch 2013-09-24 18:05:19 UTC
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?
Comment 5 Richard Schwarting 2013-10-01 05:36:32 UTC
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.
Comment 6 Richard Schwarting 2013-10-01 05:37:23 UTC
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.
Comment 7 Techlive Zheng 2013-10-25 15:36:49 UTC
File src/driver/0.22.x/Makefile.am also needs to be patched with LIBGVC_CFLAGS.
Comment 8 Florian Brosch 2013-10-25 15:41:35 UTC
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.
Comment 9 Techlive Zheng 2013-10-25 16:33:18 UTC
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
Comment 10 Christopher Meng 2013-11-02 03:58:20 UTC
This bug is blocking https://bugzilla.redhat.com/show_bug.cgi?id=988667 from being reviewed.

Waiting for your good news.
Comment 11 Rico Tzschichholz 2014-01-18 13:46:50 UTC
Those issues are suppose to be gone with the recent changes.
Comment 12 Christopher Meng 2014-01-23 07:11:35 UTC
Can it be closed it now?
Comment 13 Florian Brosch 2014-08-22 12:06:58 UTC
(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.