Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune-release leaves empty files around #462

Open
hannesm opened this issue Mar 26, 2023 · 2 comments
Open

dune-release leaves empty files around #462

hannesm opened this issue Mar 26, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hannesm
Copy link
Contributor

hannesm commented Mar 26, 2023

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?

@Leonidas-from-XIV
Copy link
Member

Hmm, that's strange, we use Bos.OS.File.tmp:

OS.File.tmp "dune-release-%s.stderr" >>= fun tmp_file ->
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.

@Leonidas-from-XIV Leonidas-from-XIV added bug Something isn't working good first issue Good for newcomers labels Mar 30, 2023
@emillon
Copy link
Collaborator

emillon commented Apr 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants