From 5de7f4fe19997a636d4128fe1e27b06a7bc72fd3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 23 Jan 2025 18:29:33 -0800 Subject: [PATCH] Bootstrap: disable QFile::copy() due to lack of QTemporaryFile Without QTemporaryFile, QFile::copy() creates a file with a fixed name in the destination directory, meaning that it would step over another thread or process trying to copy at the same time. That's dangerous for buildsystem tools, given the prevalence of ninja -j / make -j executions. Nothing in the bootstrapped tools uses this function right now. This commit will simply ensure nothing begins doing it in the future. Change-Id: Icdcf51fa5d94618d622afffd94d1263cf9df181a Reviewed-by: Ahmad Samir --- src/corelib/io/qfile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 2a1484e1120..89a270d2c8c 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -778,6 +778,7 @@ QFile::link(const QString &fileName, const QString &linkName) return QFile(fileName).link(linkName); } +#ifndef QT_BOOTSTRAPPED // dangerous without QTemporaryFile /*! Copies the file named fileName() to \a newName. @@ -913,6 +914,7 @@ QFile::copy(const QString &fileName, const QString &newName) { return QFile(fileName).copy(newName); } +#endif // QT_BOOTSTRAPPED /*! Opens the file using \a mode flags, returning \c true if successful;