nix copy --no-recursive
: cannot add to the binary cache because the reference is not valid
#12835
Labels
Describe the bug
I am trying to copy incomplete closures to a binary cache.
In my specific case, the reason is because I want to copy to a temporary directory, then use a different tool (
gcloud
) to actually copy the files into the bucket. In order to save on unnecessary disk IO and nar serialization/compression overhead, I don't want to copy the recursive closure. Instead, i want to copy only the specific paths which I know are missing from the remote destination.(getting off topic, but you might ask: why not just use S3 compatibility mode? the answer is, we do, but the way GCS HMAC tokens work really sucks if you care about security, so I'm trying to cut our dependency on writable HMAC tokens).
So the flow I was hoping for:
nix copy --no-recursive --to file:///tmp/binary-cache/ some/path
gcloud
CLIAnother possible use case is a implementing a cachix-like mechanism to filter out paths already in public cache (tho I'm not a huge fan of that, feels like freeloading to me).
All of this is pretty easy to script with a little
nix path-info
andjq
, except that copying incomplete closures fails.Steps To Reproduce
Expected behavior
If
--no-recursive
is specified and the target store is a binary cache, do not check that references are valid.For other types of stores, allowing this might not make sense (e.g. a local store maintains a DB of valid paths, and I can't think of a circumstance where it is okay to violate the store integrity.)
Metadata
Additional context
Checklist
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: