feat: skip small files (<5KB)
Totally arbitrary limit. Never programmed Rust so I have no idea if this work. Can't build it locally even using the nix from the flake.
Fixes https://github.com/DeterminateSystems/magic-nix-cache-action/issues/31 ?
Thanks for the PR! I'll tag in @edolstra to see if this makes sense with the invariants of caches. One thing to note is this is really a proxy for how long the build takes, which is a bit more important.
I'd be happy to test this ~locally~ in my project but I'm not sure how. I tried to use source-pr but it can't find the binary--I'm assuming it didn't get built because I'm unknown on this project? See https://github.com/hraban/cl-nix-lite/actions/runs/9185180443/job/25258704165
I was able to build this on aarch64-darwin and x86_64-darwin using nix run https://flakehub.com/f/NixOS/nix/2.20.tar.gz -- build.
One thing to note is this is really a proxy for how long the build takes, which is a bit more important.
I've added this as a comment.
@hraban I've added the upload to s3 label which will enable you to use source-pr (though you will need to ~~push another change here and~~ wait until the upload is complete, which takes a few minutes).
EDIT: actually no, that label only works that way for PRs opened in our org, so source-pr will not be available here.
This seems like a solid solution, it would eliminate more than half the cache entries i get for my project and allow more use of actually useful cached items.
Maybe one thing is you could have the size limit able to be customised through an env variable during launch, eg (NAR_SIZE_LIMIT=2000) if a user finds that their project has a weird outlier that takes a while to create but the result is still small.