-
Notifications
You must be signed in to change notification settings - Fork 570
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
Add builder for Graphviz #351
Conversation
I did have a question about this that hopefully someone (maybe @giordano?) can answer?: I got the list of dependencies from the Requirements listed on Graphviz's site: However, it seems that graphviz has listed recursive dependencies, so many of these (e.g. Do we usually follow that same structure in these packages, or is it better to just list the "top level" dependencies we have (which are I think just Pango, Cairo, and Expat)? |
List only the direct dependencies, each of them will automatically bring in also its own dependencies. |
Just by looking to what are the successful platforms my guess is that it's trying to run foreign excutables (
|
As I suspected earlier, this is trying to run foreign executables 😞 For example, on
|
After the patch I added, compilation is successful but |
For the record, it's likely that for Windows we'll need at least some of these patches: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-graphviz. For FreeBSD there are these patches: https://svnweb.freebsd.org/ports/head/graphics/graphviz/files/ |
G/Graphviz/build_tarballs.jl
Outdated
atomic_patch -p1 ../patches/gvpr-build-native-mkdefs.patch | ||
|
||
# This patch disable generation of dot's configuration | ||
atomic_patch -p1 ../patches/do-not-build-dot-config.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make install
would try to run the built dot
binary executable in order to generate the configuration file. This is a no-go within our environment as we can't run foreign executables apart from three platforms, so we necessarily have to skip this step.
The file could be generated by the Julia package using this JLL package, like what we do in Gtk.jl
, however the location of the configuration is tricky: this file must be in the same directory as the plugin libraries -- they're in the lib/graphviz
directory of the tarball.
The location of this directory is determined by the gvconfig_libdir
function in lib/gvc/gvconfig.c
of the source code. By default this directory should be something like ../lib/graphviz
, but this can be overridden by setting the environment variable GVBINDIR
. From dot
manual:
GVBINDIR
Indicates which directory contains the Graphviz config file and plug-in libraries. If it is defined, the value overrides any other mechanism for finding this directory. If Graphviz is properly installed, it should not be needed, though it can be useful for relocation on platforms not running Linux or Windows.
I think we can generate the config file to a mutable artifact directory and copy there also the plugin libraries, then set GVBINDIR
to this directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whistles yeah i think that makes sense. Reallly great finds! :D
Your patch for building mkdefs
is really cool. This stuff is neat! I'm impressed at how it all comes together! 😁
mkdefs$(EXEEXT): $(mkdefs_OBJECTS) $(mkdefs_DEPENDENCIES) $(EXTRA_mkdefs_DEPENDENCIES) | ||
@rm -f mkdefs$(EXEEXT) | ||
- $(AM_V_CCLD)$(LINK) $(mkdefs_OBJECTS) $(mkdefs_LDADD) $(LIBS) | ||
+ $(AM_V_CCLD)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, what I did here was to replace $(LINK)
with its value in this Makefile and then replace $(CCLD)
with $(CC_FOR_BUILD)
, which is the native C compiler. In addition I added a rule above to build mkdefs.o
with the native compiler as well.
Do you have a usual way to handle patches like these that are already in source control? Can we add the patches repos as dependencies and then use them in the build somehow? Or just manually clone them in our build script? |
Those repo are huge, I much prefer to pick up the only patches we need, also because they may not apply cleanly. For the specific case of Windows, I already have a bunch of patches, I'll need to push them here, but compilation still fails, there are a lot of more errors. |
Yeah, it's true. I was just looking at https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo, which seems useful (
Awesome, thanks for the continued work on this! :) I'll try bringing in one of the freebsd patches now then! |
Actually, for freebsd, it looks like it was failing to build
I notice that the last commit for |
Uh, that's a known error, we only need to rebuild Fontconfig. Do you mind opening a PR with a dummy change to fontconfig? Some libraries built in December have this problem, now fixed. For context: JuliaPackaging/BinaryBuilder.jl#612 |
Oh cool, thanks. |
adeaae3
to
a49ffd3
Compare
Why the linker is trying to use a library of the host system? 😩 |
I ran grep -r musl in the top directory of Graphviz after running |
.......... hahaha omg that's amazing! 😂 Mayyyyyyyybe the |
I'm not sure this the real problem, but I found that the # Compile-time system search path for libraries.
sys_lib_search_path_spec="/opt/x86_64-linux-musl/lib/clang/9.0.1 /opt/x86_64-unknown-freebsd11.1/x86_64-unknown-freebsd11.1/sys-root/usr/lib " For comparison, # Compile-time system search path for libraries.
sys_lib_search_path_spec="/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/4.8.5 /opt/x86_64-linux-gnu/lib/gcc /opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 " so no reference to the build system. Edit: no, that's probably not too relevant, when building for macOS |
I'm sad this cross-compilation has been so difficult. Do you think it would make sense to ask for help in some graphviz forum somewhere? or maybe in a freebsd and/or mingw forum? Have you found success with reaching out to other communities like this in the past? |
Last time I had a look at this, the mingw build was actually compiling all the expected products, but failing to compile something else, so we could probably be on the right track. It's just that the road ahead is still long 😅 I don't remember anymore what was the problem for FreeBSD
That greatly varies. Some upstream communities are more active in helping people out, other are less likely to give you a hand. |
I can't remember if i've already asked this, but since we're having so much trouble getting windows and freebsd to build, is it possible to merge with just the architectures we have so far? Or do you really try to avoid that? It would be really great if we could ship graphviz so that people don't have to install it themselves for PProf (JuliaPerf/PProf.jl#16), and i wanted to start casually exporting some graphs as output from other packages as well, and hoped to use this. |
I think in general the decision of the platforms to support is more on the maintainer of the Julia package that will use the library
I personally don't care much 😅 It's just that it would be nice to make it straightforward to install packages especially on the platform where this is usually more difficult 😂 |
So far, I've only managed to get a few basic linux platforms building. I'll look into the rest, next.
@NHDaly shall we merge? I have the feeling that we should list the |
Sigh, it's too bad.. it would've been awesome to support windows, but yeah i think this is better than nothing!
Sure! I have to admit it's been so long since I looked at this (I started this PR in 2019!) that I really don't remember how it all works.. If that's something easy, I would definitely appreciate you doing it! ❤️ if not, i can have a look at it with you, yeah |
We can still try this later 😉 |
So far, I've only managed to get a few basic linux platforms building.
I'll look into the rest, next.