How long until an output path "disappears" from nixpkgs cache?

  1. Does that change depending on branch?

  2. Let’s say I have a particular nixpkgs in mind, how would I go about checking how many revisions in the past are still in the cache?

  3. If I’m getting a cache-miss for a particular package how should I go about debugging where the miss is coming from? I could take the derivation from the latest nixpkgs revision and compare to the derivation that gets a cache-miss but I’m curious if there is a better way? Like if there is a convenient access to all derivations that are still cached through hydra’s browser interface so I could get the oldest derivation that is still in the cache and compare it to what I’m getting, for example.


1 Like
  1. No, so far the cache has never been garbage-collected. That makes reasoning about it easy :slight_smile: , though it’s probably not sustainable forever.
  2. ^
  3. A cache miss can have several causes:
    • the path was never built by hydra, e.g. because it’s a result of overrides that aren’t found in nixpkgs or because it’s unfree
    • the path or one of its dependencies failed to build. This can be transient or consistent, but once the logs for hydra’s build attempt have been removed (these aren’t kept forever!) I’m not sure it’s possible to tell.
1 Like

Was never GCed! Really?
Do you happen to know the total size? Or how much available space is left? Just curious!

Yes the reasons you mention are indeed the causes. In some cases it’s easy to spot the reason. But sometimes things deep down inside get changed by something somewhere and it is very hard to understand what is going on.
Of course, I don’t think there is a magical simple way of solving these cases, but if there are tools that could make this easier. I know there’s GitHub - Gabriel439/nix-diff: Explain why two Nix derivations differ for example.
If you happen to know of more tools like this, just to make my toolbox bigger.

1 Like