Qt6.7 it breaks compilations on Linux
Describe the bug After updating Qt 6.6 stable libraries to 6.7 beta, VCMI stopped compiling correctly.
Logs
-- Configuring done (0.8s)
DEBUG util.py:446: CMake Error at /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:483 (add_custom_command):
DEBUG util.py:446: Attempt to add a custom rule to output
DEBUG util.py:446: /builddir/build/BUILD/vcmi-1.4.3/build/czech.qm.rule
DEBUG util.py:446: which already has a custom rule.
DEBUG util.py:446: Call Stack (most recent call first):
DEBUG util.py:446: /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:698 (qt6_add_lrelease)
DEBUG util.py:446: /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:678:EVAL:1 (qt6_add_translations)
DEBUG util.py:446: CMakeLists.txt:DEFERRED
DEBUG util.py:446: CMake Error at /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:483 (add_custom_command):
DEBUG util.py:446: Attempt to add a custom rule to output
DEBUG util.py:446: /builddir/build/BUILD/vcmi-1.4.3/build/english.qm.rule
DEBUG util.py:446: which already has a custom rule.
DEBUG util.py:446: Call Stack (most recent call first):
DEBUG util.py:446: /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:698 (qt6_add_lrelease)
DEBUG util.py:446: /usr/lib64/qt6/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:678:EVAL:1 (qt6_add_translations)
DEBUG util.py:446: CMakeLists.txt:DEFERRED
full build log here: https://file-store.openmandriva.org/api/v1/file_stores/d5cdd5331436b553420db6122ab1e9dfc6276868.log?show=true
To Reproduce Steps to reproduce the behavior:
- Upgrade Qt libs to 6.7 beta
- Start compilation VCMI 1.4.X
- See build error
Expected behavior All compile fine on Qt6.7
Actual behavior Before upgrading to Qt6.7, game compiling fine, without single issue with previous Qt6 libs like 6.5 or 6.6. The problem only appeared after updating to 6.7. I have this problem on OpenMandriva Cooker/ROME because my distro already deliver Qt6.7 libs.
I initially contacted about this issue on discord.
Either way, I suspect this issue will start affecting other systems as they migrate to Qt6.7.
Version
- OS: Linux OpenMandriva Cooker/ROME
- Version: 1.4.3
Since it's beta, it may very well be Qt bug, I suggest to:
- check Qt bugs if such already exists
- check if the same works in a sample test project
If you think it's a bug in VCMI, please submit a PR.
does it build with 6.7 release?
I've tested the compilation with qt6 on arch linux. The build runs fine (both cmake and make), but make install fails.
It seems like qt5-tools writes translation files into build/launcher/translation/*.qm files, but qt6-tools write tratnslation files into build/launcher/*.qm files, which causes make install to fail with error:
CMake Error at launcher/cmake_install.cmake:82 (file):
file INSTALL cannot find
"/home/gigas/vcmi/src/vcmi-1.5.0/build/launcher/translation/chinese.qm": No
such file or directory.
Call Stack (most recent call first):
cmake_install.cmake:62 (include)
make: *** [Makefile:120: install] Error 1
With #3817 this won't be an issue any more as translations will be packed inside the binary. We plan to merge it in the end of May (once Qt 5.15.14 is available), so if this issue isn't blocking you, you could just wait a bit.
Great, thanks! Is it planned to be merged as v1.5.x patch or we'll have to wait until v1.6.0 release? I'm maintaining the arch linux vcmi package, and some users have been experiencing this problem for some reason, even though makedepends explicitly state qt5-tools, so the current release becomes unusable for them at that moment. I think I would just migrate everything to qt6 when this merges.
Planned for 1.5.X unless something goes terribly wrong.
Yup with Qt6 I have same error as mentioned above:
"/vcmi/src/vcmi-1.5.0/build/launcher/translation/chinese.qm": No
such file or directory.
Hey, @kambala-decapitator! Sorry if it's still WIP, I tried out building the #3817 with qt6 on linux, and it still fails, though with a bit different reason:
CMake Error at mapeditor/cmake_install.cmake:74 (file):
file INSTALL cannot find
"/home/newuser/repos/vcmi/src/vcmi/build/mapeditor/translation/chinese.qm":
No such file or directory.
Call Stack (most recent call first):
cmake_install.cmake:67 (include)
make: *** [Makefile:120: install] Error 1
==> ERROR: A failure occurred in package().
Note that it now fails on mapeditor/translation instead of launcher. I suppose embedding these as Qt resources for mapeditor would be out of scope of the mentioned PR?
@Gigas002 yes, I didn't touch map editor there. Can be done in a separate PR.