forked from qt-creator/qt-creator
Revert "Android: Speed up startup by using existing Qt6 Information"
This reverts commit16c12f71ff
. Reason for revert: Introduces bugs. AndroidQtVersion::addToEnvironment() set varying ANDROID_NDK_PLATFORM values in successive calls. Only after a call of QtVersion::ensureMkSpecParsed, a consistent value is set. The symptom could be fixed by adding QtVersion::ensureMkSpecParsed calls in strategic places (e.g. in the beginning of AndroidQtVersion::addToEnvironment), but it does not make me confident that this covers all potential code paths. The change that introduces the issue is16c12f71ff
and will therefore be reverted. It may be resurrected in QtC 14, but with much caution. This issue seems to be specific to qmake. It hardens my impression, that there are no easy gains to be made in the current state of the Android plugin. An improvement for one use-case will break another use-case which may be fixed only after two release cycles. It is Mikado code: "Only touch if needed and safe". Change-Id: I6ad860f6af8848a900d9421837a03929f9a57645 Fixes: QTCREATORBUG-30554 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
committed by
David Schulz
parent
36fdb81aef
commit
44bf71169c
@@ -109,6 +109,11 @@ const QLatin1String X86ToolsPrefix("i686-linux-android");
|
||||
const QLatin1String AArch64ToolsPrefix("aarch64-linux-android");
|
||||
const QLatin1String X86_64ToolsPrefix("x86_64-linux-android");
|
||||
|
||||
const QLatin1String ArmToolsDisplayName("arm");
|
||||
const QLatin1String X86ToolsDisplayName("i686");
|
||||
const QLatin1String AArch64ToolsDisplayName("aarch64");
|
||||
const QLatin1String X86_64ToolsDisplayName("x86_64");
|
||||
|
||||
const QLatin1String Unknown("unknown");
|
||||
const QLatin1String keytoolName("keytool");
|
||||
const Key changeTimeStamp("ChangeTimeStamp");
|
||||
@@ -177,12 +182,12 @@ QLatin1String AndroidConfig::displayName(const Abi &abi)
|
||||
switch (abi.architecture()) {
|
||||
case Abi::ArmArchitecture:
|
||||
if (abi.wordWidth() == 64)
|
||||
return QLatin1String(Constants::AArch64ToolsDisplayName);
|
||||
return QLatin1String(Constants::ArmToolsDisplayName);
|
||||
return AArch64ToolsDisplayName;
|
||||
return ArmToolsDisplayName;
|
||||
case Abi::X86Architecture:
|
||||
if (abi.wordWidth() == 64)
|
||||
return QLatin1String(Constants::X86_64ToolsDisplayName);
|
||||
return QLatin1String(Constants::X86ToolsDisplayName);
|
||||
return X86_64ToolsDisplayName;
|
||||
return X86ToolsDisplayName;
|
||||
default:
|
||||
return Unknown;
|
||||
}
|
||||
|
@@ -81,11 +81,4 @@ const char ndkPackageName[] = "ndk";
|
||||
const char platformsPackageName[] = "platforms";
|
||||
const char buildToolsPackageName[] = "build-tools";
|
||||
|
||||
// For AndroidQtVersion
|
||||
const char ArmToolsDisplayName[] = "arm";
|
||||
const char ArmV7ToolsDisplayName[] = "armv7";
|
||||
const char X86ToolsDisplayName[] = "i686";
|
||||
const char AArch64ToolsDisplayName[] = "aarch64";
|
||||
const char X86_64ToolsDisplayName[] = "x86_64";
|
||||
|
||||
} // Android::Constants
|
||||
|
@@ -109,24 +109,13 @@ QString AndroidQtVersion::description() const
|
||||
|
||||
const QStringList &AndroidQtVersion::androidAbis() const
|
||||
{
|
||||
if (m_androidAbis.isEmpty()) {
|
||||
bool sanityCheckNotUsed;
|
||||
const BuiltWith bw = builtWith(&sanityCheckNotUsed);
|
||||
if (!bw.androidAbi.isEmpty()) {
|
||||
m_androidAbis << bw.androidAbi;
|
||||
m_minNdk = bw.apiVersion;
|
||||
} else {
|
||||
ensureMkSpecParsed();
|
||||
}
|
||||
}
|
||||
|
||||
ensureMkSpecParsed();
|
||||
return m_androidAbis;
|
||||
}
|
||||
|
||||
int AndroidQtVersion::minimumNDK() const
|
||||
{
|
||||
if (m_minNdk == -1)
|
||||
ensureMkSpecParsed();
|
||||
ensureMkSpecParsed();
|
||||
return m_minNdk;
|
||||
}
|
||||
|
||||
@@ -185,25 +174,6 @@ static int versionFromPlatformString(const QString &string, bool *ok = nullptr)
|
||||
return match.hasMatch() ? match.captured(1).toInt(ok) : -1;
|
||||
}
|
||||
|
||||
static QString abiFromCompilerTarget(const QString &string)
|
||||
{
|
||||
const QStringList components = string.split("-");
|
||||
if (components.isEmpty())
|
||||
return {};
|
||||
|
||||
QString qtAbi;
|
||||
const QString compilerAbi = components.first();
|
||||
if (compilerAbi == Constants::AArch64ToolsDisplayName)
|
||||
qtAbi = ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A;
|
||||
else if (compilerAbi == Constants::ArmV7ToolsDisplayName)
|
||||
qtAbi = ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A;
|
||||
else if (compilerAbi == Constants::X86_64ToolsDisplayName)
|
||||
qtAbi = ProjectExplorer::Constants::ANDROID_ABI_X86_64;
|
||||
else if (compilerAbi == Constants::X86ToolsDisplayName)
|
||||
qtAbi = ProjectExplorer::Constants::ANDROID_ABI_X86;
|
||||
return qtAbi;
|
||||
}
|
||||
|
||||
AndroidQtVersion::BuiltWith AndroidQtVersion::parseBuiltWith(const QByteArray &modulesCoreJsonData,
|
||||
bool *ok)
|
||||
{
|
||||
@@ -223,10 +193,6 @@ AndroidQtVersion::BuiltWith AndroidQtVersion::parseBuiltWith(const QByteArray &m
|
||||
result.ndkVersion = QVersionNumber::fromString(version.toString());
|
||||
}
|
||||
}
|
||||
if (const QJsonValue compilerTarget = builtWith["compiler_target"];
|
||||
!compilerTarget.isUndefined()) {
|
||||
result.androidAbi = abiFromCompilerTarget(compilerTarget.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
|
@@ -35,7 +35,6 @@ public:
|
||||
struct BuiltWith {
|
||||
int apiVersion = -1;
|
||||
QVersionNumber ndkVersion;
|
||||
QString androidAbi;
|
||||
};
|
||||
static BuiltWith parseBuiltWith(const QByteArray &modulesCoreJsonData, bool *ok = nullptr);
|
||||
BuiltWith builtWith(bool *ok = nullptr) const;
|
||||
|
Reference in New Issue
Block a user