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 <a.samirh78@gmail.com>
This commit is contained in:
Thiago Macieira 2025-01-23 18:29:33 -08:00
parent 9b006eb91a
commit 5de7f4fe19

View File

@ -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;