It is not possible to have CI for both Qt5 and Qt6
I tried to enable CI jobs for both Qt5 and Qt6 for Kid3, but this does not seem to be possible.
The main problem seems to be that both jobs for Qt5 using the linux.yml template and for Qt6 using the linux-qt6.yml will build in the same folder, and in that folder neither the configuration (CMakeCache.txt) nor the build are cleaned. Building with Qt6 after Qt5 fails because QUERY_EXECUTABLE
is cached to the path of the Qt5 qmake. Building with Qt5 after Qt6 fails because BUILD_WITH_QT6
is cached to ON. This could be solved by adding --fresh
to the cmake-options
in .kde-ci.yml. However, then the build will fail, e.g. with Qt5 when using moc
headers generated in a preceeding Qt6 build. This could be solved by using cmake --build _build --clean-first -- -j
as the build command, but it is hard coded to make -j 8
, so the build folder has to be cleaned manually. So I came up with the following code in .gitlab-ci.yml (the same also for suse_tumbleweed_qt515
).
suse_tumbleweed_qt64:
before_script:
- git clone https://invent.kde.org/sysadmin/ci-utilities
- git clone https://invent.kde.org/sysadmin/repo-metadata ci-utilities/repo-metadata/
- rm -rf _build
This is not nice because it will break if the before_script
statements in the parent template change or the name of the build folder is changed. And the problem is still not solved because when including both templates (Qt5 and Qt6) in the same .gitlab-ci.yml file, both builds will probably run concurrently and one of them will fail, probably because they are running in the same folder.
This could be solved by using different build folders for Linux/Qt5
and Linux/Qt6
(and obviously for other architectures than Linux too). Additionally, it could be helpful to have .kde-ci.yml options like clean-configuration
and clean-build
which would allow to run a clean build which would take only slightly longer than without cleaning when ccache
is used.