tieto / sipe

A third-party Pidgin plugin for Microsoft Lync/OCS - clone of upstream http://repo.or.cz/w/siplcs.git
GNU General Public License v2.0
129 stars 24 forks source link

pidgin 3 doesn't load sipe under Arch #40

Closed danboid closed 8 years ago

danboid commented 8 years ago

I have installed libnice from https://github.com/tieto/libnice , gplugin-hg, purple-hg and pidgin-hg from the AUR and sipe from https://github.com/tieto/sipe under Arch x64.

After I initially installed pidgin, it was loading ('About' said it was version 3.0.0 something) but it wasn't loading the sipe plugin. If I started it from the terminal I'd see the warnings:

(Pidgin:949): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': the query function did not return a GPluginPluginInfo instance

(Pidgin:949): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': the query function did not return a GPluginPluginInfo instance

So, I thought I'd reboot to see if it made any difference. It did, but in a bad way. Now pidgin doesn't load at all and I get some extra messages about Java (?) that I wasn't seeing before when it did load:

$ pidgin 

(Pidgin:949): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': the query function did not return a GPluginPluginInfo instance

(Pidgin:949): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': the query function did not return a GPluginPluginInfo instance
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (Arch Linux build 7.u95_2.6.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
danboid commented 8 years ago

Ooops!

Please ignore what I said about pidgin not loading. It does still load fine actually, it just doesn't raise its window to the foreground so I wasn't seeing its window appear behind the windows of other running programs.

The gplugin warning is still an issue but sometimes the number after the colon is different. For example, the last time I ran it it said:

(Pidgin:2773): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': the query function did not return a GPluginPluginInfo instance

xhaakon commented 8 years ago

Yeah, error messages coming from GPlugin aren't very useful. I'd recommend putting breakpoints in gplugin_native_loader_query() and looking at contents of error variable right after the program returns from gplugin_native_loader_open_and_query() (or just print it out).

I guess it will be some unresolved symbol in libsipe.so that's actually causing this.

static GPluginPlugin *
gplugin_native_loader_query(GPluginLoader *loader,
                            const gchar *filename,
                            GError **error)
{
    GPluginPlugin *plugin = NULL;
    const GPluginPluginInfo *info = NULL;
    GPluginNativePluginLoadFunc load = NULL;
    GPluginNativePluginQueryFunc query = NULL;
    GPluginNativePluginUnloadFunc unload = NULL;
    GModule *module = NULL;

    info = gplugin_native_loader_open_and_query(filename, &module, 0, &query,
                                                error);

    // *** Here, 'error' still might carry something meaningful ***

    if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
        if(module)
            g_module_close(module);

        if(error) {
            *error = g_error_new(GPLUGIN_DOMAIN, 0,
                                 _("the query function did not return a "
                                   "GPluginPluginInfo instance"));
        }

        return NULL;
    }

    if(gplugin_plugin_info_get_bind_local(info)) {
        g_module_close(module);
        g_object_unref(G_OBJECT(info));

        info = gplugin_native_loader_open_and_query(filename, &module,
                                                    G_MODULE_BIND_LOCAL,
                                                    &query, error);

    // *** Here, 'error' still might carry something meaningful ***

        if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
            g_module_close(module);

            if(error) {
                *error = g_error_new(GPLUGIN_DOMAIN, 0,
                                     _("the query function did not return a "
                                       "GPluginPluginInfo instance"));
            }

            return NULL;
        }
    }

This will have to be reported upstream since it's not the first time I came across it and it's very annoying.

danboid commented 8 years ago

Hi xhaakon

Could you provide a patch if you want me to provide some debug info please? I have not been able to find gplugin_native_loader_query() nor gplugin_native_loader_open_and_query() in the source trees of pidgin or sipe so I'm not sure where you want me to add the breakpoints. I suspect it will be in main/libpurple/plugins.h for pidgin hg?

I'll report this error to pidgin too.

danboid commented 8 years ago

https://developer.pidgin.im/ticket/16976#ticket

xhaakon commented 8 years ago

I have not been able to find gplugin_native_loader_query() nor plugin_native_loader_open_and_query() in the source trees of pidgin or sipe so I'm not sure where you want me to add the breakpoints. I suspect it will be in main/libpurple/plugins.h for pidgin hg?

