about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
AgeCommit message (Collapse)AuthorFilesLines
2017-02-22 RemoteStore::addToStore(): Pass content-addressability assertionEelco Dolstra1-0/+6
... and use this in Downloader::downloadCached(). This fixes $ nix-build https://nixos.org/channels/nixos-16.09-small/nixexprs.tar.xz -A hello error: cannot import path ‘/nix/store/csfbp1s60dkgmk9f8g0zk0mwb7hzgabd-nixexprs.tar.xz’ because it lacks a valid signature
2017-02-07 Merge branch 'nix-copy-closure-c++' of https://github.com/shlevy/nixEelco Dolstra1-2/+22
2017-02-07 copyStorePath(): Don't require signatures for "trusted" storesEelco Dolstra1-0/+9
For example, SSH stores could be trusted.
2017-02-07 Provide default implementations for a couple of Store methodsEelco Dolstra1-0/+13
2017-01-26 exportReferencesGraph: Export more complete info in JSON formatEelco Dolstra1-0/+59
This writes info about every path in the closure in the same format as ‘nix path-info --json’. Thus it also includes NAR hashes and sizes. Example: [ { "path": "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "narHash": "sha256:0ckdc4z20kkmpqdilx0wl6cricxv90lh85xpv2qljppcmz6vzcxl", "narSize": 197648, "references": [ "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20939776 }, { "path": "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24", "narHash": "sha256:1nfn3m3p98y1c0kd0brp80dn9n5mycwgrk183j17rajya0h7gax3", "narSize": 20742128, "references": [ "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20742128 } ] Fixes #1134.
2017-01-20 nix-copy-closure: Implement in C++.Shea Levy1-2/+22
Tests fail currently because the database is not given proper hashes in the VM
2016-11-10 build-remote: Implement in C++Shea Levy1-0/+33
2016-11-09 copyClosure() / copyStorePath(): Expose dontCheckSigsEelco Dolstra1-4/+4
Needed by Hydra.
2016-11-09 Merge branch 'ssh-store' of https://github.com/shlevy/nixEelco Dolstra1-23/+24
2016-10-21 BinaryCacheStore: Optionally write a NAR listingEelco Dolstra1-1/+1
The store parameter "write-nar-listing=1" will cause BinaryCacheStore to write a file ‘<store-hash>.ls.xz’ for each ‘<store-hash>.narinfo’ added to the binary cache. This file contains an XZ-compressed JSON file describing the contents of the NAR, excluding the contents of regular files. E.g. { "version": 1, "root": { "type": "directory", "entries": { "lib": { "type": "directory", "entries": { "Mcrt1.o": { "type": "regular", "size": 1288 }, "Scrt1.o": { "type": "regular", "size": 3920 }, } } } ... } } (The actual file has no indentation.) This is intended to speed up the NixOS channels programs index generator [1], since fetching gazillions of large NARs from cache.nixos.org is currently a bottleneck for updating the regular (non-small) channel. [1] https://github.com/NixOS/nixos-channel-scripts/blob/master/generate-programs-index.cc
2016-10-07 Store::queryValidPaths(): Use async queryPathInfo()Eelco Dolstra1-4/+39
This allows the binary cache substituter to pipeline requests.
2016-10-07 Implement generic Store::queryValidPaths()Eelco Dolstra1-0/+11
2016-10-07 Add copyClosure utility function for HydraEelco Dolstra1-0/+24
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-1/+1
2016-09-16 Make computeFSClosure() single-threaded againEelco Dolstra1-34/+64
The fact that queryPathInfo() is synchronous meant that we needed a thread for every concurrent binary cache lookup, even though they end up being handled by the same download thread. Requiring hundreds of threads is not a good idea. So now there is an asynchronous version of queryPathInfo() that takes a callback function to process the result. Similarly, enqueueDownload() now takes a callback rather than returning a future. Thus, a command like nix path-info --store https://cache.nixos.org/ -r /nix/store/slljrzwmpygy1daay14kjszsr9xix063-nixos-16.09beta231.dccf8c5 that returns 4941 paths now takes 1.87s using only 2 threads (the main thread and the downloader thread). (This is with a prewarmed CloudFront.)
2016-09-02 Factor out the unix domain socket-specific code from RemoteStoreShea Levy1-1/+1
2016-09-02 Factor a function to get the store type from a URI out of the main ↵Shea Levy1-18/+25
RegisterStoreImplementation
2016-09-02 Merge openStore and openStoreAt with default argumentsShea Levy1-8/+2
2016-08-10 Mark content-addressed paths in the Nix database and in .narinfoEelco Dolstra1-12/+48
This allows such paths to be imported without signatures.
2016-07-26 makeFixedOutputPath(): Drop superfluous HashType argumentEelco Dolstra1-6/+5
2016-06-20 Re-implement negative binary cache lookup cachingEelco Dolstra1-3/+7
2016-06-02 Allow setting the state directory as a store parameterEelco Dolstra1-2/+3
E.g. "local?store=/tmp/store&state=/tmp/var".
2016-06-01 Make the store directory a member variable of StoreEelco Dolstra1-33/+38
2016-05-30 Fix repair during substitutionEelco Dolstra1-2/+2
2016-05-04 Add a Store::addToStore() variant that accepts a NAREelco Dolstra1-13/+2
As a side effect, this ensures that signatures are propagated when copying paths between stores. Also refactored import/export to make use of this.
2016-05-04 Remove OpenSSL-based signingEelco Dolstra1-5/+4
2016-05-04 Add a copyStorePath() utility functionEelco Dolstra1-0/+13
2016-04-29 Allow parameters in store URIsEelco Dolstra1-3/+18
This is to allow store-specific configuration, e.g. s3://my-cache?compression=bzip2&secret-key=/path/to/key.
2016-04-29 Eliminate the substituter mechanismEelco Dolstra1-0/+35
Substitution is now simply a Store -> Store copy operation, most typically from BinaryCacheStore to LocalStore.
2016-04-21 Fix test failuresEelco Dolstra1-0/+1
2016-04-21 Implement S3BinaryCacheStore::queryAllValidPaths()Eelco Dolstra1-11/+23
This allows commands like "nix verify --all" or "nix path-info --all" to work on S3 caches. Unfortunately, this requires some ugly hackery: when querying the contents of the bucket, we don't want to have to read every .narinfo file. But the S3 bucket keys only include the hash part of each store path, not the name part. So as a special exception queryAllValidPaths() can now return store paths *without* the name part, and queryPathInfo() accepts such store paths (returning a ValidPathInfo object containing the full name).
2016-04-20 Cache path info lookups in SQLiteEelco Dolstra1-2/+48
This re-implements the binary cache database in C++, allowing it to be used by other Store backends, in particular the S3 backend.
2016-04-19 Move path info caching from BinaryCacheStore to StoreEelco Dolstra1-9/+53
Caching path info is generally useful. For instance, it speeds up "nix path-info -rS /run/current-system" (i.e. showing the closure sizes of all paths in the closure of the current system) from 5.6s to 0.15s. This also eliminates some APIs like Store::queryDeriver() and Store::queryReferences().
2016-04-07 nix verify-paths: Add ‘--sigs-needed <N>’ flagEelco Dolstra1-1/+7
This specifies the number of distinct signatures required to consider each path "trusted". Also renamed ‘--no-sigs’ to ‘--no-trust’ for the flag that disables verifying whether a path is trusted (since a path can also be trusted if it has no signatures, but was built locally).
2016-04-05 Add "nix sign-paths" commandEelco Dolstra1-0/+3
E.g. $ nix sign-paths -k ./secret -r $(type -p geeqie) signs geeqie and all its dependencies using the key in ./secret.
2016-03-24 Move signature support from NarInfo to ValidPathInfoEelco Dolstra1-1/+28
2016-03-24 TyposEelco Dolstra1-2/+2
2016-02-29 Make store implementations pluggableEelco Dolstra1-19/+24
This for instance allows hydra-queue-runner to add the S3 backend at runtime.
2016-02-25 Add NAR / Store accessor abstractionEelco Dolstra1-1/+3
This is primary to allow hydra-queue-runner to extract files like "nix-support/hydra-build-products" from NARs in binary caches.
2016-02-24 Eliminate reserveSpace flagEelco Dolstra1-4/+4
2016-02-24 openStoreAt(): Initialise the binary cacheEelco Dolstra1-1/+3
2016-02-24 Move BinaryCacheStore / LocalBinaryCacheStore from HydraEelco Dolstra1-3/+15
So you can now do: $ NIX_REMOTE=file:///tmp/binary-cache nix-store -qR /nix/store/...
2016-02-16 Rename ValidPathInfo::hash -> narHash for consistencyEelco Dolstra1-2/+2
2016-02-15 Expose the export magic value and move LocalStore::queryReferences to StoreEelco Dolstra1-0/+7
2016-02-15 Add function to extract hash part of a store pathEelco Dolstra1-1/+8
2016-02-11 ref<T>: Add cast operatorEelco Dolstra1-2/+2
2016-02-04 StoreAPI -> StoreEelco Dolstra1-5/+5
Calling a class an API is a bit redundant...
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-8/+5
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)
2016-01-31 Use the daemon when we don't have write access to the Nix databaseEelco Dolstra1-4/+16
2015-08-21 nix-collect-garbage: Revive --max-freedEelco Dolstra1-10/+0
Fixes #609.