[Nix-dev] Understanding the Binary Cache

Roger Qiu roger.qiu at matrix.ai
Thu Mar 3 08:56:07 CET 2016


Hello everybody,

There's a note on the wiki that says:

 > Note: When you ask Nix to install a package, it will first try to get 
it in pre-compiled form from a binary cache. By default, Nix will use 
the binary cache https://cache.nixos.org; it contains binaries for most 
packages in Nixpkgs. Only if no binary is available in the binary cache, 
Nix will build the package from source. So if nix-env -i subversion 
results in Nix building stuff from source, then either the package is 
not built for your platform by the Nixpkgs build servers, or your 
version of Nixpkgs is too old or too new. For instance, if you have a 
very recent checkout of Nixpkgs, then the Nixpkgs build servers may not 
have had a chance to build everything and upload the resulting binaries 
to https://cache.nixos.org. The Nixpkgs channel is only updated after 
all binaries have been uploaded to the cache, so if you stick to the 
Nixpkgs channel (rather than using a Git checkout of the Nixpkgs tree), 
you will get binaries for most packages.
 > http://nixos.org/nix/manual/

Now the last statement says:

 > The Nixpkgs channel is only updated after all binaries have been 
uploaded to the cache, so if you stick to the Nixpkgs channel (rather 
than using a Git checkout of the Nixpkgs tree), you will get binaries 
for most packages.

I am just trying to understand this. If this is true, then why is it 
that when I sometimes try to install packages, the installation process 
fails because the upstream URL is not responding. This has happened 
several times on 15.09 with different kinds of packages like Sage,  
packages from Freedesktop.org... etc.

I understand that there are certain packages that always need to be 
built from source like the nvidia binary blob. But those above packages 
shouldn't have problem right?

Anyway I'm looking for a way to find what binaries are actually 
available in the binary cache ahead of time, and compare them between 
the main channels and the small versions. I've looked around and I can't 
find anything that actually states the binaries available in small 
channels versus the main channels.

Can anybody clarify this?

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975



More information about the nix-dev mailing list