Skip to content

Conversation

@bassmadrigal
Copy link

Potential fix for #2375.

Seems to work locally, but I do not have a ton of experience with C++ and autotools.

@cjee21
Copy link
Contributor

cjee21 commented Sep 12, 2025

What about when dynamically loading the graphviz library at runtime?

@bassmadrigal
Copy link
Author

What about when dynamically loading the graphviz library at runtime?

Do you mean trying to detect the graphviz version during runtime or if it's loaded without passing --with-graphviz?

If it's the former, there doesn't seem to be a great way to do that since graphviz's version header doesn't have a unique macro with the version number (just PACKAGE_VERSION, if I remember right). It would be hard to guarantee another package wouldn't use the same name and override it.

If it's the latter, I don't think it will build graphviz support unless you pass --enable-graphviz to the ./configure, so it seems unlikely this would be an issue.

But this is definitely not my forte (I'm mainly a bash shell scriptor), so it's very possible this might not be a proper fix (or the best way to fix it). I'm definitely open to any feedback!

@cjee21
Copy link
Contributor

cjee21 commented Sep 13, 2025

I am not very familiar with this part of the codes as well but what I know is the official distributions for Linux and Windows are built with --with-graphviz=runtime (1eecc6f) which it will load Graphviz during runtime when using graph mode if the .so or .dll are found else it will safely fail with indication that graph plugin is not found. So I wonder in this case how are the versions handled.

@JeromeMartinez
Copy link
Member

Thank you for working on it.
As @cjee21 indicated, there is still a problem with the dynamic load, there is a need to detect the version during dynamic loading and bind the right interface (old or new) accordingly.
If you can do that it would be great, else we let open this ticket until we have time for doing it.

@cjee21
Copy link
Contributor

cjee21 commented Nov 21, 2025

Looks like one way to determine the version during dynamic loading (for Windows at least, don't know about Linux version) is to check if there is xml_escape function exported in gvc.dll. It is no longer exported starting version 13 (https://gitlab.com/graphviz/graphviz/-/merge_requests/4278/diffs?commit_id=f7a9642928d1543b4d0e4bbf3cba7c290dcf43c8#add2a648a46f612f78e218ebe0d988ca7ee2e36d_0_1).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants