Kubuntu/CI/QMLIgnore

From KDE Community Wiki
< Kubuntu‎ | CI
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Kubuntu CI performs automatic QML dependency testing to make sure that required QML modules are actually pulled in when installing the package.

Sometimes this can yield false positives as QML module lookup without starting the application is more of an art than science and thus isn't entirely accurate. To resolve such false positives explicit qml ignore rules must be defined.

Ignore Rule File

Ignore rules, like lintian overrides, are placed in the debian/ main directory for each package (NB: it even needs the package name if there is only one package).

e.g.: debian/kwin-data.qml-ignore

Ignore Rule Format

The ignore file contains one rule per line, each rule consists of the module identifier and the version.

  • Identifier can be a POSIX regex pattern. e.g. org.kde.kwin.*
  • Version can be undefined in which case it matches all versions. If it is defined it must be entirely equal. Patterns are not allowed for versions!
  • Seperator can be any number of spaces or tabs.
  • Comments as you would expect are all lines starting with a #

Example

$ cat kwin-data.qml-ignore 
# Modules provided by kwin.deb
org.kde.kwin 2.0
org.kde.kwin.decoration 0.1
org.kde.kwin.decorations.*
org.kde.kwin.kwincompositing 1.0

Global Static Module Map

Certain modules are binary only (i.e. they do get injected by an application/library into the QML context at runtime). Those modules can not be looked up, they have no file path in any QML directory, they do not have a plugin file etc. To still map these modules to concrete packages ci-tooling/data/qml-static-map.yml can be used to explicitly declare that a certain binary package provides a certain QML module (and optionally version). This eventually will make way for a more scalable approach whereby packages can declare which modules they provide. Until then the static map should be used to handle this sort of scenario. Best talk to Harald before adding anything though.

Background

The QML dependency verification employs a QML documentation compliant module lookup-by-path algorithm. This means that a module that does not have an actual path will always be reported missing unless overridden or statically mapped (see above). Verification is only run if the source of a package contains .qml files and is only run on .qml files of the binary packages.

For verification all binaries created by a source will be installed in unspecified order, for each qml file they contain the modules will be parsed and looked up. If a module can not be found it will be reported as missing. After a binary package is processed it is being removed and all auto-installed dependencies will be removed as well. Namely if a package does not somehow drag in a used module it is considered missing.