Bug 386456

Summary: tests fail – kirigamiplugin doesn't register components
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: h.goebel
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED WORKSFORME    
Severity: major    
Priority: NOR    
Version: 5.39.0   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

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!!!)