Thanks! I was just looking at it but I still couldn’t find a way in there to do the regular directory traversal that filterSource does, but only creating a directory once we’re about to put an actual (not filtered-out) file inside, in order to not update hashes and cause recompilations based on unrelated directories.
It does look like something that I’m very likely not the first to need and should consequently already exist in Nix…
Is there such a thing?
EDIT: Ah this post seems to suggest that maybe lib.fileset by default does filter empty directories? Does this mean then that #8820 (that you opened!) is out of date?