diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index a99d71736fa..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 @@ -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: diff --git a/coin/instructions/build.yaml b/coin/instructions/build.yaml index ee210bc687b..c22e384f6c4 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/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" diff --git a/coin/instructions/provision.yaml b/coin/instructions/provision.yaml index 37661084e64..724bf30b38d 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 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: 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/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 2f629d3f24f..96a8ce72e57 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); diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 67819b09fd8..c8958648fd5 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 @@ -17,6 +16,7 @@ #include #include #include +#include #include #include @@ -38,7 +38,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/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index e0652b30d6c..896566b8655 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); } diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 2c16a6bb70b..5739933b003 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/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 { 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 6004e4c8c4c..db6057ba486 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -481,7 +481,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() @@ -494,6 +504,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) { @@ -504,7 +528,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; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 4d6c193caf8..ab6ba6c3a81 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -686,6 +686,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); @@ -4026,7 +4028,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; @@ -4084,6 +4086,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()) @@ -4098,8 +4101,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) 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"); 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_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" 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"