Detect QML Dependencies

Harald Sitter sitter at kde.org
Thu Mar 30 23:53:43 BST 2023


Heya,

On Fri, Mar 31, 2023 at 12:32 AM Sandro Knauß <bugs at sandroknauss.de> wrote:
>
> Hey,
>
> in Debian we package more and more QML applications and face the problem, that
> we don't have tooling to easily get a list of QML dependencies out of the qml
> files. I normally end up doing a grep in the qml files and than I need to
> translate these dependencies to the corresponding Debian packages. What is
> quite error prune.
> Does anyone have already a working solution to detect the QML dependencies -
> maybe there is alaready a qmllinter/qmlchecker tool that returns the needed
> QML dependencies and create package dependencies?

In neon we have a tool but like all our linters it's very deeply
embedded into our CI tooling unfortunately, a huge sin of the past :|

https://github.com/pangea-project/pangea-tooling/blob/master/nci/lib/lint/qml.rb
https://github.com/pangea-project/pangea-tooling/blob/master/lib/qml_dependency_verifier.rb
https://github.com/pangea-project/pangea-tooling/blob/master/lib/qml/

The way it works is:

- get a list of all binary packages produced by the source
- install the binaries including their dependencies
- search for all *.qml files in the binary packages and parse them
- skip over modules that are either in a per-package skip list or a
global skip list (this is so we can ignore builtin binary modules that
aren't present on disk - e.g. qmlregistered by the application itself)
- look up the parsed modules in the well known search path for modules
(e.g. org.kde.kcoreaddons -> somelibpath/org/kde/kcoreaddons etc.)
- spit out a junit report of missing modules and their versions
- a human then figures out which package to add as dependency because
it wasn't worth automating that bit

HS


More information about the Distributions mailing list