From c6853ff32a123a3fe4956d7667cf53b0138c19c1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 20 Jan 2023 10:52:31 +0100 Subject: [PATCH 1/9] GitHub: Fix ccache archive downloading if there is none Change-Id: I54fcac1a86c6f101469a695aa3610ae755354271 Reviewed-by: Reviewed-by: Cristian Adam --- .github/workflows/build_cmake.yml | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index e430f35ebde..b93e14251d8 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -458,31 +458,33 @@ jobs: string(JSON artifacts_length LENGTH "${artifacts_json}" "artifacts") math(EXPR artifacts_length "${artifacts_length} - 1") - foreach(idx RANGE 0 ${artifacts_length}) - string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx}) - string(JSON name GET "${artifact_js}" "name") - if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}") - string(JSON download_url GET "${artifact_js}" "archive_download_url") + if(${artifacts_length} GREATER_EQUAL 0) + foreach(idx RANGE 0 ${artifacts_length}) + string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx}) + string(JSON name GET "${artifact_js}" "name") + if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}") + string(JSON download_url GET "${artifact_js}" "archive_download_url") - foreach(retry RANGE 10) - file(DOWNLOAD "${download_url}" - "${{ steps.ccache.outputs.archive_name }}.zip" - NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" - NETRC REQUIRED - SHOW_PROGRESS) - file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize) - if (fileSize GREATER 0) - break() - endif() - endforeach() + foreach(retry RANGE 10) + file(DOWNLOAD "${download_url}" + "${{ steps.ccache.outputs.archive_name }}.zip" + NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" + NETRC REQUIRED + SHOW_PROGRESS) + file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip") - file(MAKE_DIRECTORY .ccache) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip") + file(MAKE_DIRECTORY .ccache) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache) - return() - endif() - endforeach() + return() + endif() + endforeach() + endif() endforeach() - name: Build From 78cad1813563d1276ef64d224b6b1bb16504c3e1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 20 Jan 2023 10:16:04 +0100 Subject: [PATCH 2/9] GitHub: Create and upload Debian packages Change-Id: I989ef46e9e99de4291f582d096ad6dc44d7b47ec Reviewed-by: Cristian Adam --- .github/workflows/build_cmake.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index b93e14251d8..a77bd7a5fff 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -580,6 +580,7 @@ jobs: --add-config=-DIDE_REVISION_URL=https://github.com/$ENV{GITHUB_REPOSITORY}/commits/$ENV{GITHUB_SHA} --zip-infix=-${{ matrix.config.artifact }}-${{ github.run_id }} --no-qbs + --with-cpack RESULT_VARIABLE result COMMAND_ECHO STDOUT OUTPUT_VARIABLE output @@ -667,6 +668,13 @@ jobs: path: build/qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z + - name: Upload Debian package + if: runner.os == 'Linux' + uses: actions/upload-artifact@v3 + with: + path: build/build/qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.deb + name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.deb + - name: Upload disk image if: runner.os == 'macOS' && contains(github.ref, 'tags/v') uses: actions/upload-artifact@v3 @@ -763,6 +771,13 @@ jobs: name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ + - name: Download Debian package artifact + if: matrix.config.artifact == 'Linux' + uses: actions/download-artifact@v3 + with: + name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.deb + path: ./ + - name: Download disk image artifact if: matrix.config.artifact == 'macOS' uses: actions/download-artifact@v3 @@ -822,6 +837,17 @@ jobs: asset_name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z asset_content_type: application/x-gtar + - name: Upload Debian package to Release + if: matrix.config.artifact == 'Linux' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload_url }} + asset_path: ./qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.deb + asset_name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.deb + asset_content_type: application/x-gtar + - name: Upload disk image to Release if: matrix.config.artifact == 'macOS' uses: actions/upload-release-asset@v1 From 97323e14f0fc69621bfefa567646e20424969518 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 20 Jan 2023 15:24:43 +0100 Subject: [PATCH 3/9] GitHub/Linux: Fix missing chrpath for deployment Change-Id: If1ea7b04bd6636183c90a2471f6b68998036e923 Reviewed-by: Reviewed-by: Cristian Adam --- .github/workflows/build_cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index a77bd7a5fff..30dae550023 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -123,7 +123,8 @@ jobs: ) execute_process( COMMAND - sudo apt install libgl1-mesa-dev libvulkan-dev libxcb-xinput-dev libxcb-xinerama0-dev libxkbcommon-dev libxkbcommon-x11-dev + sudo apt install chrpath + libgl1-mesa-dev libvulkan-dev libxcb-xinput-dev libxcb-xinerama0-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxcb-randr0 libxcb-icccm4 xvfb RESULT_VARIABLE result From c1656c2f3c2193a902d31048c3a115254bb99528 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 6 Feb 2023 12:52:19 +0100 Subject: [PATCH 4/9] UpdateInfo: Fix never ending progress spinner in settings When searching for updates from the settings page. We need to always send the signal that the search finished. Fixes: QTCREATORBUG-28745 Change-Id: Ia4c764081916fdde4175799ab6d74fb7c4045810 Reviewed-by: Jarek Kobus --- src/plugins/updateinfo/updateinfoplugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index f5d234dcff2..2f1cdb6d379 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -192,6 +192,8 @@ void UpdateInfoPlugin::startCheckForUpdates() void UpdateInfoPlugin::stopCheckForUpdates() { + emit checkForUpdatesRunningChanged(false); + if (!d->m_maintenanceToolProcess) return; @@ -199,7 +201,6 @@ void UpdateInfoPlugin::stopCheckForUpdates() d->m_maintenanceToolProcess.reset(); d->m_updateOutput.clear(); d->m_packagesOutput.clear(); - emit checkForUpdatesRunningChanged(false); } static void showUpdateInfo(const QList &updates, const std::function &startUpdater) From 3358f94cb76a0a566a79085927dfc121eb42f233 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 6 Feb 2023 09:33:08 +0100 Subject: [PATCH 5/9] CMake: Detect cmake from ARM homebrew on macOS Change-Id: I67c539c9e9a42de086df9e0c12fa4e661494e121 Reviewed-by: Christian Stenger Reviewed-by: --- .../cmakeprojectmanager/cmaketoolsettingsaccessor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 362c62c7b1f..045218ce3c9 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -61,8 +61,9 @@ static std::vector> autoDetectCMakeTools() if (HostOsInfo::isMacHost()) { path.append("/Applications/CMake.app/Contents/bin"); - path.append("/usr/local/bin"); - path.append("/opt/local/bin"); + path.append("/usr/local/bin"); // homebrew intel + path.append("/opt/homebrew/bin"); // homebrew arm + path.append("/opt/local/bin"); // macports } const QStringList execs = env.appendExeExtensions(QLatin1String("cmake")); From 5728f09facdaa4c2e358221f3b9ca66f8651c049 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 6 Feb 2023 15:46:56 +0100 Subject: [PATCH 6/9] Editors: Fix message box when opening broken code style file The file name is not supposed to be the button label. Fixes: QTCREATORBUG-28746 Change-Id: I45ee2a860da8f7ffefc6d72c0d85b7f6a261489c Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/plugins/texteditor/codestyleselectorwidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index 4021fc1b05f..ec028f0e88d 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -209,8 +209,9 @@ void CodeStyleSelectorWidget::slotImportClicked() if (importedStyle) m_codeStyle->setCurrentDelegate(importedStyle); else - QMessageBox::warning(this, tr("Import Code Style"), - tr("Cannot import code style from %1"), fileName.toUserOutput()); + QMessageBox::warning(this, + tr("Import Code Style"), + tr("Cannot import code style from %1").arg(fileName.toUserOutput())); } } From 075f39e54303d279f44ca887b51b607d13145849 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 8 Feb 2023 12:27:06 +0100 Subject: [PATCH 7/9] CMake: Fix editing of CMAKE_PREFIX_PATH When editing e.g. CMAKE_PREFIX_PATH in the initial configuration settings it was resolving the path(s) in there, thinking that it was relative to the project directory. Fix that after editing the resolved file path was set as the new value, instead of the raw unexpanded data. Fixes: QTCREATORBUG-28779 Change-Id: I14d097e3a3a51b78006dd30a67b08477cfe0f2d8 Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp index 812b4ff999d..2a23430aabe 100644 --- a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp +++ b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp @@ -95,7 +95,7 @@ void ConfigModelItemDelegate::setModelData(QWidget *editor, QAbstractItemModel * if (data.type == ConfigModel::DataItem::FILE || data.type == ConfigModel::DataItem::DIRECTORY) { auto edit = static_cast(editor); if (edit->rawFilePath().toString() != data.value) - model->setData(index, edit->filePath().toString(), Qt::EditRole); + model->setData(index, edit->rawFilePath().toString(), Qt::EditRole); return; } else if (!data.values.isEmpty()) { auto edit = static_cast(editor); From bad6b2c290d344ec467952e7101142bee2bc3c64 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 7 Feb 2023 08:24:21 +0100 Subject: [PATCH 8/9] SquishTests: Avoid crash in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workaround crash inside a test that may happen if the test tries to wait for an object when the AUT is gone already. Check for a clean exit and only if this is not the case try to continue with the error handling. Change-Id: I65f3e72cd343ec527ad822de915bc0c49c263153 Reviewed-by: Robert Löhning --- tests/system/suite_editors/tst_modify_readonly/test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/system/suite_editors/tst_modify_readonly/test.py b/tests/system/suite_editors/tst_modify_readonly/test.py index 0bb68a8ed3c..d947ade6aa7 100644 --- a/tests/system/suite_editors/tst_modify_readonly/test.py +++ b/tests/system/suite_editors/tst_modify_readonly/test.py @@ -85,6 +85,13 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles): except: test.fatal("Missing dialog regarding missing permission on read only files.") exitCanceled = False + + # workaround crashing test + # (AUT stopped responding / AUT '' did not respond to network communication) + __shutdownDone__ = lambda : not currentApplicationContext().isRunning + if test.verify(waitFor(__shutdownDone__, 1000), "Clean exit of Qt Creator."): + return + try: mBoxStr = "{type='QMessageBox' unnamed='1' visible='1' text?='*Could not save the files.'}" msgBox = waitForObject(mBoxStr, 3000) From ff65caf62faa1e5c9411c26ccacbf21263fa3393 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 9 Feb 2023 12:57:55 +0100 Subject: [PATCH 9/9] SquishTests: Explicitly convert QString to str MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idcd70a18ed5535d8ad76c09007558cb96f20d178 Reviewed-by: Robert Löhning --- tests/system/shared/build_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 05afc9c493f..e1525276d29 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -56,7 +56,7 @@ def waitForCompile(timeout=60000): def dumpBuildIssues(listModel): issueDump = [] for index in dumpIndices(listModel): - issueDump.extend([[index.data(role).toString() for role + issueDump.extend([[str(index.data(role).toString()) for role in range(Qt.UserRole, Qt.UserRole + 6)]]) return issueDump