Bug 483400

Summary: Specify which version of extra-cmake-modules provides the required ECMQmlModule
Product: [Applications] KOpeningHours Reporter: kidhanis
Component: generalAssignee: Volker Krause <vkrause>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description kidhanis 2024-03-13 04:07:57 UTC
SUMMARY
I'm running a Docker container built from a Python:3.11-bullseye image, which uses Debian Bullseye packages. I tried to install KOpeningHours, but I got an error saying that ECMQmlModule wasn't found. This module comes from extra-cmake-modules (ECM), and the most recent version of ECM that Bullseye has is 5.78.0-3. Line 14 of CMakeLists.txt [1] in KOpeningHours seems to specify ECM version 5.44 as the minimum version, so I expected version 5.78.0-3 to work. 
However, ECMQmlModule was added in version 5.91.0 [2], so should the requested version of 5.44 be raised to 5.91?


STEPS TO REPRODUCE
1. Install a version earlier than 5.91.0 of extra-cmake-modules. I'll choose 5.78.0, which is the version found in Debian Bullseye. The following line installs ECM from source:
> git clone https://invent.kde.org/frameworks/extra-cmake-modules.git && cd extra-cmake-modules && git checkout v5.78.0 && cmake -S . && make install
2. Install KOpeningHours. In my case the location of the ECM library is in /usr/local/share/, so I added that to CMAKE_PREFIX_PATH. I'll use the most recent commit to KOpeningHours as of this bug report.
> CMAKE_PREFIX_PATH=/usr/local/share/ pip install git+https://invent.kde.org/libraries/kopeninghours.git@bf9fa422da84a9dbb55c0431955672a0bcda1ff4


OBSERVED RESULT
KOpeningHours is not installed. The following error can be seen in the output:

CMake Error at CMakeLists.txt:33 (include):
  include could not find requested file:
    ECMQmlModule


EXPECTED RESULT
KOpeningHours doesn't install, but the error instead mentions that the version of ECM is not compatible. Something like the following, which is shown when trying to install KOpeningHours using version of ECM lower than 5.44, like with 5.43.0:

CMake Error at CMakeLists.txt:14 (find_package):
     Could not find a configuration file for package "ECM" that is compatible
     with requested version "5.44".
     The following configuration files were considered but not accepted:
       /usr/local/share/ECM/cmake/ECMConfig.cmake, version: 5.43.0

An alternative could be an error mentioning which versions of ECM contain ECMQmlModule in order to successfully install KOpeningHours.


[1]: https://invent.kde.org/libraries/kopeninghours/-/blob/bf9fa422da84a9dbb55c0431955672a0bcda1ff4/CMakeLists.txt#L14
[2]: According to https://invent.kde.org/frameworks/extra-cmake-modules/-/commit/3813fd1bc97fa6bb2189cc9586f77be4c30478d6
Comment 1 Volker Krause 2024-03-13 16:35:31 UTC
Git commit 75decfd53b779b7a1800abff42fad9d4d7e33538 by Volker Krause.
Committed on 13/03/2024 at 16:35.
Pushed by vkrause into branch 'master'.

Include ECMQmlModule only when needed

In particular don't include it when building the validator-only Python
module, which has to build with much older ECM versions still.

Fallout from 13550d7c38035d993833344cce83b5f142e203dc.

M  +0    -1    CMakeLists.txt
M  +1    -0    src/qml/CMakeLists.txt

https://invent.kde.org/libraries/kopeninghours/-/commit/75decfd53b779b7a1800abff42fad9d4d7e33538
Comment 2 Volker Krause 2024-03-13 16:43:29 UTC
Git commit 3f3a934fb179601325f0923d4e54c28422687052 by Volker Krause.
Committed on 13/03/2024 at 16:35.
Pushed by vkrause into branch 'release/24.02'.

Include ECMQmlModule only when needed

In particular don't include it when building the validator-only Python
module, which has to build with much older ECM versions still.

Fallout from 13550d7c38035d993833344cce83b5f142e203dc.
(cherry picked from commit 75decfd53b779b7a1800abff42fad9d4d7e33538)

M  +0    -1    CMakeLists.txt
M  +1    -0    src/qml/CMakeLists.txt

https://invent.kde.org/libraries/kopeninghours/-/commit/3f3a934fb179601325f0923d4e54c28422687052