It's in GPlugin library which is a separate project from Pidgin (https://bitbucket.org/gplugin/main/wiki/Home). You must have installed it before building Pidgin 3.

https://developer.pidgin.im/ticket/16976#ticket

It might have been better if you reported the issue to the bitbucket project I mentioned above, but Gary Kramlich who develops GPlugin is also a Pidgin developer, so he likely will notice your ticket :)

grimmy commented 8 years ago

I can fix the error message, but there's still and underlying problem here that it's not going to fix, but will make more apparent.

@xhaakon if the messages have been bad, why haven't you opened an issue before?

grimmy commented 8 years ago

Actually this might be a really dumb problem. Make sure you've run sudo ldconfig and then try running pidgin again.

grimmy commented 8 years ago

The error reporting has been fixed in gplugin's mercurial. I'm not sure who updates the gplugin-hg package, but i'll release the new version later this week.

In the mean time, the real issue still needs to be determined.

danboid commented 8 years ago

I've just now updated gplugin from git then I updated pidgin-hg and ran sudo ldconfig for good measure. Now when I start pidgin from the terminal I don't get any errors at all but pidgin-sipe still doesn't show up under the pidgin plugins window either.

I thought it might be worth rebuilding pidgin-sipe too but the latest git fails to build for me:

Making all in purple make[3]: Entering directory '/home/dan/src/sipe/src/purple' /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -Werror -Wall -Wextra -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Wdeprecated-declarations -Winit-self -Wmaybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef -Wunused-but-set-variable -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./../api -DLOCALEDIR=\"/usr/share/locale\" -g -O2 -MT libsipe_backend_la-purple-user.lo -MD -MP -MF .deps/libsipe_backend_la-purple-user.Tpo -c -o libsipe_backend_la-purple-user.lo test -f 'purple-user.c' || echo './'purple-user.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -Werror -Wall -Wextra -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Wdeprecated-declarations -Winit-self -Wmaybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef -Wunused-but-set-variable -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./../api -DLOCALEDIR=\"/usr/share/locale\" -g -O2 -MT libsipe_backend_la-purple-user.lo -MD -MP -MF .deps/libsipe_backend_la-purple-user.Tpo -c purple-user.c -fPIC -DPIC -o .libs/libsipe_backend_la-purple-user.o purple-user.c: In function ‘sipe_backend_user_ask_choice’: purple-user.c:118:3: error: too many arguments to function ‘purple_request_field_choice_add’ purple_request_field_choice_add(field, ^ In file included from purple-user.c:28:0: /usr/include/libpurple/request.h:864:6: note: declared here void purple_request_field_choice_add(PurpleRequestField _field, ^ Makefile:1038: recipe for target 'libsipe_backendla-purple-user.lo' failed make[3]: ** [libsipe_backend_la-purple-user.lo] Error 1 make[3]: Leaving directory '/home/dan/src/sipe/src/purple' Makefile:428: recipe for target 'all-recursive' failed make[2]: * [all-recursive] Error 1 make[2]: Leaving directory '/home/dan/src/sipe/src' Makefile:502: recipe for target 'all-recursive' failed make[1]: * [all-recursive] Error 1 make[1]: Leaving directory '/home/dan/src/sipe' Makefile:434: recipe for target 'all' failed make: *\ [all] Error 2

I should note that libpurple also got updated when I updated pidgin.

xhaakon commented 8 years ago

purple-user.c: In function ‘sipe_backend_user_ask_choice’: purple-user.c:118:3: error: too many arguments to function ‘purple_request_field_choice_add’

It seems you're building Sipe against Pidgin 2.x, where that function really had just two arguments. You should use Pidgin 3.

danboid commented 8 years ago

Nope. pidgin-hg in the AUR is pidgin 3.0.0. I uninstalled pidgin 2.

Have you tried building the plugin against the very latest libpurple & pidgin?

xhaakon commented 8 years ago

Have you tried building the plugin against the very latest libpurple & pidgin?

I have and purple_request_field_choice_add still has three arguments...

danboid commented 8 years ago

I'm a bit confused about pidgin-hg now. Are there two pidgin-hg trees, a 2.x and a 3.x somewhere?

When I initially reported this bug, Pidgin's About menu reported it as being 3.0.0 so I presumed with my last report it would still be 3.x after rebuilding it using the same pidgin-hg AUR PKGBUILD but when I checked today About said it was actually 2.x.x which might explain why I can't build the new sipe plugin anymore.

