RFC: Exclude `.lake` directory from backups with `CACHEDIR.TAG`
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Proposal
The .lake/ directory contains remote sources and build artifacts for a project. Hence its contents can be automatically recreated from the rest of the project source. Such directories should be marked with a CACHEDIR.TAG file. This allows automatic backup tools (e.g. Restic, Borg and GNU tar) to ignore the contents of the directory when instructed (e.g. --exclude-caches flag on tar).
The only effect on users should be that their automatic backups may get smaller as the contents of .lake/ directory get excluded. In the rare case that files should be recovered from backups, the user needs to recompile their Lean projects. I would argue that this is a relatively minor inconvenience, and if this is a problem, the user should not have excluded caches from backups in the first place.
Other programming languages are already doing this. For example, Rust is excluding both target/ and ~/.cargo/{git,registry}/ directories.
Community Feedback
The feature was first proposed in the Lean Zulip. It got green light from @semorrison and @tydeu.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the repository entry point that creates or initializes the .lake/ directory; the issue does not name a file or test. Verify how CACHEDIR.TAG should be added there, then confirm that a newly created .lake/ contains the tag and remains usable for rebuilding Lean projects.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100