Skip to content
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

Use JLL package to provide GtkSourceView #9

Merged
merged 2 commits into from
Dec 31, 2019

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Dec 29, 2019

Fix #8. (yes, loading time is not great at the moment...)

This is a draft because I need to debug the macOS failure. Fixed

@giordano
Copy link
Contributor Author

giordano commented Dec 29, 2019

For reference, the error is

ERROR: LoadError: InitError: could not load library "/Users/travis/.julia/artifacts/baa5f6ede9893e48e57d587ff7ff40bfcef0e402/lib/libgtksourceview-4.0.dylib"
dlopen(/Users/travis/.julia/artifacts/baa5f6ede9893e48e57d587ff7ff40bfcef0e402/lib/libgtksourceview-4.0.dylib, 1): Library not loaded: @rpath/libxml2.2.dylib
  Referenced from: /Users/travis/.julia/artifacts/baa5f6ede9893e48e57d587ff7ff40bfcef0e402/lib/libgtksourceview-4.0.dylib
  Reason: Incompatible library version: libgtksourceview-4.0.dylib requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

However:

sandbox:${WORKSPACE}/srcdir/gtksourceview-4.4.0/build # otool -L ${libdir}/libgtksourceview-4.dylib 
/workspace/destdir/lib/libgtksourceview-4.dylib:
        /workspace/destdir/lib/libgtksourceview-4.0.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
        @rpath/libfribidi.0.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libglib-2.0.0.dylib (compatibility version 5901.0.0, current version 5901.0.0)
        @rpath/libintl.8.dylib (compatibility version 10.0.0, current version 10.6.0)
        @rpath/libgobject-2.0.0.dylib (compatibility version 5901.0.0, current version 5901.0.0)
        @rpath/libgio-2.0.0.dylib (compatibility version 5901.0.0, current version 5901.0.0)
        @rpath/libgtk-3.0.dylib (compatibility version 2407.0.0, current version 2407.4.0)
        @rpath/libgdk-3.0.dylib (compatibility version 2407.0.0, current version 2407.4.0)
        @rpath/libpango-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
        @rpath/libpangocairo-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
        @rpath/libcairo.2.dylib (compatibility version 11603.0.0, current version 11603.0.0)
        @rpath/libatk-1.0.0.dylib (compatibility version 23411.0.0, current version 23411.1.0)
        @rpath/libgdk_pixbuf-2.0.0.dylib (compatibility version 3904.0.0, current version 3904.0.0)
        @rpath/libxml2.2.dylib (compatibility version 12.0.0, current version 12.9.0)
sandbox:${WORKSPACE}/srcdir/gtksourceview-4.4.0/build # otool -L ${libdir}/libxml2.2.dylib 
/workspace/destdir/lib/libxml2.2.dylib:
        @rpath/libxml2.2.dylib (compatibility version 12.0.0, current version 12.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
        @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

So we're providing the right libxml, but maybe there is another one in the system overriding it?

@giordano
Copy link
Contributor Author

Ok, it looks like the system copy of libxml2.2.dylib is the culprit. In this Travis job I load only Gtk.jl and then run Libdl.dllist(): /usr/lib/libxml2.2.dylib is already loaded. I also run

$ otool -L /usr/lib/libxml2.2.dylib
/usr/lib/libxml2.2.dylib:
	/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
	/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 59.1.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

which confirms that it's this library that has the unexpected compatibility version.

@staticfloat: any idea about how to avoid this? Note that there are also other system libraries like /usr/lib/libz.1.dylib, /usr/lib/libbz2.1.0.dylib, /usr/lib/libiconv.2.dylib which is probably something that we don't want 😞

@giordano
Copy link
Contributor Author

giordano commented Dec 30, 2019

I just noted that our libxml2 depends on system libiconv, which is probably wrong? I assume we should add libiconv to the dependencies of xml2. Maybe other libraries are dragging system libxml2 in the same way?

@giordano
Copy link
Contributor Author

In this other job I run otool -L on all open libraries, after loading Gtk.jl. I think we need to fix a few other libraries, like Gettext

@giordano giordano closed this Dec 30, 2019
@giordano giordano reopened this Dec 30, 2019
@giordano giordano marked this pull request as ready for review December 30, 2019 22:07
@giordano
Copy link
Contributor Author

Problems on macOS have been fixed, this is ready to go when you want (and if you're happy with loading time 😬 )

@jonathanBieler
Copy link
Collaborator

jonathanBieler commented Dec 31, 2019

Awesome! it's supposed to work on windows as well, right ? We could add it to travis.

@giordano
Copy link
Contributor Author

I added Windows to Travis, it seems to be happy. I also updated the README.md.

As a nice side effect of using the JLL package, you don't need to ship the language-specs directory here.

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.

Use BinaryBuilder ?
2 participants