GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — CMake modern create translations (trac #14169) by gruenich · Pull Request #8062 · cppcheck-opensource/cppcheck Conversation
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
To avoid the clang-tidy warnings we need to disable all checks. See at the top of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for you explanation. I don't get which folder needs the additional clang-tidy configuration file. My change does not add generated files in a new directory, does it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
75e533e to
d940500
Compare
|
I see no reason to hold this back. Please consider merging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d940500 to
5bafd3b
Compare
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5bafd3b to
5d409dd
Compare
5d409dd to
201e611
Compare
|
I don't know much about cmake and asked AI to review this. In my experience AI reviews are often mostly wrong - take this AI-review below with a mountain of salt: The deprecation claim checks out. Qt's own docs for qt_create_translation state it's deprecated in favor of the target-based qt6_add_lupdate/qt6_add_translations (Qt docs But the patch drops something it doesn't replace. The old code did: This isn't cosmetic: gui/translationhandler.cpp loads translations from disk at runtime (QFile::exists(datadir/lang/...), mTranslator->load(...)), not from a Qt resource. There's also direct corroborating evidence in the repo: .github/workflows/release-windows.yml does Minor secondary note: the PR deletes the comment # TODO: passing "-no-obsolete" here breaks the translations and then passes LUPDATE_OPTIONS "-no-obsolete" anyway. That's probably fine in Verdict: moving off QT_CREATE_TRANSLATION is the right direction, but this PR isn't a correct/complete fix — it needs to wire qms/QM_FILES_OUTPUT_VARIABLE back into the install() call and |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
201e611 to
5d0e4c5
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
AI review
I found no new problems. The change only touches gui/CMakeLists.txt. Qt 6 isn't installed in the container, so I couldn't configure or build the GUI and checked the change by reading it.
QM_FILES_OUTPUT_VARIABLE qms to qt_add_translations. That sets qms, so install(FILES ${qms} ...) still gets the loose .qm files, and the files are not embedded as a resource.qt_add_lrelease writes the .qm files to CMAKE_CURRENT_BINARY_DIR by default, which is build/gui, the same folder as before. That is the folder release-windows.yml moves them from.cppcheck-gui depend on its _lrelease target, so cmake --build build --target cppcheck-gui in the release workflow should still generate the files. Only a real Qt build can confirm this.The point C6 made about the deleted -no-obsolete TODO is still open.
| # | Comment | By | Where | Status |
|---|---|---|---|---|
| 1 | Generated files may trigger clang-tidy warnings; all checks need to be disabled as at the top of gui/CMakeLists.txt | @firewave | general | 💬 Answered: Author says the change adds no generated files in a new directory and asked for clarification; no reply |
| 2 | qms is no longer set, so install(FILES ${qms}) installs nothing and .qm files are embedded instead of loose | @danmar | general | ✅ Fixed |
| 3 | TODO saying -no-obsolete breaks translations was deleted, yet LUPDATE_OPTIONS "-no-obsolete" is now passed | @danmar | general |
@gruenich, please fix, resolve or reply to the open comments: #3.
cmake ../../pr without the GUI (in /work/scratch/b): configures fine. The changed code is inside if (BUILD_GUI), so this only shows that the rest of the configure still works.cmake -DBUILD_GUI=ON ../../pr: fails at find_package(Qt6 ...) because Qt 6 is not installed in the container. So I could not configure or build the GUI, check whether the .qm files are generated and installed, or run the update_translations target.cppcheck/testrunner. The PR changes no C++ code or tests, so building them would not test anything that changed.qms is now set through QM_FILES_OUTPUT_VARIABLE and is still used by install(FILES ${qms} ...).LinguistTools is already among the Qt components in cmake/findDependencies.cmake.gui/translationhandler.cpp loads loose .qm files from disk at runtime, which matches files that are not embedded.release-windows.yml builds --target cppcheck-gui and moves build\gui\*.qm.Automated review of 5d0e4c5 by Claude. The pull request was built and tested locally.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
AI review (second opinion on the earlier AI review in #8062 (comment)) I built 5d0e4c5 with The earlier review, point by point
Problem: the release-windows build gets no .qm files
Tested with Qt 6.10.2, after deleting
This could be the same problem that made #8047 be reverted. Adding this after the add_dependencies(cppcheck-gui release_translations) I only tested this with Qt 6.10, so CI should confirm that it works with the oldest Qt too. Other notes
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for the review!
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5d0e4c5 to
a08ae27
Compare
Use modern qt_add_translations instead.
a08ae27 to
da4d516
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
AI review
I found no new problems. Only gui/CMakeLists.txt and gui/readme.txt change.
qms is set again through QM_FILES_OUTPUT_VARIABLE.-no-obsolete is gone, so lupdate keeps the obsolete entries as before.cppcheck-gui now depends on release_translations, so --target cppcheck-gui in release-windows.yml also builds the .qm files.SOURCE_TARGETS cppcheck-gui, update_translations scans every target in the project. The readme now tells people to use lupdate gui.pro instead, so this only matters if someone runs that target.| # | Comment | By | Where | Status |
|---|---|---|---|---|
| 1 | Generated files may trigger clang-tidy warnings; disable all checks as at the top of gui/CMakeLists.txt | @firewave | general | 💬 Answered: Author says the change adds no generated files in a new directory |
| 2 | qms no longer set, so install(FILES ${qms}) installs no .qm files / they get embedded | @danmar | general | ✅ Fixed |
| 3 | TODO about -no-obsolete deleted while LUPDATE_OPTIONS -no-obsolete is passed | @danmar | general | ✅ Fixed |
| 4 | release-windows builds only cppcheck-gui, which does not depend on the lrelease target, so no .qm files | AI review | general | ✅ Fixed |
| 5 | Mention trac #14169 in the title | AI review | general | ✅ Fixed |
| 6 | Without SOURCE_TARGETS cppcheck-gui, update_translations scans all targets and rewrites .ui locations | AI review | general |
@gruenich, please fix, resolve or reply to the open comments: #6.
.qm files are generated or installed, or that release_translations exists with the oldest supported Qt (6.2).cppcheck/testrunner because the PR changes no C++ code or tests.qms is set by QM_FILES_OUTPUT_VARIABLE and is still used by install(FILES ${qms} ...).*.ts glob gives the same 14 files as TRANSLATIONS in gui/gui.pro, which the new readme says to run lupdate on.LinguistTools is already a required Qt component in cmake/findDependencies.cmake.release-windows.yml builds only cppcheck-gui and moves build\gui\*.qm, which works with the new add_dependencies line.Automated review of da4d516 by Claude. The pull request was built and tested locally.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
okay I am not against removing it. I don't feel like an expert on this and you do it on purpose... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It seems to me this is finished now, I merge it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.