D17289: KDevelop/Shell: set dedicated TMPDIR

Pino Toscano noreply at phabricator.kde.org
Sun Mar 17 11:56:12 GMT 2019


pino added a comment.


  In D17289#432577 <https://phabricator.kde.org/D17289#432577>, @rjvbb wrote:
  
  > > no need for making it "deterministic" in any way. There is no benefit in doing that.
  >
  > I think there is so, it's the whole point of this PR.
  
  
  Not really: it says that a temporary directory for every kdevelop instance is created, making sure it is used also indirectly (e.g. when not using Qt), so that temporary files created by clang are stored there (and thus automatically cleaned at exit).
  There is simply nothing that requires the user ID to be part of the name, nor the session UUID, nor even the "kdevelop" string FWIW (I suggested there mostly to help identifying it).
  
  All this PR ought to do is something along the lines of
  
    QTemporaryDir tempDir(QDir::tempPath() + "/kdevelop.XXXXXX");
    if (!tempDir.isValid()) { /* complain, fall back, whatever */ }
    qputenv("TEMP", QFile::encodeName(tempDir.path()));
    qputenv("TMP", QFile::encodeName(tempDir.path()));
  
  - short name as it can be, still recognizable
  - automatically cleaned at exit
  - with the right permissions to restrict it to the current user only
  
  ... and that's it. (Of course, with the QTemporaryDir object as CorePrivate class member.)
  Doing this also on Windows should be good anyway: if `TMPDIR` and `TMP` are used, then the QTemporaryDir will be used; otherwise, it will be just an empty temporary directory.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D17289

To: rjvbb, #kdevelop, kfunk, mwolff, pino
Cc: aaronpuchert, mwolff, pino, kfunk, kdevelop-devel, gennad, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190317/97b9cd22/attachment.html>


More information about the KDevelop-devel mailing list