Skip to content

Improve management of temporary files #3432

@ghost

Description

In src/dune/process.ml, we have a Temp sub-module for dealing with temporary files. This module ensures that all temporary files are systematically deleted on exit. It would be nice to extract and generalise this module. We could also go a bit further and:

  • create a single temporary directory to store all temporary files
  • systematically delete this directory when dune exists, normally or abnormally
  • set the TEMP environment variable to point to this directory so that commands started by dune put their temporary files there
  • clear the contents of this directory at the end of each run in polling mode, so that if some commands don't properly clean up their temporary files we don't leak them

We actually do something quite similar in Jenga.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for contributing for the first time to the Dune codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions