Fix make_temp: revert fallback to working_directory
This pull request fixes an issue introduced by a recent commit that changed the temporary file creation behavior in make_temp
Previously, make_temp used self.working_directory and a default prefix of 'devlib-test', which provided the necessary permissions for temporary file cleanup. The change to using self.tmp_directory caused permission errors during cleanup and consequently breakages.
This PR reverts the change by:
- Setting the default prefix to 'devlib-test'
- Reverting the fallback directory from self.tmp_directory back to self.working_directory
Instead of reverting that change, as tmp_directory's only purpose is to be the root of temporary locations, could you give a go at fixing the logic that computes a sane default for it ?
In particular:
https://github.com/ARM-software/devlib/blob/b9f2384a8b0bb81413a99bfbbb36949807991a08/devlib/target.py#L2633
Also if you can share details on your setup, the specific paths involved and the specific error you encounter that would be useful. AFAICT tmp_directory can only be derived from the following sources:
- User-given. I assume it's not what is happening
- From
mktemp -dcall. If that returns a folder that is not writeable (which I assume is the problem ?) your platform is pretty broken and you may need to set TMPDIR manually in some shell configuration file. -
/data/local/tmp, which AFAIR is an ok location on android (or used to be) - From
working_directory, which I assume is not the case considering your report.