Move 'manual' plugin into Mumble itself.

The machinery needed to support the "manual" plugin as a DLL
file on Windows is very complex.

This is because we build Mumble itself as mumble_app.dll and link
our dependencies statically. And also because of various changes
made in Qt 5.

The manual plugin uses Qt. When Mumble linked dynamically against
Qt4Gui.dll, etc. - everything worked fine. The manual plugin simply
linked against the same DLLs.

With the move to mumble_app.dll, we also moved to statically link
against Qt for mumble_app.dll.

To accommodate the manual plugin, we implemented various hacks to
export the Qt symbols from mumble_app.dll that were necessary for
loading the manual plugin.

And that worked for a while.

However, right now, with Qt 5.6, the plugin is broken. And I get
a lot of weird crashes when interacting with the manual plugin.

Most of it boils down to the fact that both manual.dll and mumble_app.dll
have copies of statically initialized data, like QArrayData::shared_null.
Sharing objects between mumble_app.dll and manual.dll in this scenario is
impossible, because using the object in one module will cause one set of
statically initialized data to be used, while use in the other will cause
the other data to be accessed. This is especially bad for things that use
reference counting, because it'll get out of sync.

So, to get rid of this mess, we're moving the manual plugin into Mumble
itself. Functionally, it doesn't change anything. The manual plugin could
not be auto-updated because it depended on a specific Qt and Mumble
version. Mostly because it depended on the correct set of Qt symbols to be
exported from mumble_app.dll.

The plugin now works correctly, and we can safely remove a lot of the
hacks that were required to load the manual plugin in its earlier
incarnation.

The only downside is that we can't test the manual plugin in PAHelper.
But that wasn't really the case before either, because the plugin
practically depended on Mumble to run.
This commit is contained in:
Mikkel Krautz 2016-07-16 14:46:31 +02:00
parent 3ea298a58f
commit a179f5d249
8 changed files with 9 additions and 43 deletions

View File

@ -1,2 +0,0 @@
QMAKEFEATURES=$$_PRO_FILE_PWD_/features/
QMAKE_TARGET_BUNDLE_PREFIX=net.sourceforge.mumble

View File

@ -1,8 +0,0 @@
LIBS -= -lQtCore -lQtGui
LIBS -= -lQtCored -lQtGuid
LIBS -= -lQt5Core -lQt5Gui -lQt5Widgets
LIBS -= -lQt5Cored -lQt5Guid -lQt5Widgetsd
macx {
LIBS += -undefined dynamic_lookup
}

View File

@ -1,29 +0,0 @@
# Copyright 2005-2016 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
include(../plugins.pri)
TARGET = manual
CONFIG += qt
isEqual(QT_MAJOR_VERSION, 5) {
QT *= widgets
}
HEADERS = manual.h
SOURCES = manual.cpp
FORMS += manual.ui
# Link against mumble_app.dll when
# building for win32-static.
win32:CONFIG(qt_dynamic_lookup) {
CONFIG(debug, debug|release) {
QMAKE_LIBDIR *= ../../debug
}
CONFIG(release, debug|release) {
QMAKE_LIBDIR *= ../../release
}
LIBS *= -lmumble_app
}

View File

@ -6,7 +6,7 @@
TEMPLATE = subdirs
CONFIG += debug_and_release
SUBDIRS = link manual
SUBDIRS = link
DIST = plugins.pri
win32 {

View File

@ -14,8 +14,6 @@
#endif
#include <QPointer>
#include <math.h>
#include <float.h>
#include "manual.h"
#include "ui_manual.h"
@ -27,7 +25,7 @@ typedef WId HWND;
#define DLL_PUBLIC __declspec(dllexport)
#endif
#include "../mumble_plugin.h"
#include "../../plugins/mumble_plugin.h"
static QPointer<Manual> mDlg = NULL;
static bool bLinkable = false;

View File

@ -284,6 +284,13 @@ isEmpty(QMAKE_LRELEASE) {
}
}
!CONFIG(no-manual-plugin) {
SOURCES *= manual.cpp
HEADERS *= manual.h
FORMS *= manual.ui
DEFINES *= USE_MANUAL_PLUGIN
}
unix:!CONFIG(bundled-speex):system(pkg-config --atleast-version=1.2 speexdsp):system(pkg-config --atleast-version=1.2 speex) {
CONFIG *= no-bundled-speex
}