René J.V. Bertin
2018-12-01 19:56:48 UTC
rjvbb created this revision.
rjvbb added a reviewer: KDevelop.
rjvbb added a project: KDevelop.
rjvbb requested review of this revision.
REVISION SUMMARY
This is a simple patch implementing a dedicated KDevelop temporary directory (on Unix). With this, every session has its own directory for temporary files under the default `QSP::TempLocation` directory, set via the `TMPDIR` env. variable. The clang parser's preamble* files go here, for instance, but also any files the session creates under `QSP::TempLocation` itself.
The entire directory is removed during a clean exit, and also at startup. This takes care of preventing the accumulation of (large) old temporary files I tend to get on Mac.
TEST PLAN
Tested on Mac and Linux. Processes launched by KDevelop will also see the new directory as their `TempLocation` but I haven't noticed any unwanted side-effects in my workflow. Processes spawned by the session and outliving it may run into issues but how common are those? (The only such processes I create are other KDevelop sessions which are evidently not concerned.)
Setting TEMPDIR (or TEMP) instead of TMPDIR may have the same on MS Windows(?)
REPOSITORY
R32 KDevelop
REVISION DETAIL
https://phabricator.kde.org/D17289
AFFECTED FILES
kdevplatform/shell/core.cpp
kdevplatform/shell/core_p.h
To: rjvbb, #kdevelop
Cc: kdevelop-devel, glebaccon, hase, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
rjvbb added a reviewer: KDevelop.
rjvbb added a project: KDevelop.
rjvbb requested review of this revision.
REVISION SUMMARY
This is a simple patch implementing a dedicated KDevelop temporary directory (on Unix). With this, every session has its own directory for temporary files under the default `QSP::TempLocation` directory, set via the `TMPDIR` env. variable. The clang parser's preamble* files go here, for instance, but also any files the session creates under `QSP::TempLocation` itself.
The entire directory is removed during a clean exit, and also at startup. This takes care of preventing the accumulation of (large) old temporary files I tend to get on Mac.
TEST PLAN
Tested on Mac and Linux. Processes launched by KDevelop will also see the new directory as their `TempLocation` but I haven't noticed any unwanted side-effects in my workflow. Processes spawned by the session and outliving it may run into issues but how common are those? (The only such processes I create are other KDevelop sessions which are evidently not concerned.)
Setting TEMPDIR (or TEMP) instead of TMPDIR may have the same on MS Windows(?)
REPOSITORY
R32 KDevelop
REVISION DETAIL
https://phabricator.kde.org/D17289
AFFECTED FILES
kdevplatform/shell/core.cpp
kdevplatform/shell/core_p.h
To: rjvbb, #kdevelop
Cc: kdevelop-devel, glebaccon, hase, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd