ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.64k stars 409 forks source link

Dune cache does not restore empty directories. #11117

Open mefyl opened 1 week ago

mefyl commented 1 week ago

Issue

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.

Reproduction

ejgallego commented 1 week ago

Could this be related to #10931 ?