D17289: KDevelop/Shell: set dedicated TMPDIR
noreply at phabricator.kde.org
Thu Jan 17 22:11:17 GMT 2019
aaronpuchert added a comment.
In D17289#370477 <https://phabricator.kde.org/D17289#370477>, @rjvbb wrote:
> Actually, issues with clang temp files is why I started to think about this kind of change but ultimately I realised it didn't seem such a bad idea at all to put all KDevelop-related temporary files in a dedicated location. I often clean out a bunch of KDevelop's own temp files that were left behind, e.g. after a crash. I just didn't mention them because they're negligible in size (and I purge before their numbers really start to grow).
Temporary files being left behind after a crash is not unusual. This is why systemd has <https://www.freedesktop.org/software/systemd/man/systemd-tmpfiles.html> `systemd-tmpfiles --clean`.
> Files in TMPDIR are usually private, or else their full path is handed to external apps that need to use them (like sockets), no?
Not necessarily: if you open a file from your browser, it's typically stored in `/tmp` and then opened with the associated application.
In D17289#391940 <https://phabricator.kde.org/D17289#391940>, @rjvbb wrote:
> No appliction should let its behaviour depend on where $TMPDIR is, normally, nor should it assume that the value is exclusive. Any app with special TMPDIR requirements should set it itself, not unlike I'm doing here.
The way I see it, it's exactly the other way around. Just like any other environment variable, `TMP_DIR` is there to let a user control an application's behavior. So an application setting that variable for itself is a bit pointless.
I definitely see your point though, and it seems that libclang doesn't allow users to control where the files go except through `TMP_DIR`. It should be possible to reset the `TMP_DIR` for subprocesses started from KDevelop, at least exec <https://linux.die.net/man/3/exec> supports that. So we could set `TMP_DIR` for ourselves (based on the user-provided `TMP_DIR`), but pass the original environment variable to all subprocesses.
To: rjvbb, #kdevelop, kfunk, mwolff
Cc: aaronpuchert, mwolff, pino, kfunk, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel