sundermann / webkitgtk-sharp

C# bindings for WebKitGTK+ 3.0 using GObject Introspection
GNU Lesser General Public License v3.0
5 stars 8 forks source link

Library compiles without error, but generated assembly is "empty" #4

Open frubi opened 9 years ago

frubi commented 9 years ago

Compile after ./autogen.sh

~/build/tools/webkitgtk-sharp$ make
Making all in sources
make[1]: Entering directory '/home/felix/build/tools/webkitgtk-sharp/sources'
cp ./webkitgtk-sharp-api.raw webkitgtk-sharp-api.xml
chmod u+w webkitgtk-sharp-api.xml
/usr/bin/gapi3-fixup --api=./webkitgtk-sharp-api.xml --metadata=./webkitgtk-sharp.metadata
/usr/bin/gapi3-codegen --generate ./webkitgtk-sharp-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/pango-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/atk-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/gtk-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/gio-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/gdk-api.xml -I:/usr/lib/pkgconfig/../../share/gapi-3.0/glib-api.xml  \
    --outdir=generated \
    --glue-filename=./glue/generated.c --gluelib-name=libwebkitgtksharpglue-1.10.2.so \
    --glue-includes=webkit/webkit.h, --gapidir=/usr/lib/pkgconfig/../../share/gapi-3.0 \
    --assembly-name=webkitgtk-sharp && touch generated-stamp
Parser: Could not find include /usr/share/gapi-3.0/soup-sharp-api.xml
WebKit.FaviconDatabase.GetFaviconPixbufFinish - Unknown return type: GdkPixbuf.Pixbuf*
WebKit.FaviconDatabase.TryGetFaviconPixbuf - Unknown return type: GdkPixbuf.Pixbuf*
WebKit.IconDatabase.GetIconPixbuf - Unknown return type: GdkPixbuf.Pixbuf*
WebKit.NetworkRequest.Message - property has unknown type 'SoupMessage*' 
WebKit.NetworkRequest.GetMessage - Unknown return type: SoupMessage*
WebKit.NetworkResponse.Message - property has unknown type 'SoupMessage*' 
WebKit.NetworkResponse.GetMessage - Unknown return type: SoupMessage*
WebKit.SoupAuthDialog.CurrentToplevel - Unknown type SoupMessage* on parameter message
WebKit.SoupAuthDialog.CurrentToplevel - Unknown type SoupMessage* on parameter message
WebKit.SoupAuthDialog - implements unknown GInterface SoupSessionFeature
WebKit.WebView.CreatePluginWidget - Unknown type  on parameter param
WebKit.WebView.CreatePluginWidget - Unknown type  on parameter param
WebKit.WebView.GetIconPixbuf - Unknown return type: GdkPixbuf.Pixbuf*
WebKit.WebView.GetSnapshot - Unknown return type: cairo_surface_t*
WebKit.WebView.TryGetFaviconPixbuf - Unknown return type: GdkPixbuf.Pixbuf*
WebKit.Global.GetDefaultSession - Unknown return type: SoupSession*

Generation Summary:
  Enums: 17  Structs: 1  Boxed: 0  Opaques: 3  Interfaces: 2  Objects: 175  Callbacks: 0
  Properties: 1028  Signals: 84  Methods: 708  Constructors: 12  Throttled: 4
Total Nodes: 2034

