aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/remote-store.cc
AgeCommit message (Collapse)Author
2016-09-21printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra
2016-09-21Some notational convenience for formatting stringsEelco Dolstra
We can now write throw Error("file '%s' not found", path); instead of throw Error(format("file '%s' not found") % path); and similarly printError("file '%s' not found", path); instead of printMsg(lvlError, format("file '%s' not found") % path);
2016-09-16Make computeFSClosure() single-threaded againEelco Dolstra
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-02Implement nar-based addToStore for remote-storeShea Levy
2016-09-02Factor out the unix domain socket-specific code from RemoteStoreShea Levy
2016-08-10Mark content-addressed paths in the Nix database and in .narinfoEelco Dolstra
This allows such paths to be imported without signatures.
2016-08-10RemoteStore / nix-daemon: Drop support for Nix < 1.0Eelco Dolstra
2016-07-11Modernize AutoCloseFDShea Levy
2016-06-09Use O_CLOEXEC in most placesEelco Dolstra
2016-06-01Make the store directory a member variable of StoreEelco Dolstra
2016-05-31nix-copy-closure / build-remote.pl: Disable signature checkingEelco Dolstra
This restores the Nix 1.11 behaviour.
2016-05-04Do compression in a sinkEelco Dolstra
2016-05-04Add a Store::addToStore() variant that accepts a NAREelco Dolstra
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-04Remove OpenSSL-based signingEelco Dolstra
2016-04-29Allow parameters in store URIsEelco Dolstra
This is to allow store-specific configuration, e.g. s3://my-cache?compression=bzip2&secret-key=/path/to/key.
2016-04-25Show the log tail when a build failsEelco Dolstra
If --no-build-output is given (which will become the default for the "nix" command at least), show the last 10 lines of the build output if the build fails.
2016-04-25Remove --print-build-traceEelco Dolstra
This was added to support Hydra, but Hydra no longer uses it.
2016-04-25Improved logging abstractionEelco Dolstra
This also gets rid of --log-type, since the nested log type isn't useful in a multi-threaded situation, and nobody cares about the "pretty" log type.
2016-04-20RemoteStore: Propagate InvalidPath exceptions from the daemonEelco Dolstra
2016-04-20Cache path info lookups in SQLiteEelco Dolstra
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-19Move path info caching from BinaryCacheStore to StoreEelco Dolstra
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-08Remove failed build cachingEelco Dolstra
This feature was implemented for Hydra, but Hydra no longer uses it.
2016-04-05Add "nix copy-sigs" commandEelco Dolstra
This imports signatures from one store into another. E.g. $ nix copy-sigs -r /run/current-system -s https://cache.nixos.org/ imported 595 signatures
2016-03-30LocalStore: Keep track of ultimately trusted pathsEelco Dolstra
These are content-addressed paths or outputs of locally performed builds. They are trusted even if they don't have signatures, so "nix verify-paths" won't complain about them.
2016-03-23Drop support for daemon socket path >= 108 charactersEelco Dolstra
Doing a chdir() is a bad idea in multi-threaded programs, leading to failures such as error: cannot connect to daemon at ‘/nix/var/nix/daemon-socket/socket’: No such file or directory Since Linux doesn't have a connectat() syscall like FreeBSD, there is no way we can support this in a race-free way.
2016-03-22Don't overload dumpPath()Eelco Dolstra
2016-03-21Add Store::dumpPath() methodEelco Dolstra
This allows applying nix-store --verify-path to binary cache stores: NIX_REMOTE=https://cache.nixos.org nix-store --verify-path /nix/store/s5c7...
2016-02-26importPaths(): Optionally add NARs to binary cache accessorEelco Dolstra
This enables an optimisation in hydra-queue-runner, preventing a download of a NAR it just uploaded to the cache when reading files like hydra-build-products.
2016-02-24Eliminate reserveSpace flagEelco Dolstra
2016-02-24Remove bad daemon connections from the poolEelco Dolstra
This is necessary for long-running processes like hydra-queue-runner: if a nix-daemon worker is killed, we need to stop reusing that connection.
2016-02-23Pool<T>: Allow a maximum pool sizeEelco Dolstra
2016-02-23RemoteStore: Make thread-safeEelco Dolstra
This allows a RemoteStore object to be used safely from multiple threads concurrently. It will make multiple daemon connections if necessary. Note: pool.hh and sync.hh have been copied from the Hydra source tree.
2016-02-16Rename ValidPathInfo::hash -> narHash for consistencyEelco Dolstra
2016-01-31Use the daemon when we don't have write access to the Nix databaseEelco Dolstra
2015-12-02daemon: Add 'buildMode' parameter to 'buildPaths' RPCLudovic Courtès
2015-09-03Implement buildDerivation() via the daemonEelco Dolstra
2015-07-20More cleanupEelco Dolstra
2015-07-17OCD: foreach -> C++11 ranged forEelco Dolstra
2015-07-17Allow remote builds without sending the derivation closureEelco Dolstra
Previously, to build a derivation remotely, we had to copy the entire closure of the .drv file to the remote machine, even though we only need the top-level derivation. This is very wasteful: the closure can contain thousands of store paths, and in some Hydra use cases, include source paths that are very large (e.g. Git/Mercurial checkouts). So now there is a new operation, StoreAPI::buildDerivation(), that performs a build from an in-memory representation of a derivation (BasicDerivation) rather than from a on-disk .drv file. The only files that need to be in the Nix store are the sources of the derivation (drv.inputSrcs), and the needed output paths of the dependencies (as described by drv.inputDrvs). "nix-store --serve" exposes this interface. Note that this is a privileged operation, because you can construct a derivation that builds any store path whatsoever. Fixing this will require changing the hashing scheme (i.e., the output paths should be computed from the other fields in BasicDerivation, allowing them to be verified without access to other derivations). However, this would be quite nice because it would allow .drv-free building (e.g. "nix-env -i" wouldn't have to write any .drv files to disk). Fixes #173.
2015-06-02Add a ‘verifyStore’ RPCLudovic Courtès
Hello! The patch below adds a ‘verifyStore’ RPC with the same signature as the current LocalStore::verifyStore method. Thanks, Ludo’. >From aef46c03ca77eb6344f4892672eb6d9d06432041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org> Date: Mon, 1 Jun 2015 23:17:10 +0200 Subject: [PATCH] Add a 'verifyStore' remote procedure call.
2015-03-25addToStore(): Take explicit name argumentEelco Dolstra
2014-12-14Merge branch 'cygwin-master' of https://github.com/ternaris/nixEelco Dolstra
2014-12-13Better error messageEelco Dolstra
2014-12-12Silence some warnings on GCC 4.9Eelco Dolstra
2014-12-09Explicitly include required C headersMarko Durkovic
2014-10-31Improve error message if the daemon worker fails to startEelco Dolstra
2014-09-01Add an 'optimiseStore' remote procedure call.Ludovic Courtès
2014-08-20Use proper quotes everywhereEelco Dolstra
2014-07-25nix-daemon: Pass on the user's $SSH_AUTH_SOCK to the SSH substituterEelco Dolstra
2014-07-23Remove dead codeEelco Dolstra