You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustc has a -Csave-temps option that is intended for debugging (or other cases where temporary file access is useful).
We used to have code like this, but it behaved incorrectly in the presence of panics in the intermediary code. It would be nice to have a boolean flag on the builder that would let us do something like .cleanup(opts.save_temps) and that would create a TempDir which doesn't delete itself on Drop.
For now we've implemented this in rustc itself atop TempDir, but upstreaming it would be more convenient API wise.
let tmpdir = ...;// a bunch of code runs, using tmpdirif opts.save_temps{let _ = tmpdir.into_path();}
The text was updated successfully, but these errors were encountered:
As a comment (and a bump on this), it might be instructive to look at Prof. Adrian Sampson's implementation of a temporary directory (calyxir/calyx#2072); I had originally used a TempDir, but as no "keep directory" option was available, he opted to create a new abstraction for it.
rustc has a
-Csave-temps
option that is intended for debugging (or other cases where temporary file access is useful).We used to have code like this, but it behaved incorrectly in the presence of panics in the intermediary code. It would be nice to have a boolean flag on the builder that would let us do something like
.cleanup(opts.save_temps)
and that would create a TempDir which doesn't delete itself on Drop.For now we've implemented this in rustc itself atop TempDir, but upstreaming it would be more convenient API wise.
The text was updated successfully, but these errors were encountered: