about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
AgeCommit message (Collapse)AuthorFilesLines
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-6/+3
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Merge branch 'rework-options' of https://github.com/copumpkin/nixEelco Dolstra1-5/+4
2017-04-13 Add a Config class to simplify adding configuration settingsEelco Dolstra1-3/+6
The typical use is to inherit Config and add Setting<T> members: class MyClass : private Config { Setting<int> foo{this, 123, "foo", "the number of foos to use"}; Setting<std::string> bar{this, "blabla", "bar", "the name of the bar"}; MyClass() : Config(readConfigFile("/etc/my-app.conf")) { std::cout << foo << "\n"; // will print 123 unless overriden } }; Currently, this is used by Store and its subclasses for store parameters. You now get a warning if you specify a non-existant store parameter in a store URI.
2017-04-10 Allow "auto" as a store URIEelco Dolstra1-1/+1
Using the empty string is likely to be ambiguous in some contexts.
2017-04-06 nix-daemon: Disable path info cacheEelco Dolstra1-0/+1
This is useless because the client also caches path info, and can cause problems for long-running clients like hydra-queue-runner (i.e. it may return cached info about paths that have been garbage-collected).
2017-03-21 Only use cache.nixos.org when the store is /nix/storeEelco Dolstra1-1/+5
This is consistent with the behaviour of the old download-from-binary-cache substituter.
2017-03-21 Restore cache.nixos.org as the default substituterEelco Dolstra1-4/+1
Fixes #1283.
2017-03-16 copyPaths(): Use queryValidPaths() to reduce SSH latencyEelco Dolstra1-23/+12
2017-03-16 copyPaths(): Don't query path info for a path the target already hasEelco Dolstra1-0/+1
For example, this cuts "nix-copy-closure --from" on a NixOS system closure from 15.9s to 0.5s.
2017-03-03 build-remote: Don't use a SSH masterEelco Dolstra1-0/+4
This is unnecessary because we make only one connection.
2017-02-22 Explicitly model all settings and fail on unrecognized onesDan Peebles1-3/+3
Previously, the Settings class allowed other code to query for string properties, which led to a proliferation of code all over the place making up new options without any sort of central registry of valid options. This commit pulls all those options back into the central Settings class and removes the public get() methods, to discourage future abuses like that. Furthermore, because we know the full set of options ahead of time, we now fail loudly if someone enters an unrecognized option, thus preventing subtle typos. With some template fun, we could probably also dump the full set of options (with documentation, defaults, etc.) to the command line, but I'm not doing that yet here.
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.