[Nix-dev] garbage collection and nix-push

Eelco Dolstra eelco.dolstra at logicblox.com
Thu Oct 18 16:36:39 CEST 2012


Hi,

On 03/10/12 10:19, Mathijs Kwik wrote:

>> I think nix-push should just check whether a narinfo/nar for a given store path
>> already exist in the output directory, and if so, refrain from rebuilding them.

I've implemented this now: nix-push checks whether the destination directory
already contains a narinfo+nar file, and if so, doesn't build it.

> Won't help me.
> 
> I start out with an (versioned) empty output dir every time so that
> won't help me much.
> I have a post-push script that then hard links the outputs into my
> main binary-cache.

What you should probably do is push to the main binary cache directory, and put
just the manifest in a separate directory, like this:

$ nix-push --dest /tmp/cache --manifest-path /tmp/release-123/MANIFEST PATHS...

For cleanup, there is a script that compares a directory containing NARs against
a set of manifests and prints out the "dead" paths so that they can be deleted:

  https://nixos.org/repos/nix/release/trunk/channels/print-dead-files.pl

However, this script needs to be updated to deal with the new binary caches
properly (e.g. it doesn't delete .narinfo files).

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list