From aaadbdb2831fb689d1d12decfdc24725d4d0399a Mon Sep 17 00:00:00 2001 From: "Tom Dewey tom.dewey@raspberrypi.com" Date: Thu, 2 Nov 2023 15:54:12 +0000 Subject: [PATCH] qml: Disable disk cache entirely This is a compromised change. Essentially, I'm working around a poorly-understood failure mode in Qt5, where the disk cache can occasionally fail to invalidate, resulting in stale compiled units being used. This will increase application start times in favour of correctness. --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index b4876ac..3469109 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -140,6 +140,16 @@ int main(int argc, char *argv[]) } QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + + /** QtQuick on QT5 exhibits spurious disk cache failures that cannot be + * resolved by a user in a trivial manner (they have to delete the cache manually). + * + * This flag can potentially noticeably increase the start time of the application, however + * between this and a hard-to-detect spurious failure affecting Linux, macOS and Windows, + * this trade is the one most likely to result in a good experience for the widest group + * of users. + */ + qputenv("QML_DISABLE_DISK_CACHE", "true"); #ifdef Q_OS_WIN // prefer ANGLE (DirectX) over desktop OpenGL QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);