twoliter icon indicating copy to clipboard operation
twoliter copied to clipboard

twoliter build variant creates a random directory in the project

Open webern opened this issue 1 year ago • 3 comments

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.

webern avatar Mar 26 '24 00:03 webern

I could not reproduce this on AL2 with Twoliter version v0.1.0. Was there a specific configuration you used?

sumukhballal avatar Apr 19 '24 00:04 sumukhballal

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.

sumukhballal avatar May 07 '24 17:05 sumukhballal

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.

webern avatar May 07 '24 17:05 webern

This was fixed by #286

webern avatar Jun 13 '24 21:06 webern