Open vaibhavsagar opened 5 years ago
For reference, I think this was fixed in https://github.com/NixOS/nix/commit/bba3f0a308cceb56bad4aa1efe13927360ae463f
@matthewbauer That commit is labelled as being in nix 2.2.2, which I'm using, and I still encounter this problem. Even when passing --fallback
(which I don't really want to use all the time anyway, for the same reason --fallback
isn't the default; I'd like an error rather than fall back to build-from-source if all of the binary caches aren't available).
My use case is using machines nix machines on a local network as build caches for each other using nix-server
. Sometimes some of them are powered off, or I take a laptop roaming to a different network. I'd like a configuration where if any of my machines are reachable and have the thing I'm building then I copy it from there, and otherwise transparently fall back to cache.nixos.org, without having to change my configuration or use different commands based on which caches I think are available. This seems to be impossible at the moment.
No I was mistaken; adding --fallback
does works. It's still not great for my purposes, since it spends about 30 seconds retrying each cache before moving on to the next one.
What I'd really like is to be able to distinguish, in the configuration, between caches that are to be opportunistically used if available and ones that must be available (like cache.nixos.org). I'd then expect the --fallback
to essentially treat all binary caches as opportunistic ones, allowing build-from-source even if the usually-required ones are offline.
The current implementation intention seems to be that all binary caches are required to be available, and I should use --fallback
if I want to tolerate a rare unavailability. It's not great for caches when unavailability is common and expected.
I marked this as stale due to inactivity. → More info
This is still an issue.
I marked this as stale due to inactivity. → More info
I have >1 binary cache configured, and if any one of them is down my builds fail, e.g.
I think Nix should try each cache sequentially before failing.