Bug 386456 - tests fail – kirigamiplugin doesn't register components
Summary: tests fail – kirigamiplugin doesn't register components
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.39.0
Platform: Other Linux
: NOR major
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-02 11:24 UTC by h.goebel
Modified: 2019-01-01 22:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description h.goebel 2017-11-02 11:24:42 UTC
Running the tests of kirigami 5.39.0 fail with several errors like this:

  file://…/build/bin/org/kde/kirigami.2/ApplicationWindow.qml:97:1: Type AbstractApplicationWindow unavailable 
       AbstractApplicationWindow { 
       ^

When strace-ing the tests (see below), I discovered that
AbstractApplicationWindow.qml is searched in the wrong directory:
It exists in
–/build/bin/org/kde/kirigami.2/, but is searched in 
…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/.

Additionally it is searched *twice*.

The pattern of the strace matches the code:
`KirigamiPlugin::registerTypes()` is registering the types [1] in this
order, and `KirigamiPlugin::componentUrl()` [2] tries to resolve them
based on the list of styles. Since `AbstractApplicationWindow.qml` is
not part of the style, `componentUrl()` falls back to
`resolveFileUrl()` [3] – to this is the second try.


[1] https://cgit.kde.org/kirigami.git/tree/src/kirigamiplugin.cpp?h=v5.39.0#n91
[2] https://cgit.kde.org/kirigami.git/tree/src/kirigamiplugin.cpp?h=v5.39.0#n40
[3] https://cgit.kde.org/kirigami.git/tree/src/kirigamiplugin.h?h=v5.39.0#n87


.....8<---------------
stat("…/build/bin/org/kde/kirigami.2//styles/org.kde.desktop", {st_mode=S_IFDIR|0755, st_size=180, ...}) = 0
stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/Theme.qml", {st_mode=S_IFREG|0644, st_size=3109, ...}) = 0
stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml", {st_mode=S_IFREG|0644, st_size=4769, ...}) = 0

stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/Action.qml", 0x7ff443c3fe40) = -1 ENOENT (No such file or directory)
stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/Action.qml", 0x7ff443c3fe40) = -1 ENOENT (No such file or directory)

stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/AbstractApplicationHeader.qml", {st_mode=S_IFREG|0644, st_size=1820, ...}) = 0

stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/AbstractApplicationWindow.qml", 0x7ff443c3fe40) = -1 ENOENT (No such file or directory)
stat("…/build/bin/org/kde/kirigami.2/styles/org.kde.desktop/AbstractApplicationWindow.qml", 0x7ff443c3fe40) = -1 ENOENT (No such file or directory)
.....8<---------------


Please note that I'm packaging kirigami for GNU Guix [1]. GNU Guix builds all
software in an isolated environment (a container), which includes only
the packages and tools specified explicitly.

So if you can not reproduce this bug straigtly, please use strace to
verify that the tests are *not* using some .qml-files installed on
your system.
Comment 1 h.goebel 2019-01-01 22:20:23 UTC
This error no longer occurs in 5.49.0.

(But now: No tests were found!!!)