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

Add failing test pulling empty directory from cache. #11116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mefyl
Copy link
Collaborator

@mefyl mefyl commented Nov 12, 2024

Dune cache does not restore empty directories. On top of not being very nice, this has really bad consequences with caching because dune's rule digest algorithm does take empty directories in account, so restoring a rule from cache will invalidate all dependent rules as the sources hash will have changed.

This is especially painful with the dune pkg feature, as the Ocaml 5.2.0 tarball has an empty flexdll directory at the root, so pulling it from the cache will rebuild absolutely everything.

I suppose the correct behavior is to properly restore empty directories from cache. If not, they probably shouldn't count towards rule digests.

@dra27
Copy link
Member

dra27 commented Nov 13, 2024

FWIW, not handling empty directories I think is generally regarded as a mistake in Git, albeit one that's likely to be lived with forever.

Morally, if a tarball would have extracted an empty directory then so should its cached action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants