Merge remote-tracking branch 'origin/13.0' into 14.0

Conflicts:
	src/plugins/copilot/copilotsettings.cpp

Change-Id: I6d17cf8968d6efbafb883da8346c7950349f7d84
This commit is contained in:
Eike Ziller
2024-06-04 14:43:35 +02:00
7 changed files with 138 additions and 42 deletions

86
dist/changelog/changes-13.0.2.md vendored Normal file
View File

@@ -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

View File

@@ -334,22 +334,12 @@ void TerminalInterface::start()
Environment finalEnv = m_setup.m_environment; Environment finalEnv = m_setup.m_environment;
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isMacHost())
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()) {
finalEnv.set("TERM", "xterm-256color"); finalEnv.set("TERM", "xterm-256color");
}
if (finalEnv.hasChanges()) { if (finalEnv.hasChanges()) {
finalEnv = finalEnv.appliedToEnvironment(Environment::systemEnvironment());
d->envListFile = std::make_unique<QTemporaryFile>(this); d->envListFile = std::make_unique<QTemporaryFile>(this);
if (!d->envListFile->open()) { if (!d->envListFile->open()) {
cleanupAfterStartFailure(msgCannotCreateTempFile(d->envListFile->errorString())); cleanupAfterStartFailure(msgCannotCreateTempFile(d->envListFile->errorString()));

View File

@@ -209,12 +209,9 @@ static bool isChildOf(const FilePath &path, const FilePaths &prefixes)
static CMakeBuildTarget toBuildTarget(const TargetDetails &t, static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
const FilePath &sourceDirectory, const FilePath &sourceDirectory,
const FilePath &buildDirectory, const FilePath &buildDirectory,
bool relativeLibs, bool relativeLibs)
const QSet<FilePath> &sharedLibraryArtifacts)
{ {
const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir); const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir);
const QSet<FilePath> sharedLibraryArtifactsPaths
= transform(sharedLibraryArtifacts, &FilePath::parentDir);
CMakeBuildTarget ct; CMakeBuildTarget ct;
ct.title = t.name; ct.title = t.name;
@@ -323,18 +320,18 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
// "/usr/local/lib" since these are usually in the standard search // "/usr/local/lib" since these are usually in the standard search
// paths. There probably are more, but the naming schemes are arbitrary // paths. There probably are more, but the naming schemes are arbitrary
// so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR"). // so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR").
if (buildDir.osType() != OsTypeWindows if (buildDir.osType() == OsTypeWindows
&& !isChildOf(tmp, || !isChildOf(tmp,
{"/lib", "/lib64", "/usr/lib", "/usr/lib64", "/usr/local/lib"})) {"/lib",
librarySeachPaths.append(tmp); "/lib64",
"/usr/lib",
if (buildDir.osType() == OsTypeWindows) { "/usr/lib64",
if (sharedLibraryArtifactsPaths.contains(tmp)) "/usr/local/lib"})) {
librarySeachPaths.append(tmp); librarySeachPaths.append(tmp);
// Libraries often have their import libs in ../lib and the // Libraries often have their import libs in ../lib and the
// actual dll files in ../bin on windows. Qt is one example of that. // 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"); const FilePath path = tmp.parentDir().pathAppended("bin");
if (path.isDir()) if (path.isDir())
librarySeachPaths.append(path); librarySeachPaths.append(path);
@@ -355,19 +352,12 @@ static QList<CMakeBuildTarget> generateBuildTargets(const QFuture<void> &cancelF
const FilePath &buildDirectory, const FilePath &buildDirectory,
bool relativeLibs) bool relativeLibs)
{ {
QSet<FilePath> 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<CMakeBuildTarget> result; QList<CMakeBuildTarget> result;
result.reserve(input.targetDetails.size()); result.reserve(input.targetDetails.size());
for (const TargetDetails &t : input.targetDetails) { for (const TargetDetails &t : input.targetDetails) {
if (cancelFuture.isCanceled()) if (cancelFuture.isCanceled())
return {}; return {};
result.append( result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs));
toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs, sharedLibraryArtifacts));
} }
return result; return result;
} }

View File

@@ -50,18 +50,22 @@ CopilotSettings::CopilotSettings()
// Vim, Linux/macOS: // Vim, Linux/macOS:
FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"), 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/copilot/dist/agent.js"),
FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/language-server.js"),
// Neovim, Linux/macOS: // Neovim, Linux/macOS:
FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/dist/agent.js"), 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/copilot/dist/agent.js"),
FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/dist/language-server.js"),
// Vim, Windows (PowerShell command): // Vim, Windows (PowerShell command):
FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/dist/agent.js"), 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/copilot/dist/agent.js"),
FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/dist/language-server.js"),
// Neovim, Windows (PowerShell command): // 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/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 // clang-format on
@@ -198,7 +202,7 @@ CopilotSettings::CopilotSettings()
"file from the Copilot neovim plugin.", "file from the Copilot neovim plugin.",
"Markdown text for the copilot instruction label") "Markdown text for the copilot instruction label")
.arg("[README.md](https://github.com/github/copilot.vim)") .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 { return Column {

View File

@@ -43,11 +43,11 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler,
const McuPackageVersionDetector *versionDetector, const McuPackageVersionDetector *versionDetector,
const bool addToSystemPath, const bool addToSystemPath,
const Utils::PathChooser::Kind &valueType, const Utils::PathChooser::Kind &valueType,
const bool useNewestVersionKey) const bool allowNewerVersionKey)
: settingsHandler(settingsHandler) : settingsHandler(settingsHandler)
, m_label(label) , m_label(label)
, m_detectionPaths(detectionPaths) , m_detectionPaths(detectionPaths)
, m_settingsKey(settingsHandler->getVersionedKey(settingsKey, QSettings::SystemScope, versions, useNewestVersionKey)) , m_settingsKey(settingsKey)
, m_versionDetector(versionDetector) , m_versionDetector(versionDetector)
, m_versions(versions) , m_versions(versions)
, m_cmakeVariableName(cmakeVarName) , m_cmakeVariableName(cmakeVarName)
@@ -56,8 +56,18 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler,
, m_addToSystemPath(addToSystemPath) , m_addToSystemPath(addToSystemPath)
, m_valueType(valueType) , m_valueType(valueType)
{ {
m_defaultPath = settingsHandler->getPath(m_settingsKey, QSettings::SystemScope, defaultPath); // The installer writes versioned keys as well as the plain key as found in the kits.
m_path = settingsHandler->getPath(m_settingsKey, QSettings::UserScope, m_defaultPath); // 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()) { if (m_path.isEmpty()) {
m_path = FilePath::fromUserInput(qtcEnvironmentVariable(m_environmentVariableName)); m_path = FilePath::fromUserInput(qtcEnvironmentVariable(m_environmentVariableName));
} }
@@ -559,6 +569,10 @@ QVariant McuToolchainPackage::debuggerId() const
switch (m_type) { switch (m_type) {
case ToolchainType::ArmGcc: { case ToolchainType::ArmGcc: {
sub = QString::fromLatin1("bin/arm-none-eabi-gdb-py"); 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"); displayName = Tr::tr("Arm GDB at %1");
engineType = Debugger::GdbEngineType; engineType = Debugger::GdbEngineType;
break; break;

View File

@@ -41,7 +41,7 @@ public:
const bool addToPath = false, const bool addToPath = false,
const Utils::PathChooser::Kind &valueType const Utils::PathChooser::Kind &valueType
= Utils::PathChooser::Kind::ExistingDirectory, = Utils::PathChooser::Kind::ExistingDirectory,
const bool useNewestVersionKey = false); const bool allowNewerVersionKey = false);
~McuPackage() override = default; ~McuPackage() override = default;

View File

@@ -105,12 +105,24 @@ FilePath SettingsHandler::getPath(const Key &settingsKey,
bool SettingsHandler::write(const Key &settingsKey, bool SettingsHandler::write(const Key &settingsKey,
const FilePath &path, const FilePath &path,
const FilePath &defaultPath) const const FilePath &maybeDefaultPath) const
{ {
const FilePath savedPath = packagePathFromSettings(settingsKey, const FilePath savedPath = packagePathFromSettings(settingsKey,
*Core::ICore::settings(QSettings::UserScope), *Core::ICore::settings(QSettings::UserScope),
defaultPath); maybeDefaultPath);
const Key key = Key(Constants::SETTINGS_GROUP) + '/' + Constants::SETTINGS_KEY_PACKAGE_PREFIX + settingsKey; 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, Core::ICore::settings()->setValueWithDefault(key,
path.toUserOutput(), path.toUserOutput(),
defaultPath.toUserOutput()); defaultPath.toUserOutput());