/usr/bin/gmcs -nowarn:169 -unsafe -target:library -r:/usr/lib/pkgconfig/../../lib/cli/cairo-sharp-1.10/cairo-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/pango-sharp-3.0/pango-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/atk-sharp-3.0/atk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/gtk-sharp-3.0/gtk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/gio-sharp-3.0/gio-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/gdk-sharp-3.0/gdk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/glib-sharp-3.0/glib-sharp.dll  \
    AssemblyInfo.cs   -r:Mono.Cairo  -r:/usr/local/lib/mono/soup-sharp/soup-sharp.dll  generated/*.cs -out:../out/webkitgtk-sharp.dll
AssemblyInfo.cs(11,12): warning CS1699: Use compiler option `keyfile' or appropriate project settings instead of `AssemblyKeyFile' attribute
Compilation succeeded - 1 warning(s)
make[1]: Leaving directory '/home/felix/build/tools/webkitgtk-sharp/sources'
Making all in sources/glue
make[1]: Entering directory '/home/felix/build/tools/webkitgtk-sharp/sources/glue'
/bin/bash ../../libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"webkitgtk-sharp\" -DPACKAGE_TARNAME=\"webkitgtk-sharp\" -DPACKAGE_VERSION=\"2.0.0\" -DPACKAGE_STRING=\"webkitgtk-sharp\ 2.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"webkitgtk-sharp\" -DVERSION=\"2.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -pthread -I/usr/include/webkitgtk-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/webkitgtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -I../..    -g -O2 -MT generated.lo -MD -MP -MF .deps/generated.Tpo -c -o generated.lo generated.c
libtool: compile:  gcc -DPACKAGE_NAME=\"webkitgtk-sharp\" -DPACKAGE_TARNAME=\"webkitgtk-sharp\" -DPACKAGE_VERSION=\"2.0.0\" "-DPACKAGE_STRING=\"webkitgtk-sharp 2.0.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"webkitgtk-sharp\" -DVERSION=\"2.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -pthread -I/usr/include/webkitgtk-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/webkitgtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../.. -g -O2 -MT generated.lo -MD -MP -MF .deps/generated.Tpo -c generated.c  -fPIC -DPIC -o .libs/generated.o
libtool: compile:  gcc -DPACKAGE_NAME=\"webkitgtk-sharp\" -DPACKAGE_TARNAME=\"webkitgtk-sharp\" -DPACKAGE_VERSION=\"2.0.0\" "-DPACKAGE_STRING=\"webkitgtk-sharp 2.0.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"webkitgtk-sharp\" -DVERSION=\"2.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -pthread -I/usr/include/webkitgtk-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/webkitgtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../.. -g -O2 -MT generated.lo -MD -MP -MF .deps/generated.Tpo -c generated.c -o generated.o >/dev/null 2>&1
mv -f .deps/generated.Tpo .deps/generated.Plo
/bin/bash ../../libtool  --tag=CC   --mode=link gcc  -g -O2 -module -avoid-version -no-undefined  -o libwebkitgtksharpglue-1.10.2.la -rpath /usr/local/lib  generated.lo -lwebkitgtk-3.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-3.0 -lglib-2.0  
libtool: link: gcc -shared  -fPIC -DPIC  .libs/generated.o   -lwebkitgtk-3.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-3.0 -lglib-2.0  -O2   -Wl,-soname -Wl,libwebkitgtksharpglue-1.10.2.so -o .libs/libwebkitgtksharpglue-1.10.2.so
libtool: link: ar cru .libs/libwebkitgtksharpglue-1.10.2.a  generated.o
libtool: link: ranlib .libs/libwebkitgtksharpglue-1.10.2.a
libtool: link: ( cd ".libs" && rm -f "libwebkitgtksharpglue-1.10.2.la" && ln -s "../libwebkitgtksharpglue-1.10.2.la" "libwebkitgtksharpglue-1.10.2.la" )
make[1]: Leaving directory '/home/felix/build/tools/webkitgtk-sharp/sources/glue'
Making all in doc
make[1]: Entering directory '/home/felix/build/tools/webkitgtk-sharp/doc'
Generating webkitgtk-sharp-docs.source
/usr/bin/monodocer -assembly:../out/webkitgtk-sharp.dll -path:en
Members Added: 0, Members Deleted: 0
/usr/bin/mdassembler --ecma ./en -o webkitgtk-sharp-docs
/usr/bin/mdassembler --ecma ./en -o webkitgtk-sharp-docs
make[1]: Leaving directory '/home/felix/build/tools/webkitgtk-sharp/doc'
make[1]: Entering directory '/home/felix/build/tools/webkitgtk-sharp'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/felix/build/tools/webkitgtk-sharp'

Inspecting the output with monodis

~/build/tools/webkitgtk-sharp$ monodis out/webkitgtk-sharp.dll
.assembly extern mscorlib
{
  .ver 2:0:0:0
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
}
.assembly 'webkitgtk-sharp'
{
  .custom instance void class [mscorlib]System.Reflection.AssemblyTitleAttribute::'.ctor'(string) =  (01 00 07 57 65 62 4B 69 74 23 00 00 ) // ...WebKit#..

  .custom instance void class [mscorlib]System.Reflection.AssemblyDescriptionAttribute::'.ctor'(string) =  (
        01 00 1B 77 65 62 6B 69 74 67 74 6B 20 62 69 6E   // ...webkitgtk bin
        64 69 6E 67 73 20 66 6F 72 20 4D 6F 6E 6F 00 00 ) // dings for Mono..

  .custom instance void class [mscorlib]System.Reflection.AssemblyCompanyAttribute::'.ctor'(string) =  (01 00 00 00 00 ) // .....

  .custom instance void class [mscorlib]System.Reflection.AssemblyCopyrightAttribute::'.ctor'(string) =  (
        01 00 27 32 30 31 34 20 41 6E 64 72 65 69 61 20   // ..'2014 Andreia 
        47 61 69 74 61 20 26 20 53 74 65 70 68 61 6E 20   // Gaita & Stephan 
        53 75 6E 64 65 72 6D 61 6E 6E 00 00             ) // Sundermann..

  .custom instance void class [mscorlib]System.Reflection.AssemblyDelaySignAttribute::'.ctor'(bool) =  (01 00 00 00 00 ) // .....

  .custom instance void class [mscorlib]System.Reflection.AssemblyKeyFileAttribute::'.ctor'(string) =  (
        01 00 13 77 65 62 6B 69 74 67 74 6B 2D 73 68 61   // ...webkitgtk-sha
        72 70 2E 73 6E 6B 00 00                         ) // rp.snk..

  .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
        01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
        63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.

  .permissionset reqmin = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}}
  .hash algorithm 0x00008004
  .ver  2:0:0:0
  .publickey = (
        00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00   // .$..............
        00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00   // .$..RSA1........
        53 FF 6A 90 91 2F DC 8B CD 0A 73 76 B2 F3 AE 0A   // S.j../....sv....
        64 49 EA E3 7F DA 01 B4 46 6C BF 7E DA D4 1C 1E   // dI......Fl.~....
        35 ED B2 53 FD 82 F4 5B EA F8 C7 3C F7 3D 89 18   // 5..S...[...<.=..
        D9 8A CF BE E4 EF 26 E7 48 B8 CA 8C 63 B6 F7 70   // ......&.H...c..p
        C0 55 B9 E6 61 3D 48 B8 D3 82 E0 C3 4D 39 E4 E6   // .U..a=H.....M9..
        A8 EE CC B8 C1 D5 81 8A 5B B6 89 F9 D2 44 3A 17   // ........[....D:.
        BF F9 71 99 45 D5 39 E2 25 BD 17 5D A9 7B 35 DA   // ..q.E.9.%..].{5.
        AB 98 BC 9E 1F 7F 5B 91 36 60 52 AD BB 7C F9 B5 ) // ......[.6`R..|..
}
.module 'webkitgtk-sharp.dll' // GUID = {5EEF0BFC-6F72-4DDD-B9DF-F57A1476F251}

.custom instance void class [mscorlib]System.Security.UnverifiableCodeAttribute::'.ctor'() =  (01 00 00 00 ) // ....
shana commented 9 years ago

Is there anything in the "generated" directory?

sundermann commented 9 years ago

It's weird since the generator has all the methods in the generation summary. Check that your generated folder is writable. With which gtk# are you using?

frubi commented 9 years ago

I don't have a generated directory in the root of the project. There is only a generated folder below sources. It's writeable and contains a lot of files (Not empty and looks like valid C#).

$ ls -R sources/generated
sources/generated:
Soup

sources/generated/Soup:
AddressCallback.cs                ClientContext.cs             Logger.cs                     Request.cs                          SoupSharp.AuthDomainBasicAuthCallbackNative.cs
Address.cs                        ConnectionCreatedHandler.cs  LoggerFilter.cs               RequestData.cs                      SoupSharp.AuthDomainDigestAuthCallbackNative.cs
AddressFamily.cs                  Connection.cs                LoggerLogLevel.cs             Requester.cs                        SoupSharp.AuthDomainFilterNative.cs
AuthBasic.cs                      ConnectionState.cs           LoggerPrinter.cs              RequesterError.cs                   SoupSharp.AuthDomainGenericAuthCallbackNative.cs
Auth.cs                           Constants.cs                 MemoryUse.cs                  RequestError.cs                     SoupSharp.ChunkAllocatorNative.cs
AuthDigest.cs                     ContentDecoder.cs            MessageBody.cs                RequestFile.cs                      SoupSharp.LoggerFilterNative.cs
AuthDomainBasicAuthCallback.cs    ContentSniffer.cs            Message.cs                    RequestFinishedHandler.cs           SoupSharp.LoggerPrinterNative.cs
AuthDomainBasic.cs                Cookie.cs                    MessageFlags.cs               RequestHTTP.cs                      SoupSharp.MessageHeadersForeachFuncNative.cs
AuthDomain.cs                     CookieJarAcceptPolicy.cs     MessageHeaders.cs             RequestQueuedHandler.cs             SoupSharp.PasswordManagerCallbackNative.cs
AuthDomainDigestAuthCallback.cs   CookieJar.cs                 MessageHeadersForeachFunc.cs  RequestReadHandler.cs               SoupSharp.ProxyURIResolverCallbackNative.cs
AuthDomainDigest.cs               CookieJarDB.cs               MessageHeadersIter.cs         RequestStartedHandler.cs            SoupSharp.ServerCallbackNative.cs
AuthDomainFilter.cs               CookieJarText.cs             MessageHeadersType.cs         RequestUnqueuedHandler.cs           SoupSharp.SessionCallbackNative.cs
AuthDomainGenericAuthCallback.cs  Date.cs                      MessageQueue.cs               ServerCallback.cs                   SoupSharp.SocketCallbackNative.cs
AuthenticateHandler.cs            DateFormat.cs                MessageQueueItem.cs           Server.cs                           TLDError.cs
AuthManager.cs                    Encoding.cs                  Multipart.cs                  SessionAsync.cs                     TunnelingHandler.cs
AuthNTLM.cs                       Expectation.cs               NewConnectionHandler.cs       SessionCallback.cs                  URI.cs
Buffer.cs                         Global.cs                    PasswordManagerAdapter.cs     Session.cs                          WroteBodyDataHandler.cs
Cacheability.cs                   GotChunkHandler.cs           PasswordManagerCallback.cs    SessionFeatureAdapter.cs            XMLRPCError.cs
Cache.cs                          HTTPVersion.cs               ProxyResolverDefault.cs       SessionSync.cs                      XMLRPCFault.cs
CacheResponse.cs                  IPasswordManager.cs          ProxyURIResolverAdapter.cs    SocketCallback.cs
CacheType.cs                      IProxyURIResolver.cs         ProxyURIResolverCallback.cs   Socket.cs
ChangedHandler.cs                 ISessionFeature.cs           Range.cs                      SocketIOStatus.cs
ChunkAllocator.cs                 KnownStatusCode.cs           RequestAbortedHandler.cs      SoupSharp.AddressCallbackNative.cs

I'm using Gtk# from the Debian Unstable repository.

$ pkg-config gtk-sharp-3.0 --modversion
2.99.3
$ pkg-config gtk-sharp-2.0 --modversion 
2.12.10
carlosmn commented 8 years ago

The compiler options seem odd. All the file are one deeper than sources/generated so having just generated/*.cs there would not include any of the contents, it needs to include generated/*/*.cs for the bindings to get compiled. This looks to have been fixed with f9154e557 which is later than the last comment here.

@frubi could you check with the current sources? It should work now.