Discussion:
PluginManagerPrivate::loadQueue question
(too old to reply)
Szyk Cech
2018-09-23 14:13:52 UTC
Permalink
Hi all!

I study carefully Qt Creator plugin system. I just read
PluginManagerPrivate::loadQueue functions and thought about it for a
while and my question arise:

Is it true:

PluginManagerPrivate::loadQueue can return false (mean fail) if we have
2 (or more) plugins which depend on other plugin simultaneously?

In e.g.:

I have plugin0 which depend on plugins plugin1 and plugin2 and these two
both based on plugin3. Then PluginManagerPrivate::loadQueue fail and
report circulation dependencies?

Why is this wrong - I think it should be possible load such plugins
(plugin1 and plugin2 after 3 and then load plugin0). Is this not fesible?!?

Or maybe I am wrong and this is not the case...

best regards

Szyk Cech
Szyk Cech
2018-09-23 17:12:51 UTC
Permalink
Hi again!

Please correct me if I am wrong, but:

Instead of this declaration:

bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec
*> &queue,
        QList<PluginSpec *> &circularityCheckQueue)

correct will be:

bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec
*> &queue,
        QList<PluginSpec *> circularityCheckQueue)

It shouldn't be any impact on performance (besides copy on write) as
QList is one pointer based template class. But what is important passing
by value circularityCheckQueue allow as to build function invocation
tree instead simple list when it is passed by reference. This will
happen because QList has feature "copy on write" which is required in
this approach (otherwise we will have faltered tree to simple list where
all branches are treated as one). Then we check all branches in the
recurrention tree separately. Passing circularityCheckQueue by reference
build virtual list instead tree, so I think it disallow dependency
mentioned in my previous message.
Post by Szyk Cech
Hi all!
I study carefully Qt Creator plugin system. I just read
PluginManagerPrivate::loadQueue functions and thought about it for a
PluginManagerPrivate::loadQueue can return false (mean fail) if we
have 2 (or more) plugins which depend on other plugin simultaneously?
I have plugin0 which depend on plugins plugin1 and plugin2 and these
two both based on plugin3. Then PluginManagerPrivate::loadQueue fail
and report circulation dependencies?
Why is this wrong - I think it should be possible load such plugins
(plugin1 and plugin2 after 3 and then load plugin0). Is this not fesible?!?
Or maybe I am wrong and this is not the case...
best regards
Szyk Cech
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Pascal COMBES
2018-09-23 19:13:26 UTC
Permalink
Hello,
    If I understand well the situation you describe, you are wrong, it
is feasible and it is done: As you can see in the attachment (which is
the dependency tree of Qt Creator 4.7.0 generated with
https://github.com/pasccom/qtcreator-deptree), the situation arises with
e.g. :
    -plugin0=QmlJS
    -plugin1=ExtensionSystem
    -plugin2=CPlusPlus
    -plugin3=Utils.
    I think, even though I did not check the code, that it prevents
situation where we have a circular dependency (A depends on B depends on
C depends on A).
    Best regards,
Pascal COMBES
Post by Szyk Cech
Hi all!
I study carefully Qt Creator plugin system. I just read
PluginManagerPrivate::loadQueue functions and thought about it for a
PluginManagerPrivate::loadQueue can return false (mean fail) if we
have 2 (or more) plugins which depend on other plugin simultaneously?
I have plugin0 which depend on plugins plugin1 and plugin2 and these
two both based on plugin3. Then PluginManagerPrivate::loadQueue fail
and report circulation dependencies?
Why is this wrong - I think it should be possible load such plugins
(plugin1 and plugin2 after 3 and then load plugin0). Is this not fesible?!?
Or maybe I am wrong and this is not the case...
best regards
Szyk Cech
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Loading...