From 73ba7e8f98b572d40d43d3f26bc10f575ba0055c Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 14 Nov 2022 14:33:26 +0100 Subject: [PATCH 01/13] GitHub Actions: Remove deprecation warnings This removes the warnings that the jobs display due to upgrades that will be done for the internal GitHub Actions services. Change-Id: I4865c7e61f3da04a00f14657a87ecdd63c24325c Reviewed-by: Reviewed-by: Eike Ziller --- .github/workflows/build_cmake.yml | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index a99d71736fa..026d34ab3e4 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -51,7 +51,7 @@ jobs: } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Checkout submodules run: | git submodule set-url -- perfparser https://code.qt.io/qt-creator/perfparser.git @@ -211,7 +211,7 @@ jobs: # Save the path for other steps file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir) - message("::set-output name=qt_dir::${qt_dir}") + file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}") function(downloadAndExtract url archive) foreach(qt_mirror $ENV{QT_MIRRORS}) @@ -378,7 +378,7 @@ jobs: # Save the path for other steps file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/libclang" libclang_dir) - message("::set-output name=libclang_dir::${libclang_dir}") + file(APPEND "$ENV{GITHUB_OUTPUT}" "libclang_dir=${libclang_dir}") - name: Download elfutils if: runner.os == 'Windows' && matrix.config.is_msvc || runner.os == 'Linux' @@ -414,7 +414,7 @@ jobs: # Save the path for other steps file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/elfutils" elfutils_dir) - message("::set-output name=elfutils_dir::${elfutils_dir}") + file(APPEND "$ENV{GITHUB_OUTPUT}" "elfutils_dir=${elfutils_dir}") - name: Download ccache shell: cmake -P {0} @@ -437,7 +437,7 @@ jobs: include(${github_workspace}/cmake/QtCreatorIDEBranding.cmake) string(REPLACE "." ";" IDE_VERSION_LIST ${IDE_VERSION_DISPLAY}) list(GET IDE_VERSION_LIST 0 IDE_VERSION_MAJOR) - message("::set-output name=archive_name::ccache-${{ matrix.config.os }}-${{ matrix.config.cc }}-qtc${IDE_VERSION_MAJOR}") + file(APPEND "$ENV{GITHUB_OUTPUT}" "archive_name=ccache-${{ matrix.config.os }}-${{ matrix.config.cc }}-qtc${IDE_VERSION_MAJOR}") - name: Download ccache archive shell: cmake -P {0} @@ -639,34 +639,34 @@ jobs: endif() - name: Upload - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: build/qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z - name: Upload Devel - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: build/qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z - name: Upload wininterrupt if: runner.os == 'Windows' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: build/wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z - name: Upload qtcreatorcdbext if: runner.os == 'Windows' && matrix.config.is_msvc - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: build/qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z - name: Upload disk image if: runner.os == 'macOS' && contains(github.ref, 'tags/v') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: build/qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg @@ -676,7 +676,7 @@ jobs: run: cmake -E tar cf ../${{ steps.ccache.outputs.archive_name }}.tar . - name: Upload ccache archive - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ./${{ steps.ccache.outputs.archive_name }}.tar name: ${{ steps.ccache.outputs.archive_name }} @@ -689,7 +689,7 @@ jobs: steps: - name: Create Release id: create_release - uses: actions/create-release@v1.0.0 + uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -702,7 +702,7 @@ jobs: run: | echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: path: ./upload_url name: upload_url @@ -735,50 +735,50 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ - name: Download Devel artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z path: ./ - name: Download wininterrupt artifact if: contains(matrix.config.artifact, 'Windows') - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ - name: Download qtcreatorcdbext artifact if: matrix.config.artifact == 'Windows-MSVC' - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ - name: Download disk image artifact if: matrix.config.artifact == 'macOS' - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg path: ./ - name: Download URL - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: upload_url path: ./ - id: set_upload_url run: | upload_url=`cat ./upload_url` - echo ::set-output name=upload_url::$upload_url + echo upload_url=$upload_url >> $GITHUB_OUTPUT - name: Upload to Release - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -788,7 +788,7 @@ jobs: asset_content_type: application/x-gtar - name: Upload Devel to Release - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -799,7 +799,7 @@ jobs: - name: Upload wininterrupt to Release if: contains(matrix.config.artifact, 'Windows') - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -810,7 +810,7 @@ jobs: - name: Upload qtcreatorcdbext to Release if: matrix.config.artifact == 'Windows-MSVC' - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -821,7 +821,7 @@ jobs: - name: Upload disk image to Release if: matrix.config.artifact == 'macOS' - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 80885d12e0ffce25278167424effd84e1801b7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 10 Nov 2022 16:54:22 +0100 Subject: [PATCH 02/13] SquishTests: Update tst_installed_languages Change-Id: Ic06b6241df913ebcfe685936f3c509875a2897bc Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/coreplugin/generalsettings.cpp | 1 + tests/system/objects.map | 4 +--- .../tst_installed_languages/testdata/languages.tsv | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 9f4e47bba78..2e9d3fa884e 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -77,6 +77,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q) , m_themeChooser(new ThemeChooser) , m_resetWarningsButton(new QPushButton) { + m_languageBox->setObjectName("languageBox"); m_languageBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); m_languageBox->setMinimumContentsLength(20); diff --git a/tests/system/objects.map b/tests/system/objects.map index a6f3b23cdef..074275eba8c 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -41,7 +41,6 @@ :Cannot Open Project_QTextEdit {type='QTextEdit' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'} :Close Debugging Session.Yes_QPushButton {text='Yes' type='QPushButton' unnamed='1' visible='1' window=':Close Debugging Session_Utils::CheckableMessageBox'} :Close Debugging Session_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Close Debugging Session'} -:Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'} :CppCompiler:_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':CppCompiler:_QLabel' type='QComboBox' unnamed='1' visible='1'} :CppCompiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='C++:' type='QLabel' unnamed='1' visible='1'} :CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget_QScrollArea' name='Behavior' type='QGroupBox' visible='1'} @@ -194,7 +193,7 @@ :Send to Codepaster_CodePaster::PasteView {name='CodePaster.ViewDialog' type='QDialog' visible='1' windowTitle='Send to Codepaster'} :Session Manager_ProjectExplorer::Internal::SessionDialog {name='ProjectExplorer.SessionDialog' type='ProjectExplorer::Internal::SessionDialog' visible='1' windowTitle='Session Manager'} :Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'} -:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'} +:User Interface.languageBox_QComboBox {name='languageBox' type='QComboBox' visible='1'} :Utils::FakeToolTip {type='Utils::FakeToolTip' unnamed='1' visible='1'} :Widget Box_qdesigner_internal::WidgetBoxTreeWidget {container=':*Qt Creator.Widget Box_QDockWidget' type='qdesigner_internal::WidgetBoxTreeWidget' unnamed='1' visible='1'} :Working Copy_Utils::BaseValidatingLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':New_ProjectExplorer::JsonWizard'} @@ -208,7 +207,6 @@ :projectComboBox_QComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'} :projectComboBox_Utils::TreeViewComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='Utils::TreeViewComboBox' visible='1'} :qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'} -:qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'} :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget_QScrollArea {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QWidget' unnamed='1' visible='1'} diff --git a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv index fb8aa0c011c..78eeee245d9 100644 --- a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv +++ b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv @@ -1,5 +1,5 @@ "language" "Exit" "ISO" -"Czech (Czech Republic)" "Ukončit" "cs_CZ" +"Czech (Czechia)" "Ukončit" "cs_CZ" "Danish (Denmark)" "Afslut" "da_DK" "German (Germany)" "Beenden" "de_DE" "French (France)" "Quitter" "fr_FR" From 4b126550c11b0f8b448e2787404f908044e967af Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 9 Nov 2022 10:58:44 +0100 Subject: [PATCH 03/13] Editor: completely repaint annotations on changed bounding rects If the rectangle of an annotation changes we need to completely redraw the annotation since the content might have shifted and the eliding character is now at a different position. Fixes: QTCREATORBUG-28411 Change-Id: I41b0f38a73b287e6a5d5318ba797aac6e2ff71b0 Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditor.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 6982ccbeb83..56627add292 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -687,6 +687,8 @@ public: { QRectF rect; const TextMark *mark; + friend bool operator==(const AnnotationRect &a, const AnnotationRect &b) + { return a.mark == b.mark && a.rect == b.rect; } }; QMap> m_annotationRects; QRectF getLastLineLineRect(const QTextBlock &block); @@ -4020,7 +4022,7 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data, const PaintEventBlockData &blockData, QPainter &painter) { - m_annotationRects.remove(data.block.blockNumber()); + const QList previousRects = m_annotationRects.take(data.block.blockNumber()); if (!m_displaySettings.m_displayAnnotations) return; @@ -4080,6 +4082,7 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data, } } + QList newRects; for (const TextMark *mark : std::as_const(marks)) { boundingRect = QRectF(x, boundingRect.top(), q->viewport()->width() - x, boundingRect.height()); if (boundingRect.isEmpty()) @@ -4094,8 +4097,16 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data, x = boundingRect.right(); offset = itemOffset / 2; - m_annotationRects[data.block.blockNumber()].append({boundingRect, mark}); + newRects.append({boundingRect, mark}); } + + if (previousRects != newRects) { + for (const AnnotationRect &annotationRect : qAsConst(newRects)) + q->viewport()->update(annotationRect.rect.toAlignedRect()); + for (const AnnotationRect &annotationRect : previousRects) + q->viewport()->update(annotationRect.rect.toAlignedRect()); + } + m_annotationRects[data.block.blockNumber()] = newRects; } QColor blendRightMarginColor(const FontSettings &settings, bool areaColor) From b36cc91acb8ab23d533cf3c52c83fe0f4c55b44a Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 14 Nov 2022 17:01:49 +0100 Subject: [PATCH 04/13] Qt Creator Plugin Wizard: Update GitHub Actions yml file config - move to only Qt6 builds since Qt Creator 9 only supports Qt6 - update the CMake Version - update actions package versions not to get deprecated warnings from GitHub Change-Id: Ief6c526ade69b4b120f614081bebfff5809101eb Reviewed-by: Reviewed-by: Eike Ziller --- .../github_workflows_build_cmake.yml | 82 ++++++++----------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml index 53c6152ee8b..d69cbfae59a 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml @@ -7,7 +7,7 @@ env: QT_VERSION: %{JS: Util.qtVersion()} QT_CREATOR_VERSION: %{JS: Util.qtCreatorVersion()} QT_CREATOR_SNAPSHOT: NO - CMAKE_VERSION: 3.18.3 + CMAKE_VERSION: 3.21.1 NINJA_VERSION: 1.10.1 jobs: @@ -21,7 +21,7 @@ jobs: name: "Windows Latest MSVC", artifact: "Windows-x64", os: windows-latest, cc: "cl", cxx: "cl", - environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat", + environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", } - { name: "Ubuntu Latest GCC", artifact: "Linux-x64", @@ -35,7 +35,7 @@ jobs: } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Download Ninja and CMake shell: cmake -P {0} @@ -45,16 +45,16 @@ jobs: if ("${{ runner.os }}" STREQUAL "Windows") set(ninja_suffix "win.zip") - set(cmake_suffix "win64-x64.zip") - set(cmake_dir "cmake-${cmake_version}-win64-x64/bin") + set(cmake_suffix "windows-x86_64.zip") + set(cmake_dir "cmake-${cmake_version}-windows-x86_64/bin") elseif ("${{ runner.os }}" STREQUAL "Linux") set(ninja_suffix "linux.zip") - set(cmake_suffix "Linux-x86_64.tar.gz") - set(cmake_dir "cmake-${cmake_version}-Linux-x86_64/bin") + set(cmake_suffix "linux-x86_64.tar.gz") + set(cmake_dir "cmake-${cmake_version}-linux-x86_64/bin") elseif ("${{ runner.os }}" STREQUAL "macOS") set(ninja_suffix "mac.zip") - set(cmake_suffix "Darwin-x86_64.tar.gz") - set(cmake_dir "cmake-${cmake_version}-Darwin-x86_64/CMake.app/Contents/bin") + set(cmake_suffix "macos-universal.tar.gz") + set(cmake_dir "cmake-${cmake_version}-macos-universal/CMake.app/Contents/bin") endif() set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}") @@ -102,74 +102,62 @@ jobs: run: | set(qt_version "$ENV{QT_VERSION}") - string(REGEX MATCH "^[0-9]+" qt_version_major "${qt_version}") string(REPLACE "." "" qt_version_dotless "${qt_version}") if ("${{ runner.os }}" STREQUAL "Windows") set(url_os "windows_x86") set(qt_package_arch_suffix "win64_msvc2019_64") set(qt_dir_prefix "${qt_version}/msvc2019_64") - set(qt_package_suffix "-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64") + set(qt_package_suffix "-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64") elseif ("${{ runner.os }}" STREQUAL "Linux") set(url_os "linux_x64") set(qt_package_arch_suffix "gcc_64") set(qt_dir_prefix "${qt_version}/gcc_64") - if("${qt_version_major}" STREQUAL "5") - set(qt_package_suffix "-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64") - else() - set(qt_package_suffix "-Linux-RHEL_8_2-GCC-Linux-RHEL_8_2-X86_64") - endif() + set(qt_package_suffix "-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64") elseif ("${{ runner.os }}" STREQUAL "macOS") set(url_os "mac_x64") set(qt_package_arch_suffix "clang_64") - if("${qt_version_major}" STREQUAL "5") - set(qt_dir_prefix "${qt_version}/clang_64") - set(qt_package_suffix "-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64") - else() - set(qt_dir_prefix "${qt_version}/macos") - set(qt_package_suffix "-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64-ARM64") - endif() + set(qt_dir_prefix "${qt_version}/macos") + set(qt_package_suffix "-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64") endif() - set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt${qt_version_major}_${qt_version_dotless}") + set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}") file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) file(READ ./Updates.xml updates_xml) - string(REGEX MATCH "qt.qt${qt_version_major}.*([0-9+-.]+)" updates_xml_output "${updates_xml}") + string(REGEX MATCH "qt.qt6.*([0-9+-.]+)" updates_xml_output "${updates_xml}") set(qt_package_version ${CMAKE_MATCH_1}) - file(MAKE_DIRECTORY qt) + file(MAKE_DIRECTORY qt6) # Save the path for other steps - file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt/${qt_dir_prefix}" qt_dir) - message("::set-output name=qt_dir::${qt_dir}") + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir) + file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}") message("Downloading Qt to ${qt_dir}") function(downloadAndExtract url archive) message("Downloading ${url}") file(DOWNLOAD "${url}" ./${archive} SHOW_PROGRESS) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt6) endfunction() foreach(package qtbase qtdeclarative) downloadAndExtract( - "${qt_base_url}/qt.qt${qt_version_major}.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" + "${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" ${package}.7z ) endforeach() - if("${qt_version_major}" STREQUAL "6") - foreach(package qt5compat qtshadertools) - downloadAndExtract( - "${qt_base_url}/qt.qt6.${qt_version_dotless}.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" - ${package}.7z - ) - endforeach() - endif() + foreach(package qt5compat qtshadertools) + downloadAndExtract( + "${qt_base_url}/qt.qt6.${qt_version_dotless}.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" + ${package}.7z + ) + endforeach() # uic depends on libicu56.so if ("${{ runner.os }}" STREQUAL "Linux") downloadAndExtract( - "${qt_base_url}/qt.qt${qt_version_major}.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}icu-linux-Rhel7.2-x64.7z" + "${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}icu-linux-Rhel7.2-x64.7z" icu.7z ) endif() @@ -196,7 +184,7 @@ jobs: file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qtcreator" qtc_dir) # Save the path for other steps - message("::set-output name=qtc_dir::${qtc_dir}") + file(APPEND "$ENV{GITHUB_OUTPUT}" "qtc_dir=${qtc_dir}") file(MAKE_DIRECTORY qtcreator) @@ -258,7 +246,7 @@ jobs: message(FATAL_ERROR "Build failed") endif() - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 id: upload_artifact with: path: ./${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }}.7z @@ -272,7 +260,7 @@ jobs: steps: - name: Create Release id: create_release - uses: actions/create-release@v1.0.0 + uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -285,7 +273,7 @@ jobs: run: | echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v3 with: path: ./upload_url name: upload_url @@ -314,24 +302,24 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} path: ./ - name: Download URL - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: upload_url path: ./ - id: set_upload_url run: | upload_url=`cat ./upload_url` - echo ::set-output name=upload_url::$upload_url + echo upload_url=$upload_url >> $GITHUB_OUTPUT - name: Upload to Release id: upload_to_release - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From facb2bdb4ddd6d4a6403d1a95c2365fe5d336833 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 14 Nov 2022 14:57:44 +0100 Subject: [PATCH 05/13] COIN: Adapt to changes in install_qt.py Change-Id: Ie6acef0baafc5950fd025cc0fe9c3da9bb82a8d6 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Antti Kokko --- coin/instructions/build.yaml | 3 +++ coin/instructions/provision.yaml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/coin/instructions/build.yaml b/coin/instructions/build.yaml index de935a697c9..5288f8f4430 100644 --- a/coin/instructions/build.yaml +++ b/coin/instructions/build.yaml @@ -1,5 +1,8 @@ type: Group instructions: + - type: MakeDirectory + directory: "{{.AgentWorkingDir}}/build/qt_temp" + - type: Group instructions: - type: ExecuteCommand diff --git a/coin/instructions/provision.yaml b/coin/instructions/provision.yaml index 302103ec3f6..6e2b39b0336 100644 --- a/coin/instructions/provision.yaml +++ b/coin/instructions/provision.yaml @@ -41,7 +41,7 @@ instructions: property: host.os in_values: [MacOS, Linux] - type: ExecuteCommand - command: "python3 -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}" + command: "python3 -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 3600 maxTimeBetweenOutput: 360 @@ -51,7 +51,7 @@ instructions: property: host.os equals_value: Linux - type: ExecuteCommand - command: "python3 -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} {{.Env.QTC_QT_MODULES}}" + command: "python3 -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} {{.Env.QTC_QT_MODULES}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 3600 maxTimeBetweenOutput: 360 @@ -70,7 +70,7 @@ instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --opengl32sw7z http://master.qt.io/development_releases/prebuilt/llvmpipe/windows/opengl32sw-64.7z --d3dcompiler7z http://master.qt.io/development_releases/prebuilt/d3dcompiler/msvc2013/d3dcompiler_47-x64.7z --openssl7z http://ci-files02-hki.intra.qt.io/packages/jenkins/openssl/openssl_1.1.1d_prebuild_x64.7z {{.Env.QTC_QT_MODULES}}" + command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --opengl32sw7z http://master.qt.io/development_releases/prebuilt/llvmpipe/windows/opengl32sw-64.7z --d3dcompiler7z http://master.qt.io/development_releases/prebuilt/d3dcompiler/msvc2013/d3dcompiler_47-x64.7z --openssl7z http://ci-files02-hki.intra.qt.io/packages/jenkins/openssl/openssl_1.1.1d_prebuild_x64.7z {{.Env.QTC_QT_MODULES}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 3600 maxTimeBetweenOutput: 360 From b85183d966027bb724c36f3ded54e07058d55019 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 3 Nov 2022 15:46:41 +0100 Subject: [PATCH 06/13] SquishTests: Improve tst_memberoperator - Update expected behavior - Update to ClangCodeModel replacing "." with "->" only after selecting a completion - Update to ClangCodeModel no longer announcing needed substitution in proposal widget - Added test for unchanged lines - Stabilize by using proper wait conditions - Fix surplus warning Change-Id: Ia90e0102d44fbd8abb41acaa83509657ad11bf4d Reviewed-by: Reviewed-by: Christian Stenger --- .../suite_editors/tst_memberoperator/test.py | 46 ++++++++++++------- .../tst_memberoperator/testdata/usages.tsv | 4 +- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/tests/system/suite_editors/tst_memberoperator/test.py b/tests/system/suite_editors/tst_memberoperator/test.py index 14419e1fa46..18d5547f324 100644 --- a/tests/system/suite_editors/tst_memberoperator/test.py +++ b/tests/system/suite_editors/tst_memberoperator/test.py @@ -16,7 +16,22 @@ def __getGenericProposalListView__(timeout): def __verifyLineUnderCursor__(cppwindow, record): found = str(lineUnderCursor(cppwindow)).strip() exp = testData.field(record, "expected") - test.compare(found, exp) + test.verify(found.startswith(exp), + "Completed line '%s' should start with '%s'" % (found, exp)) + + +def __noBuildIssues__(): + return len(getBuildIssues()) == 0 + + +def __syntaxErrorDetected__(): + buildIssues = getBuildIssues() + for issue in buildIssues: + if issue[3] in ["Expected ';' after expression (fix available)", + "Expected ';' at end of declaration (fix available)", + "Use of undeclared identifier 'syntaxError'"]: + return True + return False def main(): @@ -38,7 +53,13 @@ def main(): placeCursorToLine(cppwindow, "return a.exec();") typeLines(cppwindow, ("", testData.field(record, "declaration"))) type(cppwindow, testData.field(record, "usage")) - snooze(1) # maybe find something better + if useClang: + if not waitFor(__syntaxErrorDetected__, 5000): + test.warning("Waiting for code model to find a syntax error timed out", + "If the code model's messages didn't change, " + "consider raising the timeout.") + else: + snooze(1) type(cppwindow, testData.field(record, "operator")) genericProposalWidget = __getGenericProposalListView__(1500) # the clang code model does not change the . to -> before applying a proposal @@ -49,22 +70,11 @@ def main(): 'Verifying whether proposal widget is displayed as expected.') if genericProposalWidget is not None: - model = genericProposalWidget.model() - proposalToolTips = dumpItems(model, role=WhatsThisRole) - needCorrection = filter(lambda x: 'Requires changing "." to "->"' in x, - proposalToolTips) correction = testData.field(record, "correction") - if correction == 'all': + if correction in ['all', 'none']: + type(genericProposalWidget, "") __verifyLineUnderCursor__(cppwindow, record) - test.compare(len(needCorrection), 0, - "Verifying whether operator has been already corrected.") - elif correction == 'mixed': - test.verify(len(proposalToolTips) > len(needCorrection) > 0, - "Verifying whether some of the proposals need correction.") - elif correction == 'none': - test.verify(len(needCorrection) == 0, - "Verifying whether no proposal needs a correction.") - else: + elif correction != 'mixed' and expectProposal: test.warning("Used tsv file seems to be broken - found '%s' in " "correction column." % correction) elif not expectProposal: @@ -73,5 +83,9 @@ def main(): __verifyLineUnderCursor__(cppwindow, record) invokeMenuItem("File", 'Revert "main.cpp" to Saved') clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) + if useClang and not waitFor(__noBuildIssues__, 5000): + test.warning("Waiting for code model timed out", + "If there is no new issue detected in the code, " + "consider raising the timeout.") invokeMenuItem("File", "Exit") waitForCleanShutdown() diff --git a/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv b/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv index 89831a431bb..482903ad1bb 100644 --- a/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv +++ b/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv @@ -9,13 +9,13 @@ "" "QCoreApplication &ref = a;" "ref" "." "ref." "True" "none" "" "QPointer p;" "p" "." "p." "True" "mixed" "" "QPointer *poi;" "poi" "." "poi->" "True" "all" -"" "QPointer &poi;" "poi" "." "poi." "False" "" +"" "QPointer &poi;" "poi" "." "poi." "True" "mixed" "" "QPointer pa; QPointer &poi = pa;" "poi" "." "poi." "True" "mixed" "" "QPointer poi[5];" "poi[2]" "." "poi[2]." "True" "mixed" "" "QPointer *poi[5];" "poi[2]" "." "poi[2]->" "True" "all" "" "std::auto_ptr sap;" "sap" "." "sap." "True" "mixed" "" "std::auto_ptr *sap;" "sap" "." "sap->" "True" "all" -"" "std::auto_ptr &sap;" "sap" "." "sap." "False" "" +"" "std::auto_ptr &sap;" "sap" "." "sap." "True" "mixed" "" "std::auto_ptr sapqa; std::auto_ptr &sap = sapqa;" "sap" "." "sap." "True" "mixed" "" "std::auto_ptr sap[10];" "sap[2]" "." "sap[2]." "True" "mixed" "" "std::auto_ptr *sap[10];" "sap[2]" "." "sap[2]->" "True" "all" From adac83367ce0a563954ee831487b16c2157aadf9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 14 Nov 2022 15:23:01 +0100 Subject: [PATCH 07/13] LinuxDevice: Fix stopping remote app when run in terminal Before, the SshProcessInterface was trying to run kill command (on remote host) for the running processId. However, in case of terminal process the returned processId is an id of ssh running through creator process stub, not the id of remote process. The fix is to redirect a call to sendControlSignal into the internal terminal process. Change-Id: I57509fd61a54c335ab0a34f8ca0dffb3d75da696 Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/plugins/boot2qt/qdbdevice.cpp | 4 ++-- src/plugins/qnx/qnxdevice.cpp | 4 ++-- src/plugins/remotelinux/linuxdevice.cpp | 16 +++++++++++++++- src/plugins/remotelinux/linuxprocessinterface.h | 2 +- src/plugins/remotelinux/sshprocessinterface.h | 3 ++- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 603536c2b54..8883522a108 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -5,7 +5,6 @@ #include "qdbutils.h" #include "qdbconstants.h" -#include "qdbdevicedebugsupport.h" #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include @@ -39,7 +39,7 @@ public: ~QdbProcessImpl() { killIfRunning(); } private: - void sendControlSignal(ControlSignal controlSignal) final + void handleSendControlSignal(ControlSignal controlSignal) final { QTC_ASSERT(controlSignal != ControlSignal::Interrupt, return); QTC_ASSERT(controlSignal != ControlSignal::KickOff, return); diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 3af2301594a..ed5e43a3d03 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -33,7 +33,7 @@ public: private: QString fullCommandLine(const CommandLine &commandLine) const final; - void sendControlSignal(Utils::ControlSignal controlSignal) final; + void handleSendControlSignal(Utils::ControlSignal controlSignal) final; const QString m_pidFile; }; @@ -71,7 +71,7 @@ QString QnxProcessImpl::fullCommandLine(const CommandLine &commandLine) const return fullCommandLine; } -void QnxProcessImpl::sendControlSignal(Utils::ControlSignal controlSignal) +void QnxProcessImpl::handleSendControlSignal(Utils::ControlSignal controlSignal) { QTC_ASSERT(controlSignal != ControlSignal::KickOff, return); const QString args = QString::fromLatin1("-%1 `cat %2`") diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 63a3fb5b9a7..b278a17a2ef 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -496,6 +496,20 @@ qint64 SshProcessInterface::write(const QByteArray &data) return d->m_process.writeRaw(data); } +void SshProcessInterface::sendControlSignal(Utils::ControlSignal controlSignal) +{ + if (d->m_process.usesTerminal()) { + switch (controlSignal) { + case Utils::ControlSignal::Terminate: d->m_process.terminate(); break; + case Utils::ControlSignal::Kill: d->m_process.kill(); break; + case Utils::ControlSignal::Interrupt: d->m_process.interrupt(); break; + case Utils::ControlSignal::KickOff: d->m_process.kickoffProcess(); break; + } + return; + } + handleSendControlSignal(controlSignal); +} + LinuxProcessInterface::LinuxProcessInterface(const LinuxDevice *linuxDevice) : SshProcessInterface(linuxDevice) { @@ -506,7 +520,7 @@ LinuxProcessInterface::~LinuxProcessInterface() killIfRunning(); } -void LinuxProcessInterface::sendControlSignal(ControlSignal controlSignal) +void LinuxProcessInterface::handleSendControlSignal(ControlSignal controlSignal) { QTC_ASSERT(controlSignal != ControlSignal::KickOff, return); const qint64 pid = processId(); diff --git a/src/plugins/remotelinux/linuxprocessinterface.h b/src/plugins/remotelinux/linuxprocessinterface.h index b3430bce31c..28924591b05 100644 --- a/src/plugins/remotelinux/linuxprocessinterface.h +++ b/src/plugins/remotelinux/linuxprocessinterface.h @@ -19,7 +19,7 @@ public: ~LinuxProcessInterface(); private: - void sendControlSignal(Utils::ControlSignal controlSignal) override; + void handleSendControlSignal(Utils::ControlSignal controlSignal) override; void handleStarted(qint64 processId) final; void handleDone(const Utils::ProcessResultData &resultData) final; diff --git a/src/plugins/remotelinux/sshprocessinterface.h b/src/plugins/remotelinux/sshprocessinterface.h index b5b7fd25eeb..15ad2587f24 100644 --- a/src/plugins/remotelinux/sshprocessinterface.h +++ b/src/plugins/remotelinux/sshprocessinterface.h @@ -31,12 +31,13 @@ private: virtual void handleDone(const Utils::ProcessResultData &resultData); virtual void handleReadyReadStandardOutput(const QByteArray &outputData); virtual void handleReadyReadStandardError(const QByteArray &errorData); + virtual void handleSendControlSignal(Utils::ControlSignal controlSignal) = 0; virtual QString fullCommandLine(const Utils::CommandLine &commandLine) const = 0; void start() final; qint64 write(const QByteArray &data) final; - void sendControlSignal(Utils::ControlSignal controlSignal) override = 0; + void sendControlSignal(Utils::ControlSignal controlSignal) final; friend class SshProcessInterfacePrivate; SshProcessInterfacePrivate *d = nullptr; From e3b84dca1a29414d0902999745089717ad3d45ed Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 15 Nov 2022 12:31:58 +0100 Subject: [PATCH 08/13] Revert "Debugger: Avoid some temporary containers when parsing escaped chars" This reverts commit 19ef8e5c7a5348e4b47feed09cefcc2b4651be32 which introduced the following regression: FAIL! : tst_protocol::parseCString(octal) Compared values are not the same Actual (parsed) : "abc\u00C3\u00A4\u00C3\u00A9def\u00C3\u00B1" Expected (expected): "abc\u00E4\u00E9def\u00F1" Loc: [/data/dev/creator-out/tests/auto/debugger/tst_protocol.cpp(32)] FAIL! : tst_protocol::parseCString(hex) Compared values are not the same Actual (parsed) : "abc\u00C3\u00A4\u00C3\u00A9def\u00C3\u00B1" Expected (expected): "abc\u00E4\u00E9def\u00F1" Loc: [/data/dev/creator-out/tests/auto/debugger/tst_protocol.cpp(32)] Change-Id: I59509fd61a54c335ab0a34f8ca0dffb3d75da696 Reviewed-by: Eike Ziller --- src/plugins/debugger/debuggerprotocol.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 9aebe53f343..0bf60c3a4f5 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -112,7 +112,7 @@ void GdbMi::parseResultOrValue(DebuggerOutputParser &parser) } // Reads one \ooo entity. -static bool parseOctalEscapedHelper(DebuggerOutputParser &parser, QString &buffer) +static bool parseOctalEscapedHelper(DebuggerOutputParser &parser, QByteArray &buffer) { if (parser.remainingChars() < 4) return false; @@ -130,7 +130,7 @@ static bool parseOctalEscapedHelper(DebuggerOutputParser &parser, QString &buffe return true; } -static bool parseHexEscapedHelper(DebuggerOutputParser &parser, QString &buffer) +static bool parseHexEscapedHelper(DebuggerOutputParser &parser, QByteArray &buffer) { if (parser.remainingChars() < 4) return false; @@ -178,16 +178,15 @@ static void parseSimpleEscape(DebuggerOutputParser &parser, QString &result) // *or* one escaped char, *or* one unescaped char. static void parseCharOrEscape(DebuggerOutputParser &parser, QString &result) { - const int oldSize = result.size(); - while (parseOctalEscapedHelper(parser, result)) + QByteArray buffer; + while (parseOctalEscapedHelper(parser, buffer)) ; - while (parseHexEscapedHelper(parser, result)) + while (parseHexEscapedHelper(parser, buffer)) ; - if (result.size() != oldSize) - return; - - if (parser.isCurrent('\\')) { + if (!buffer.isEmpty()) { + result.append(QString::fromUtf8(buffer)); + } else if (parser.isCurrent('\\')) { parser.advance(); parseSimpleEscape(parser, result); } else { From 8bbeef1f98e92818d0904084109ffc9e5e8267bf Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 15 Nov 2022 10:21:42 +0100 Subject: [PATCH 09/13] Core: Tweak handling of scratch buffer If a temporary file is stored by using "Save As..." the temporary state should get lost to properly handle other actions, like closing a modified file, putting it into the recent files list, or similar. Change-Id: I94b3141bad1bd476056a774756071df5f60137aa Reviewed-by: Eike Ziller --- src/plugins/coreplugin/editormanager/editormanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 6aeb53a2203..7b05d761824 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2534,6 +2534,9 @@ bool EditorManagerPrivate::saveDocumentAs(IDocument *document) // re-think part of the editors design. if (success) { + // if document had been temporary before (scratch buffer) - remove the temporary flag + document->setTemporary(false); + addDocumentToRecentFiles(document); emit m_instance->saved(document); } From f8a3a4d04e70e1abb888f4cf035a906f6a6946ab Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 9 Nov 2022 19:29:41 +0100 Subject: [PATCH 10/13] SshProcessInterface: Don't use DeviceShell for control signals It looks like starting device shell is fragile in some circumstances. Fixes: QTCREATORBUG-28072 Change-Id: I1a51d1fb939bd42884a55e1492de808bee89219f Reviewed-by: hjk Reviewed-by: --- src/plugins/remotelinux/linuxdevice.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index b278a17a2ef..84e0547acb0 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -483,7 +483,17 @@ qint64 SshProcessInterface::processId() const bool SshProcessInterface::runInShell(const CommandLine &command, const QByteArray &data) { - return d->m_devicePrivate->runInShell(command, data).exitCode == 0; + QtcProcess process; + CommandLine cmd = {d->m_device->filePath("/bin/sh"), {"-c"}}; + QString tmp; + ProcessArgs::addArg(&tmp, command.executable().path()); + ProcessArgs::addArgs(&tmp, command.arguments()); + cmd.addArg(tmp); + process.setCommand(cmd); + process.setWriteData(data); + process.start(); + QTC_CHECK(process.waitForFinished()); // otherwise we may start producing killers for killers + return process.exitCode() == 0; } void SshProcessInterface::start() From 169f2c4af66c4703e6d708b0b10fa3b8a9062fa1 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 15 Nov 2022 15:09:26 +0100 Subject: [PATCH 11/13] GitHub Actions / COIN: Update Qt to 6.4.1 Change-Id: Icf1600c761989914e5de5ed024d7f4c4f2f01e18 Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot Reviewed-by: --- .github/workflows/build_cmake.yml | 2 +- coin/instructions/common_environment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 026d34ab3e4..e1be45d67c6 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -7,7 +7,7 @@ on: - 'doc/**' env: - QT_VERSION: 6.3.2 + QT_VERSION: 6.4.1 CLANG_VERSION: 15.0.0 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.21.1 diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index e5296b40e26..7c6bcfe14c0 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -10,7 +10,7 @@ instructions: variableValue: http://master.qt.io/development_releases/prebuilt/libclang/libclang-release_15.0.0-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL - variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt" + variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.1-released/Qt" - type: EnvironmentVariable variableName: QTC_QT_MODULES variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine" From ef658663aa36416362c2ea96bd0fd89c4d24b3c4 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 15 Nov 2022 16:22:49 +0100 Subject: [PATCH 12/13] Utils: Remove internal /./ relative path marker Some creeped into settings earlier, making the paths that were meant to be empty look non-empty. Also add a test for FilePath::isEmpty(). Change-Id: I99e3dd673294206558f9fee9b7c7874d2441327e Reviewed-by: Jarek Kobus --- src/libs/utils/filepath.cpp | 8 +++--- tests/auto/utils/fileutils/tst_fileutils.cpp | 26 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 55d5ca89a07..70487d6d3dc 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -343,15 +343,17 @@ QStringView FilePath::host() const QString FilePath::path() const { - if (m_data.startsWith("/./")) - return m_data.mid(3, m_pathLen - 3); + QTC_ASSERT(!m_data.startsWith(u"/./"), return m_data.mid(3, m_pathLen - 3)); return m_data.left(m_pathLen); } -void FilePath::setParts(const QStringView scheme, const QStringView host, const QStringView path) +void FilePath::setParts(const QStringView scheme, const QStringView host, QStringView path) { QTC_CHECK(!scheme.contains('/')); + if (path.startsWith(u"/./")) + path = path.mid(3); + m_data = path.toString() + scheme.toString() + host.toString(); m_schemeLen = scheme.size(); m_hostLen = host.size(); diff --git a/tests/auto/utils/fileutils/tst_fileutils.cpp b/tests/auto/utils/fileutils/tst_fileutils.cpp index 5fb8fa2d0c7..1446f82096f 100644 --- a/tests/auto/utils/fileutils/tst_fileutils.cpp +++ b/tests/auto/utils/fileutils/tst_fileutils.cpp @@ -30,6 +30,9 @@ signals: private slots: void initTestCase(); + void isEmpty_data(); + void isEmpty(); + void parentDir_data(); void parentDir(); @@ -143,6 +146,29 @@ void tst_fileutils::initTestCase() touch(dir, "x/y/fileToCopy.txt", true); } +void tst_fileutils::isEmpty_data() +{ + QTest::addColumn("path"); + QTest::addColumn("result"); + + QTest::newRow("empty path") << "" << true; + QTest::newRow("root only") << "/" << false; + QTest::newRow("//") << "//" << false; + QTest::newRow("scheme://host") << "scheme://host" << true; // Intentional (for now?) + QTest::newRow("scheme://host/") << "scheme://host/" << false; + QTest::newRow("scheme://host/a") << "scheme://host/a" << false; + QTest::newRow("scheme://host/.") << "scheme://host/." << false; +} + +void tst_fileutils::isEmpty() +{ + QFETCH(QString, path); + QFETCH(bool, result); + + FilePath filePath = FilePath::fromString(path); + QCOMPARE(filePath.isEmpty(), result); +} + void tst_fileutils::parentDir_data() { QTest::addColumn("path"); From 779dc52a976f7604c114e47d167d6b8537c4efd0 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 15 Nov 2022 09:25:16 +0100 Subject: [PATCH 13/13] Utils: Fix interrupting local processes on *nix Change-Id: I6e722379ad62c98d1e8e6d445c1eeea171ff141b Reviewed-by: Jarek Kobus --- src/libs/utils/processutils.cpp | 4 +++- src/libs/utils/qtcprocess.cpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/processutils.cpp b/src/libs/utils/processutils.cpp index 812ea63cc48..39624dab3dd 100644 --- a/src/libs/utils/processutils.cpp +++ b/src/libs/utils/processutils.cpp @@ -10,7 +10,9 @@ #include #else #include +#include #include +#include #include #endif @@ -127,7 +129,7 @@ void ProcessHelper::interruptPid(qint64 pid) #ifdef Q_OS_WIN EnumWindows(sendInterruptMessageToAllWindowsOfProcess_enumWnd, pid); #else - Q_UNUSED(pid) + ::kill(pid, SIGINT); #endif } diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index e6dffa0e786..92e7be0ca6c 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -459,8 +459,7 @@ private: m_handle->kill(); break; case ControlSignal::Interrupt: - if (m_setup.m_useCtrlCStub) // bypass launcher and interrupt directly - ProcessHelper::interruptPid(m_handle->processId()); + ProcessHelper::interruptPid(m_handle->processId()); break; case ControlSignal::KickOff: QTC_CHECK(false);