dune-release leaves empty files around
I think it would be great if dune-release can be trained to clean up after itself. Sadly, I find lots of empty /tmp/dune-release-*.stderr files around. is there any reason for this?
Hmm, that's strange, we use Bos.OS.File.tmp: https://github.com/tarides/dune-release/blob/2ca40e3638bf1ec7b0224d5e8e18893be748390a/lib/sos.ml#L106 and according to its documentation
The file is deleted at the end of program execution using a Stdlib.at_exit handler.
So it could be that dune-release crashes somehow so the at_exit handlers aren't called?
However I'm not much of a fan of this approach anyway, so maybe switching to with_tmp_output or with_tmp_oc is a cleaner alternative as the removal happens closer to the code that's creating it.
I could verify with strace that unlink is called correctly and I couldn't reproduce. I would say it's an issue in bos.
maybe switching to with_tmp_output or with_tmp_oc is a cleaner alternative
unfortunately, it's not possible to use the return value of these helpers with ~err, so I think File.tmp is the best we can use with bos.