twoliter
twoliter copied to clipboard
twoliter build variant creates a random directory in the project
Description
twoliter build variant creates a directory with a name like .tmpERPdi in the root of the project directory. It shouldn't.
Definition of Done
twoliter build variant no longer creates a random directory in the root of the project.
I could not reproduce this on AL2 with Twoliter version v0.1.0. Was there a specific configuration you used?
This issue is probably reproducible on every variant (tested on 1) as during a build when SIGINT or SIGSTP (or SIGTERM) is called on the build process in a linux host, temp files are not cleared. This is expected behavior as per https://docs.rs/tempfile/latest/tempfile/struct.TempDir.html#resource-leaking as the destructors are never called. The build.rs where these files are created are here.
The solution specific to the SIGINT (or SIGTERM OR SIGSTP) signals, I see is to listen to signals and then perform deletion of the tempdir as required. In general cases, when "build_temp_dir" goes out of scope the files will be deleted. It goes out of scope once, run() goes out of scope, so cleanup if guaranteed for stable cases.
I think the better solution is to put the directory into /tmp so that it doesn't clutter the workspace if it doesn't get cleaned up.
This was fixed by #286