From cfb5f610a128db31b6dbf5e5e0184d9b5e6dfd39 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 5 Jul 2017 13:45:49 +0200 Subject: [PATCH 1/4] Update binaries' supported macOS Change-Id: If51b0395b509c8e943688a9f00352b4ac5800369 Reviewed-by: Leena Miettinen --- README.md | 2 +- doc/src/overview/creator-supported-platforms.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b46e247900d..7a956dad24f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The standalone binary packages support the following platforms: * Windows 7 or later * (K)Ubuntu Linux 16.04 (64-bit) or later -* macOS 10.8 or later +* macOS 10.10 or later ## Compiling Qt Creator diff --git a/doc/src/overview/creator-supported-platforms.qdoc b/doc/src/overview/creator-supported-platforms.qdoc index dda8caee098..43118e4c8de 100644 --- a/doc/src/overview/creator-supported-platforms.qdoc +++ b/doc/src/overview/creator-supported-platforms.qdoc @@ -97,7 +97,7 @@ \endlist - \li \macos 10.8 or later with the following: + \li \macos 10.10 or later with the following: \list From f51d7a2314fc7174f02cda2b448931fa5eb6721d Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 5 Jul 2017 12:10:17 +0200 Subject: [PATCH 2/4] C++: Fix crash for invalid code ...due to indirect recursion: ... CPlusPlus::ClassOrNamespace::lookupType LookupContext.cpp 833 0x7fffd6c954cc CPlusPlus::ClassOrNamespace::nestedType LookupContext.cpp 1364 0x7fffd6c94bc6 CPlusPlus::ClassOrNamespace::lookupType_helper LookupContext.cpp 955 0x7fffd6c9517f CPlusPlus::ClassOrNamespace::lookupType_helper LookupContext.cpp 983 0x7fffd6c952ad CPlusPlus::ClassOrNamespace::lookupType LookupContext.cpp 833 0x7fffd6c954cc CPlusPlus::ClassOrNamespace::nestedType LookupContext.cpp 1364 0x7fffd6c94bc6 CPlusPlus::ClassOrNamespace::lookupType_helper LookupContext.cpp 955 0x7fffd6c9517f CPlusPlus::ClassOrNamespace::lookupType_helper LookupContext.cpp 983 0x7fffd6c952ad CPlusPlus::ClassOrNamespace::lookupType LookupContext.cpp 833 0x7fffd6c954cc ... ClassOrNamespace::lookupType(const Name *) already guards with a list of entries already processed, but some calls deeper the list is not passed on and lookupType() starts again with an empty list. Handle that case, too. Task-number: QTCREATORBUG-18499 Change-Id: Iab8978f6ac1d0aea16f49b3547415f43de887b07 Reviewed-by: Marco Bubke --- src/libs/cplusplus/LookupContext.cpp | 20 ++++++++++++-------- src/libs/cplusplus/LookupContext.h | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index cb2aead5a35..0e9fccead2d 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -952,7 +952,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name, return this; } - if (ClassOrNamespace *e = nestedType(name, origin)) + if (ClassOrNamespace *e = nestedType(name, processed, origin)) return e; if (_templateId) { @@ -1074,7 +1074,9 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateNestedAnonymousType( } } -ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespace *origin) +ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, + QSet *processed, + ClassOrNamespace *origin) { Q_ASSERT(name != 0); Q_ASSERT(name->isNameId() || name->isTemplateNameId() || name->isAnonymousNameId()); @@ -1184,11 +1186,11 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac instantiation->_name = templId; instantiation->_templateId = templId; - QSet processed; + QSet otherProcessed; while (!origin->_symbols.isEmpty() && origin->_symbols[0]->isBlock()) { - if (processed.contains(origin)) + if (otherProcessed.contains(origin)) break; - processed.insert(origin); + otherProcessed.insert(origin); origin = origin->parent(); } @@ -1310,7 +1312,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac // Another template that uses the dependent name. // Ex.: template class A : public B {}; if (baseTemplId->identifier() != templId->identifier()) - baseBinding = nestedType(baseName, origin); + baseBinding = nestedType(baseName, processed, origin); } else if (const QualifiedNameId *qBaseName = baseName->asQualifiedNameId()) { // Qualified names in general. // Ex.: template class A : public B::Type {}; @@ -1361,7 +1363,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac } if (binding) { - ClassOrNamespace * baseBinding = binding->lookupType(baseName); + ClassOrNamespace * baseBinding + = binding->lookupType_helper(baseName, processed, true, this); if (baseBinding && !knownUsings.contains(baseBinding)) reference->addUsing(baseBinding); } @@ -1518,7 +1521,8 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateType(const Name *name, ClassOrNa return findOrCreateType(q->base(), origin)->findOrCreateType(q->name(), origin, clazz); } else if (name->isNameId() || name->isTemplateNameId() || name->isAnonymousNameId()) { - ClassOrNamespace *e = nestedType(name, origin); + QSet processed; + ClassOrNamespace *e = nestedType(name, &processed, origin); if (! e) { e = _factory->allocClassOrNamespace(this); diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h index 7273fe57d02..b13df5da29a 100644 --- a/src/libs/cplusplus/LookupContext.h +++ b/src/libs/cplusplus/LookupContext.h @@ -121,7 +121,8 @@ class CPLUSPLUS_EXPORT ClassOrNamespace ClassOrNamespace *findBlock_helper(Block *block, QSet *processed, bool searchInEnclosingScope); - ClassOrNamespace *nestedType(const Name *name, ClassOrNamespace *origin); + ClassOrNamespace *nestedType(const Name *name, QSet *processed, + ClassOrNamespace *origin); void instantiateNestedClasses(ClassOrNamespace *enclosingTemplateClass, Clone &cloner, From b80d5c1c95f44991c12cf997dfe5c09b442a6af2 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 5 Jul 2017 15:46:10 -0700 Subject: [PATCH 3/4] Qbs: fix bundle installation with Qbs 1.8 This patch also sets the minimumQbsVersion to 1.7 because that's the version that is actually documented as being required in the README. Change-Id: I862daaf5fa34ab2cc5db47581689e08aa34f0910 Reviewed-by: Christian Kandeler Reviewed-by: Eike Ziller Reviewed-by: Jake Petroules --- qbs/imports/QtcProduct.qbs | 2 ++ qtcreator.qbs | 2 +- src/app/app.qbs | 11 +++-------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index 52e63f1f6f3..65c792ac5cc 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -8,6 +8,7 @@ Product { version: qtc.qtcreator_version property bool install: true property string installDir + property string installSourceBase property stringList installTags: type property string fileName: FileInfo.fileName(sourceDirectory) + ".qbs" property bool useNonGuiPchFile: false @@ -37,6 +38,7 @@ Product { fileTagsFilter: installTags qbs.install: install qbs.installDir: installDir + qbs.installSourceBase: installSourceBase } Group { diff --git a/qtcreator.qbs b/qtcreator.qbs index f28ba82a1aa..d93ca3bdebd 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -4,7 +4,7 @@ import qbs.FileInfo Project { name: "Qt Creator" - minimumQbsVersion: "1.6.0" + minimumQbsVersion: "1.7.0" property bool withAutotests: qbs.buildVariant === "debug" property path ide_source_tree: path property pathList additionalPlugins: [] diff --git a/src/app/app.qbs b/src/app/app.qbs index 2eac52ac64a..0af41ca20d9 100644 --- a/src/app/app.qbs +++ b/src/app/app.qbs @@ -20,7 +20,9 @@ QtcProduct { targetName: qtc.ide_app_target version: qtc.qtcreator_version - installDir: qtc.ide_bin_path + installDir: bundle.isBundle ? qtc.ide_app_path : qtc.ide_bin_path + installTags: bundle.isBundle ? ["bundle.content"] : base + installSourceBase: bundle.isBundle ? buildDirectory : base property bool qtcRunnable: true cpp.rpaths: qbs.targetOS.contains("macos") ? ["@executable_path/../Frameworks"] @@ -72,11 +74,4 @@ QtcProduct { "../shared/qtlockedfile/qtlockedfile_win.cpp" ] } - - Group { - condition: qbs.targetOS.contains("macos") - fileTagsFilter: ["aggregate_infoplist", "pkginfo", "compiled_assetcatalog"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } } From 4196534759f7f7aa04c8675378cfec57539abc75 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 5 Jul 2017 15:53:53 -0700 Subject: [PATCH 4/4] Fix the deployment target problem once and for all Instead of hardcoding the value of LSMinimumSystemVersion in Info.plist where we will always forget to update it (and since Qt Creator can be built with multiple versions of Qt, it will almost certainly be wrong for one of those versions), automatically determine the value from QMAKE_MACOSX_DEPLOYMENT_TARGET, which is authoritative. This should prevent mishaps where users try to run Qt Creator on older OS versions and receive a crash dialog instead of the friendly "This app requires a newer version of macOS" message that a properly set LSMinimumSystemVersion value will induce. The Qbs build is not affected by this problem, as Qbs automatically handles the minimum deployment target even when a custom Info.plist is specified. The solution chosen in this patch was used instead of QMAKE_SUBSTITUTES because the Qbs build also uses the Info.plist input file and it would break the Qbs build if the quotes were to be escaped, since it would become invalid XML. Change-Id: I20625a2fae546c6597a567f28864b12917e8ac39 Reviewed-by: Oswald Buddenhagen --- src/app/Info.plist | 2 +- src/app/app.pro | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/Info.plist b/src/app/Info.plist index 6d31c52d266..8447dd66d4a 100644 --- a/src/app/Info.plist +++ b/src/app/Info.plist @@ -253,6 +253,6 @@ CFBundleShortVersionString @SHORT_VERSION@ LSMinimumSystemVersion - 10.8 + @MACOSX_DEPLOYMENT_TARGET@ diff --git a/src/app/app.pro b/src/app/app.pro index fee710e99d7..58dca7ba050 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -53,7 +53,12 @@ win32 { INSTALLS += icns } } - QMAKE_INFO_PLIST = Info.plist + + infoplist = $$cat($$PWD/Info.plist, blob) + infoplist = $$replace(infoplist, @MACOSX_DEPLOYMENT_TARGET@, $$QMAKE_MACOSX_DEPLOYMENT_TARGET) + write_file($$OUT_PWD/Info.plist, infoplist) + + QMAKE_INFO_PLIST = $$OUT_PWD/Info.plist } target.path = $$INSTALL_APP_PATH