From 5d159e6185a9973ceff2dd91a78302f48b6be715 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 3 Jun 2024 13:04:01 +0200 Subject: [PATCH 1/7] CMakePM: Only add external "bin" dirs to PATH At QTCREATORBUG-29662 we have the issue when a program cannot be started because the PATH environment variable had content longer than 2048 characters. Qt Creator 12 had only one place that added paths to librarySeachPaths namely the "bin" directories. Qt Creator 13 tried to filter these "bin" directories to the ones that have .dll files. This fixed QTCREATORBUG-29662 but had issues with dlls having different names than the link libraries provided by CMake. By only allowing "bin" directories from paths not from the build directory we allow Qt, or OpenSSL dependencies, but not just existing "bin" directories. Amends 0d8a542b4f7d8a7b4d27f42ff16d309fba6cbf22 Amends 8713919f31f2aecc7e7c15f1fc9ce7906b8fefa0 Amends ac97ab1abf9bf073088925755a46f08f38721090 Amends 2ce6255a7d4fd33e54139a9615b3037e83587887 Task-number: QTCREATORBUG-29662 Change-Id: If0b162f25ae1e5bfc1e1ff313720c54c5ae936c5 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 66748345ced..9d55e2e692b 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -336,7 +336,7 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, // actual dll files in ../bin on windows. Qt is one example of that. if (tmp.fileName() == "lib") { const FilePath path = tmp.parentDir().pathAppended("bin"); - if (path.isDir()) + if (path.isDir() && !isChildOf(path, {buildDir})) librarySeachPaths.append(path); } } From 1543ead1b641b4ae5e60b3e65663da16ec44e618 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 30 May 2024 10:19:58 +0200 Subject: [PATCH 2/7] Add change log for 13.0.2 Change-Id: I6f80bc14b472ec9ec402a40e850ae86d46a29a5a Reviewed-by: Leena Miettinen --- dist/changelog/changes-13.0.2.md | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 dist/changelog/changes-13.0.2.md diff --git a/dist/changelog/changes-13.0.2.md b/dist/changelog/changes-13.0.2.md new file mode 100644 index 00000000000..3e1b67b3784 --- /dev/null +++ b/dist/changelog/changes-13.0.2.md @@ -0,0 +1,86 @@ +Qt Creator 13.0.2 +================= + +Qt Creator version 13.0.2 contains bug fixes. + +The most important changes are listed in this document. For a complete list of +changes, see the Git log for the Qt Creator sources that you can check out from +the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline v13.0.1..v13.0.2 + +General +------- + +* Fixed that the `-client` option could start a new Qt Creator instance instead + of using a running one (which affects for example version control operations) + ([QTCREATORBUG-30624](https://bugreports.qt.io/browse/QTCREATORBUG-30624)) + +Editing +------- + +* Fixed that closing files with the tool button didn't add an entry to the + navigation history + +### Widget Designer + +* Fixed that `Use Qt module name in #include-directive` used Qt 4 module names + ([QTCREATORBUG-30751](https://bugreports.qt.io/browse/QTCREATORBUG-30751)) + +Projects +-------- + +### Meson + +* Fixed a crash when selecting kits + ([QTCREATORBUG-30698](https://bugreports.qt.io/browse/QTCREATORBUG-30698)) + +Terminal +-------- + +* Fixed the handling of environment variables with an equal sign `=` in the + value + ([QTCREATORBUG-30844](https://bugreports.qt.io/browse/QTCREATORBUG-30844)) + +Version Control Systems +----------------------- + +### Git + +* Fixed a crash in `Instant Blame` when reloading externally modified files + ([QTCREATORBUG-30824](https://bugreports.qt.io/browse/QTCREATORBUG-30824)) + +Platforms +--------- + +### Windows + +* Fixed missing paths with `Add build library search path to PATH` for CMake + projects + ([QTCREATORBUG-30556](https://bugreports.qt.io/browse/QTCREATORBUG-30556), + [QTCREATORBUG-30827](https://bugreports.qt.io/browse/QTCREATORBUG-30827), + [QTCREATORBUG-30932](https://bugreports.qt.io/browse/QTCREATORBUG-30932)) + +### Android + +* Fixed a crash when re-connecting devices + ([QTCREATORBUG-30645](https://bugreports.qt.io/browse/QTCREATORBUG-30645), + [QTCREATORBUG-30770](https://bugreports.qt.io/browse/QTCREATORBUG-30770)) + +### Remote Linux + +* Fixed passing more than one argument to `rsync` + ([QTCREATORBUG-30795](https://bugreports.qt.io/browse/QTCREATORBUG-30795)) + +Credits for these changes go to: +-------------------------------- +Alessandro Portale +Christian Kandeler +Christian Stenger +Cristian Adam +David Schulz +Eike Ziller +Leena Miettinen +Marcus Tillmanns +Robert Löhning From a30eb2ccc49a50828f24fd69b308c122092fbfff Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 4 Jun 2024 09:09:07 +0200 Subject: [PATCH 3/7] Utils: Fix terminal process environment The TerminalInterface did not fallback to the system environment if no environment was set by the user. Instead it had platform specific code that saved over the path. Instead we just apply the user changes to the system environment. Change-Id: I011f1a9d935c958265b2bda8257ad8611f06e578 Reviewed-by: Eike Ziller --- src/libs/utils/terminalinterface.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/libs/utils/terminalinterface.cpp b/src/libs/utils/terminalinterface.cpp index 0d5a3be0203..45bdd8a4f9d 100644 --- a/src/libs/utils/terminalinterface.cpp +++ b/src/libs/utils/terminalinterface.cpp @@ -334,22 +334,12 @@ void TerminalInterface::start() Environment finalEnv = m_setup.m_environment; - if (HostOsInfo::isWindowsHost()) { - if (!finalEnv.hasKey("PATH")) { - const QString path = qtcEnvironmentVariable("PATH"); - if (!path.isEmpty()) - finalEnv.set("PATH", path); - } - if (!finalEnv.hasKey("SystemRoot")) { - const QString systemRoot = qtcEnvironmentVariable("SystemRoot"); - if (!systemRoot.isEmpty()) - finalEnv.set("SystemRoot", systemRoot); - } - } else if (HostOsInfo::isMacHost()) { + if (HostOsInfo::isMacHost()) finalEnv.set("TERM", "xterm-256color"); - } if (finalEnv.hasChanges()) { + finalEnv = finalEnv.appliedToEnvironment(Environment::systemEnvironment()); + d->envListFile = std::make_unique(this); if (!d->envListFile->open()) { cleanupAfterStartFailure(msgCannotCreateTempFile(d->envListFile->errorString())); From 725cf0637fefb17e434b44aba7ff9ac1462d8aa7 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 3 Jun 2024 22:13:36 +0200 Subject: [PATCH 4/7] CMakePM: Skip .obj/.o for static qml plugins in PATH Amends 5d159e6185a9973ceff2dd91a78302f48b6be715 This commit reverts to Qt Creator 12 behavior, plus skipping .obj/.o parts which are needed for linking but not for finding out library paths that need to be added to PATH environment. Tested with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/ qml/tutorials/extending-qml/chapter6-plugins Without the patch (Qt Creator 12 behavior): "C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/ Charts/CMakeFiles/chartsplugin_resources_1.dir/.qt/rcc", "C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/ Charts/CMakeFiles/chartsplugin_init.dir/chartsplugin_init_autogen", "C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/ Charts/CMakeFiles/chartsplugin_init.dir", "C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/ Charts", "C:/Qt/6.7.1/mingw_64/lib", "C:/Qt/6.7.1/mingw_64/bin" With the patch: "C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/ Charts", "C:/Qt/6.7.1/mingw_64/lib", "C:/Qt/6.7.1/mingw_64/bin" As you can see above, only skipping the .obj/.o files will bring a lot. The change also doesn't come with the side effects of the Qt Creator 13.0.0/1 releases. Task-number: QTCREATORBUG-29662 Change-Id: I264a0ef579177b7129471919b77cd22a46e7d511 Reviewed-by: Eike Ziller --- .../fileapidataextractor.cpp | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 9d55e2e692b..bb45b5224ae 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -209,12 +209,9 @@ static bool isChildOf(const FilePath &path, const FilePaths &prefixes) static CMakeBuildTarget toBuildTarget(const TargetDetails &t, const FilePath &sourceDirectory, const FilePath &buildDirectory, - bool relativeLibs, - const QSet &sharedLibraryArtifacts) + bool relativeLibs) { const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir); - const QSet sharedLibraryArtifactsPaths - = transform(sharedLibraryArtifacts, &FilePath::parentDir); CMakeBuildTarget ct; ct.title = t.name; @@ -323,20 +320,20 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, // "/usr/local/lib" since these are usually in the standard search // paths. There probably are more, but the naming schemes are arbitrary // so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR"). - if (buildDir.osType() != OsTypeWindows - && !isChildOf(tmp, - {"/lib", "/lib64", "/usr/lib", "/usr/lib64", "/usr/local/lib"})) + if (buildDir.osType() == OsTypeWindows + || !isChildOf(tmp, + {"/lib", + "/lib64", + "/usr/lib", + "/usr/lib64", + "/usr/local/lib"})) { librarySeachPaths.append(tmp); - if (buildDir.osType() == OsTypeWindows) { - if (sharedLibraryArtifactsPaths.contains(tmp)) - librarySeachPaths.append(tmp); - // Libraries often have their import libs in ../lib and the // actual dll files in ../bin on windows. Qt is one example of that. - if (tmp.fileName() == "lib") { + if (tmp.fileName() == "lib" && buildDir.osType() == OsTypeWindows) { const FilePath path = tmp.parentDir().pathAppended("bin"); - if (path.isDir() && !isChildOf(path, {buildDir})) + if (path.isDir()) librarySeachPaths.append(path); } } @@ -355,19 +352,12 @@ static QList generateBuildTargets(const QFuture &cancelF const FilePath &buildDirectory, bool relativeLibs) { - QSet sharedLibraryArtifacts; - for (const TargetDetails &t : input.targetDetails) - if (t.type == "MODULE_LIBRARY" || t.type == "SHARED_LIBRARY") - for (const FilePath &p : t.artifacts) - sharedLibraryArtifacts.insert(buildDirectory.resolvePath(p)); - QList result; result.reserve(input.targetDetails.size()); for (const TargetDetails &t : input.targetDetails) { if (cancelFuture.isCanceled()) return {}; - result.append( - toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs, sharedLibraryArtifacts)); + result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs)); } return result; } From 3be0b263a87c4289f26ad778829c2b38643178a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sivert=20Kr=C3=B8vel?= Date: Thu, 30 May 2024 17:19:10 +0200 Subject: [PATCH 5/7] McuSupport: Read and write user settings with non-versioned key The settings keys are versioned to avoid the situation where the installer removes a settings key which may still be in use. See QTCREATORBUG-29194 for details. When reading from user settings, it makes more sense to use the non-versioned keys, especially in the case of the main Qt for MCUs SDK package path. With this patch, the plain settings key is used to read and write except for when determining the default value of a path in the McuPackage constructor, where we want to also look in the system scope settings for the values written by the installer, which may be version specific Task-number: QTCREATORBUG-30810 Change-Id: Ib1e2be170cb7da24b6e4534b59f702b894556d8c Reviewed-by: Yasser Grimes Reviewed-by: Eike Ziller --- src/plugins/mcusupport/mcupackage.cpp | 18 ++++++++++++++---- src/plugins/mcusupport/mcupackage.h | 2 +- src/plugins/mcusupport/settingshandler.cpp | 16 ++++++++++++++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index 2ff913c680e..efcff77352b 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -43,11 +43,11 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler, const McuPackageVersionDetector *versionDetector, const bool addToSystemPath, const Utils::PathChooser::Kind &valueType, - const bool useNewestVersionKey) + const bool allowNewerVersionKey) : settingsHandler(settingsHandler) , m_label(label) , m_detectionPaths(detectionPaths) - , m_settingsKey(settingsHandler->getVersionedKey(settingsKey, QSettings::SystemScope, versions, useNewestVersionKey)) + , m_settingsKey(settingsKey) , m_versionDetector(versionDetector) , m_versions(versions) , m_cmakeVariableName(cmakeVarName) @@ -56,8 +56,18 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler, , m_addToSystemPath(addToSystemPath) , m_valueType(valueType) { - m_defaultPath = settingsHandler->getPath(m_settingsKey, QSettings::SystemScope, defaultPath); - m_path = settingsHandler->getPath(m_settingsKey, QSettings::UserScope, m_defaultPath); + // The installer writes versioned keys as well as the plain key as found in the kits. + // Use the versioned key in case the plain key was removed by an uninstall operation + const Utils::Key versionedKey = settingsHandler->getVersionedKey(settingsKey, + QSettings::SystemScope, + versions, + allowNewerVersionKey); + m_defaultPath = settingsHandler->getPath(versionedKey, QSettings::SystemScope, defaultPath); + m_path = settingsHandler->getPath(m_settingsKey, QSettings::UserScope, ""); + // The user settings may have been written with a versioned key in older versions of QtCreator + if (m_path.isEmpty()) { + m_path = settingsHandler->getPath(versionedKey, QSettings::UserScope, m_defaultPath); + } if (m_path.isEmpty()) { m_path = FilePath::fromUserInput(qtcEnvironmentVariable(m_environmentVariableName)); } diff --git a/src/plugins/mcusupport/mcupackage.h b/src/plugins/mcusupport/mcupackage.h index a74c08bcf2d..7b9ef646506 100644 --- a/src/plugins/mcusupport/mcupackage.h +++ b/src/plugins/mcusupport/mcupackage.h @@ -41,7 +41,7 @@ public: const bool addToPath = false, const Utils::PathChooser::Kind &valueType = Utils::PathChooser::Kind::ExistingDirectory, - const bool useNewestVersionKey = false); + const bool allowNewerVersionKey = false); ~McuPackage() override = default; diff --git a/src/plugins/mcusupport/settingshandler.cpp b/src/plugins/mcusupport/settingshandler.cpp index 1ecec030b45..939ba125d1c 100644 --- a/src/plugins/mcusupport/settingshandler.cpp +++ b/src/plugins/mcusupport/settingshandler.cpp @@ -105,12 +105,24 @@ FilePath SettingsHandler::getPath(const Key &settingsKey, bool SettingsHandler::write(const Key &settingsKey, const FilePath &path, - const FilePath &defaultPath) const + const FilePath &maybeDefaultPath) const { const FilePath savedPath = packagePathFromSettings(settingsKey, *Core::ICore::settings(QSettings::UserScope), - defaultPath); + maybeDefaultPath); const Key key = Key(Constants::SETTINGS_GROUP) + '/' + Constants::SETTINGS_KEY_PACKAGE_PREFIX + settingsKey; + + FilePath defaultPath = maybeDefaultPath; + if (path == maybeDefaultPath) { + // If the installer has overwritten the non-versioned key with an older version than the + // newest versioned key, and the user wants to manually return to the newest installed + // version, the defaultPath will match the desired path, and the settings object will + // assume it can simply remove the key instead of writing a new value to it. + // To work around this, pretend like the default value is the value found from the global scope + defaultPath = packagePathFromSettings(settingsKey, + *Core::ICore::settings(QSettings::SystemScope), + maybeDefaultPath);; + } Core::ICore::settings()->setValueWithDefault(key, path.toUserOutput(), defaultPath.toUserOutput()); From 0e80f63a1ae675692afdfc9085bbaf2d228b6a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sivert=20Kr=C3=B8vel?= Date: Fri, 31 May 2024 13:41:43 +0200 Subject: [PATCH 6/7] McuSupport: Use arm-none-eabi-gdb as a backup debugger We normally use arm-none-eabi-gdb-py, but this doesn't come with the new arm gcc version which ships with Qt for MCUs 2.8.0 To make sure the kit works, use this as a fallback. Task-number: QTCREATORBUG-30699 Change-Id: I85c6c3ea1f7aae504e0aa1afb8a344d9bc3067d5 Reviewed-by: Kwangsub Kim Reviewed-by: Eike Ziller --- src/plugins/mcusupport/mcupackage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index efcff77352b..2ccc4bcc1a0 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -569,6 +569,10 @@ QVariant McuToolchainPackage::debuggerId() const switch (m_type) { case ToolchainType::ArmGcc: { sub = QString::fromLatin1("bin/arm-none-eabi-gdb-py"); + const FilePath command = (path() / sub).withExecutableSuffix(); + if (!command.exists()) { + sub = QString::fromLatin1("bin/arm-none-eabi-gdb"); + } displayName = Tr::tr("Arm GDB at %1"); engineType = Debugger::GdbEngineType; break; From f512bbff895f387f7fe03529a9fa09ca50175ebe Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 3 Jun 2024 08:55:10 +0200 Subject: [PATCH 7/7] Copilot: Adapt to agent.js => language-server.js rename Copilot has changed the name of agent.js to language-server.js. This patch adds the new name and changes the installation note without changing the translation. Change-Id: I585fe54c86029de32de806447ec3356999a99540 Reviewed-by: Eike Ziller --- src/plugins/copilot/copilotsettings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 9ddfa4edfbb..21737c3a926 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -50,18 +50,22 @@ CopilotSettings::CopilotSettings() // Vim, Linux/macOS: FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"), FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"), + FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/language-server.js"), // Neovim, Linux/macOS: FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/dist/agent.js"), FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js"), + FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/dist/language-server.js"), // Vim, Windows (PowerShell command): FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/dist/agent.js"), FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/copilot/dist/agent.js"), + FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/dist/language-server.js"), // Neovim, Windows (PowerShell command): FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/dist/agent.js"), - FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js") + FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js"), + FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/dist/language-server.js") }; // clang-format on @@ -202,7 +206,7 @@ CopilotSettings::CopilotSettings() "file from the Copilot neovim plugin.", "Markdown text for the copilot instruction label") .arg("[README.md](https://github.com/github/copilot.vim)") - .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/dist)")); + .arg("[language-server.js](https://github.com/github/copilot.vim/tree/release/dist)")); return Column { Group {