diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2022-11-01 16:09:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-01 16:09:35 +0100 |
commit | fad5f168d2bd77ca6439533750895525d1729f65 (patch) | |
tree | c21b04bae53d0d9eaeddaba1b87fa7a5d93182f7 /pkgs/development/libraries | |
parent | 4fe74d52577b829fc43d13f609d945afdcb8d0fc (diff) | |
parent | 04706f6b127d7f48044269f4c985a88870d3006e (diff) | |
download | nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar.gz nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar.bz2 nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar.lz nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar.xz nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.tar.zst nixpkgs-fad5f168d2bd77ca6439533750895525d1729f65.zip |
Merge pull request #197010 from tpwrules/disable-qt-cache
Diffstat (limited to 'pkgs/development/libraries')
8 files changed, 98 insertions, 3 deletions
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index 5d7b7202945..a93c2b67d43 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -81,7 +81,11 @@ let sha256 = "0crkw3j1iwdc1pbf5dhar0b4q3h5gs2q1sika8m12y02yk3ns697"; }) ]; - qtdeclarative = [ ./qtdeclarative.patch ]; + qtdeclarative = [ + ./qtdeclarative.patch + # prevent headaches from stale qmlcache data + ./qtdeclarative-default-disable-qmlcache.patch + ]; qtlocation = [ ./qtlocation-gcc-9.patch ]; qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; diff --git a/pkgs/development/libraries/qt-5/5.12/qtdeclarative-default-disable-qmlcache.patch b/pkgs/development/libraries/qt-5/5.12/qtdeclarative-default-disable-qmlcache.patch new file mode 100644 index 00000000000..e9c3b7e2284 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.12/qtdeclarative-default-disable-qmlcache.patch @@ -0,0 +1,40 @@ +diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp +index 9e5bc0b0..9219def6 100644 +--- a/src/qml/qml/qqmltypeloader.cpp ++++ b/src/qml/qml/qqmltypeloader.cpp +@@ -2151,7 +2151,7 @@ void QQmlTypeData::unregisterCallback(TypeDataCallback *callback) + + bool QQmlTypeData::tryLoadFromDiskCache() + { +- if (disableDiskCache() && !forceDiskCache()) ++ if (!forceDiskCache()) + return false; + + if (isDebugging()) +@@ -2658,7 +2658,7 @@ void QQmlTypeData::compile(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCach + return; + } + +- const bool trySaveToDisk = (!disableDiskCache() || forceDiskCache()) && !m_document->jsModule.debugMode && !typeRecompilation; ++ const bool trySaveToDisk = (forceDiskCache()) && !m_document->jsModule.debugMode && !typeRecompilation; + if (trySaveToDisk) { + QString errorString; + if (m_compiledData->saveToDisk(url(), &errorString)) { +@@ -3014,7 +3014,7 @@ QQmlRefPointer<QQmlScriptData> QQmlScriptBlob::scriptData() const + + void QQmlScriptBlob::dataReceived(const SourceCodeData &data) + { +- if (!disableDiskCache() || forceDiskCache()) { ++ if (forceDiskCache()) { + QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QV4::Compiler::Codegen::createUnitForLoading(); + QString error; + if (unit->loadFromDisk(url(), data.sourceTimeStamp(), &error)) { +@@ -3077,7 +3077,7 @@ void QQmlScriptBlob::dataReceived(const SourceCodeData &data) + qmlGenerator.generate(irUnit); + } + +- if ((!disableDiskCache() || forceDiskCache()) && !isDebugging()) { ++ if ((forceDiskCache()) && !isDebugging()) { + QString errorString; + if (unit->saveToDisk(url(), &errorString)) { + QString error; diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix index 32630810b49..808562772f9 100644 --- a/pkgs/development/libraries/qt-5/5.14/default.nix +++ b/pkgs/development/libraries/qt-5/5.14/default.nix @@ -68,7 +68,11 @@ let ./qtbase.patch.d/0010-qtbase-assert.patch ./qtbase.patch.d/0011-fix-header_module.patch ]; - qtdeclarative = [ ./qtdeclarative.patch ]; + qtdeclarative = [ + ./qtdeclarative.patch + # prevent headaches from stale qmlcache data + ./qtdeclarative-default-disable-qmlcache.patch + ]; qtlocation = [ ./qtlocation-gcc-9.patch ]; qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; diff --git a/pkgs/development/libraries/qt-5/5.14/qtdeclarative-default-disable-qmlcache.patch b/pkgs/development/libraries/qt-5/5.14/qtdeclarative-default-disable-qmlcache.patch new file mode 100644 index 00000000000..8ef5ef53dea --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.14/qtdeclarative-default-disable-qmlcache.patch @@ -0,0 +1,13 @@ +diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp +index 6c12de92..fc67dc07 100644 +--- a/src/qml/qml/qqmltypeloader.cpp ++++ b/src/qml/qml/qqmltypeloader.cpp +@@ -705,7 +705,7 @@ bool QQmlTypeLoader::Blob::isDebugging() const + + bool QQmlTypeLoader::Blob::diskCacheEnabled() const + { +- return (!disableDiskCache() || forceDiskCache()) && !isDebugging(); ++ return (forceDiskCache()) && !isDebugging(); + } + + bool QQmlTypeLoader::Blob::qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &data, QList<QQmlError> *errors) diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index e3f94ba8ffe..616bf22ff13 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -56,7 +56,11 @@ let ./qtbase.patch.d/0010-qtbase-assert.patch ./qtbase.patch.d/0011-fix-header_module.patch ]; - qtdeclarative = [ ./qtdeclarative.patch ]; + qtdeclarative = [ + ./qtdeclarative.patch + # prevent headaches from stale qmlcache data + ./qtdeclarative-default-disable-qmlcache.patch + ]; qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; qtwebengine = lib.optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/qt-5/5.15/qtdeclarative-default-disable-qmlcache.patch b/pkgs/development/libraries/qt-5/5.15/qtdeclarative-default-disable-qmlcache.patch new file mode 100644 index 00000000000..03668d960c7 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.15/qtdeclarative-default-disable-qmlcache.patch @@ -0,0 +1,13 @@ +diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp +index 1d66e75..827567a 100644 +--- a/src/qml/qml/qqmltypeloader.cpp ++++ b/src/qml/qml/qqmltypeloader.cpp +@@ -727,7 +727,7 @@ bool QQmlTypeLoader::Blob::isDebugging() const + + bool QQmlTypeLoader::Blob::diskCacheEnabled() const + { +- return (!disableDiskCache() && !isDebugging()) || forceDiskCache(); ++ return forceDiskCache(); + } + + bool QQmlTypeLoader::Blob::qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &data, QList<QQmlError> *errors) diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix index c8abc71a223..76231f866ef 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix @@ -16,6 +16,10 @@ qtModule { "-DQT6_INSTALL_PREFIX=${placeholder "out"}" "-DQT_INSTALL_PREFIX=${placeholder "out"}" ]; + patches = [ + # prevent headaches from stale qmlcache data + ../patches/qtdeclarative-default-disable-qmlcache.patch + ]; postInstall = '' substituteInPlace "$out/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake" \ --replace ''\'''${QT6_INSTALL_PREFIX}' "$dev" diff --git a/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch b/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch new file mode 100644 index 00000000000..02e578f2d52 --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch @@ -0,0 +1,13 @@ +diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp +index 852cde9e..165f1b57 100644 +--- a/src/qml/jsruntime/qv4engine.cpp ++++ b/src/qml/jsruntime/qv4engine.cpp +@@ -2093,7 +2093,7 @@ void ExecutionEngine::registerModule(const QString &_name, const QJSValue &modul + + bool ExecutionEngine::diskCacheEnabled() const + { +- return (!disableDiskCache() && !debugger()) || forceDiskCache(); ++ return forceDiskCache(); + } + + void ExecutionEngine::callInContext(QV4::Function *function, QObject *self, |