Files
nixpkgs/pkgs/development/libraries/qt-6/modules/qtdeclarative/dont-cache-nix-store-paths.patch
2025-10-07 21:23:08 +03:00

18 lines
804 B
Diff

--- a/src/qml/common/qv4compileddata.cpp
+++ b/src/qml/common/qv4compileddata.cpp
@@ -178,6 +178,14 @@ bool CompilationUnit::saveToDisk(const QUrl &unitUrl, QString *errorString)
return false;
}
+ if (unitUrl.path().startsWith(QStringLiteral("@nixStore@"))) {
+ // We don't store bytecode for bare QML files in the nix store as the
+ // paths will change every time the application updates, filling caches
+ // endlessly with junk.
+ *errorString = QStringLiteral("Refusing to save bytecode for bare @nixStore@ path.");
+ return false;
+ }
+
return SaveableUnitPointer(unitData()).saveToDisk<char>(
[&unitUrl, errorString](const char *data, quint32 size) {
const QString cachePath = localCacheFilePath(unitUrl);