The hg repo used by the Arch pidgin-hg PKGBUILD is https://hg.pidgin.im/pidgin/main

xhaakon commented 8 years ago

The hg repo used by the Arch pidgin-hg PKGBUILD is https://hg.pidgin.im/pidgin/main

The URL is right, but there are two branches: release-2.x.y and default. Pidgin 3 is in the latter one.

My guess is that your PKGBUILD builds the latest change in the repo ('tip'), which may be from any version, depending on which branch was updated the last. If you look right now, 'tip' is at release-2.x.y. Thus the package flips randomly between Pidgin 2 and 3.

The PKGBUILD must somehow specify it wants the latest version from default only, not the whole repository.

danboid commented 8 years ago

That'll explain the mix-up then!

What would be the hg command to check out the latest default branch?

danboid commented 8 years ago

OK I know what's what now! :)

There is a line within the pidgin-hg PKGBUILD:

source=('pidgin::hg+https://hg.pidgin.im/pidgin/main')

This needs to be changed to:

source=('pidgin::hg+https://hg.pidgin.im/pidgin/main#branch=default')

To force checking out the default branch.

I've rebuilt both pidgin and pidgin-sipe (and did an ldconfig) and now it says:

$ pidgin

(Pidgin:19139): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': Failed to open plugin '/usr/lib/purple-3/libsipe.so': /usr/lib/purple-3/libsipe.so: undefined symbol: sipe_core_applicationsharing_is_presenting

(Pidgin:19139): GPlugin-WARNING **: failed to query '/usr/lib/purple-3/libsipe.so' with loader 'GPluginNativeLoader': Failed to open plugin '/usr/lib/purple-3/libsipe.so': /usr/lib/purple-3/libsipe.so: undefined symbol: sipe_core_applicationsharing_is_presenting java version "1.7.0_95" OpenJDK Runtime Environment (IcedTea 2.6.4) (Arch Linux build 7.u95_2.6.4-1-x86_64) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

grimmy commented 8 years ago

I still don't understand why you're seeing java stuff... GPlugin has a java loader in the works, but it's not on the default or develop branches and hasn't been touched in awhile regardless.

xhaakon commented 8 years ago

I still don't understand why you're seeing java stuff...

@grimmy couldn't it be IcedTea plugin being loaded by webkit?

grimmy commented 8 years ago

@xhaakon ah I suppose so, just seems oddly timed.

grimmy commented 8 years ago

Also, good to see the error messages are working correctly now ;)

danboid commented 8 years ago

Do you know what my sipe problem is xhaakon? Have you had chance to look at it yet?

xhaakon commented 8 years ago

Do you know what my sipe problem is?

Sorry @danboid, I missed that...

/usr/lib/purple-3/libsipe.so: undefined symbol: sipe_core_applicationsharing_is_presenting

This looks as if you didn't have FreeRDP installed when you were building Sipe. If Arch doesn't have some very recent version, like a snapshot from a month ago, you'll have to build it yourself from their master.

danboid commented 8 years ago

I might be able to close this ticket as it seems I have got sipe loading under pidgin 3.0.0 now. I don't get any sipe/gplugin errors when loading pidgin and I can see 'Office Communicator' under the Plug-ins window.

However, things are no better then when I was running the latest stable sipe release under pidgin 2.x in that I either see no buddies or if any appear they're greyed out and marked as offline when I know they're online. This only started happening when we switched from Lync to SFB.

I was told in #pidgin that Office 365 / Skype For Business IM was working under the latest pidgin, libnice and pidgin-sipe. Is this not actually the case yet?

xnandersson commented 8 years ago

I don't think anyone has tested with Skype For Business. We are targeting Lync Server 2013.

xhaakon commented 8 years ago

However, things are no better then when I was running the latest stable sipe release under pidgin 2.x in that I either see no buddies or if any appear they're greyed out and marked as offline when I know they're online. This only started happening when we switched from Lync to SFB.

Oh, if that's your main concern you should have said that in the first place. This repository contains only a couple of extra multimedia features on top of stable Sipe, which are not yet upstream. It means that if stable Sipe doesn't work for you, code from this git or running Sipe with Pidgin 3 won't help you either.

You may consider opening a ticket describing your problem in official Sipe upstream (with all relevant Pidgin logs etc., see how to report sipe problems).