about summary refs log tree commit diff
path: root/src/libstore/remote-store.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-10-09 libstore: don't forward --show-tracezimbatm1-0/+1
(cherry picked from commit e63c9e73e3e5d1f31fa5065c9ff59f442dd07d0e)
2019-09-03 Add some noexceptsEelco Dolstra1-1/+1
This is to assert that callback functions should never throw (since the context in which they're called may not be able to handle the exception).
2019-08-28 Don't send certain setting overrides to the daemonEelco Dolstra1-0/+7
These are already handled separately. This fixes warnings like warning: ignoring the user-specified setting 'max-jobs', because it is a restricted setting and you are not a trusted user when using the -j flag.
2019-03-14 findRoots(): Add 'censor' parameterEelco Dolstra1-1/+1
This is less brittle than filtering paths after the fact in nix-daemon.
2019-03-10 Make roots a map of store paths to pinning linksGuillaume Maudoux1-1/+1
This new structure makes more sense as there may be many sources rooting the same store path. Many profiles can reference the same path but this is even more true with /proc/<pid>/maps where distinct pids can and often do map the same store path. This implementation is also more efficient as the `Roots` map contains only one entry per rooted store path.
2018-10-27 Merge branch 'nix-doctor' of https://github.com/LnL7/nixEelco Dolstra1-0/+7
2018-10-16 RemoteStore: Close connection if an exception occursEelco Dolstra1-61/+110
Fixes #2075.
2018-09-02 Store: expose the protocol version used by a storeDaiderd Jordan1-0/+7
2018-05-30 RemoteStore::addToStore(): Ensure capacity is decreased on exceptionsEelco Dolstra1-2/+5
2018-05-30 Fix deadlock in RemoteStore::queryPathInfoUncached()Eelco Dolstra1-25/+28
2018-05-30 Simplify the callback mechanismEelco Dolstra1-5/+4
2018-05-30 Modularize config settingsEelco Dolstra1-2/+3
Allow global config settings to be defined in multiple Config classes. For example, this means that libutil can have settings and evaluator settings can be moved out of libstore. The Config classes are registered in a new GlobalConfig class to which config files etc. are applied. Relevant to https://github.com/NixOS/nix/issues/2009 in that it removes the need for ad hoc handling of useCaseHack, which was the underlying cause of that issue.
2018-05-30 Make 'nix copy --to daemon' run in constant memory (daemon side)Eelco Dolstra1-2/+3
Continuation of 97002b684c902dadcd351a67208f9c2a88ff8f8f. This makes the daemon use constant memory. For example, it reduces the daemon's maximum RSS on $ nix copy --from ~/my-nix --to daemon /nix/store/1n7x0yv8vq6zi90hfmian84vdhd04bgp-blender-2.79a from 264 MiB to 7 MiB. We now use a TunnelSource to prevent the connection from ending up in an undefined state if an exception is thrown while the NAR is being sent. Issue https://github.com/NixOS/nix/issues/1681.
2018-03-21 Also make the backwards compatible case of RemoteStore::addToStore run in ↵Eelco Dolstra1-15/+15
constant memory Just because we can.
2018-03-21 Make 'nix copy --to daemon' run in constant memoryEelco Dolstra1-4/+3
2018-01-26 remote_store: register for NIX_REMOTE=unix://pathSpencer Baugh1-2/+24
This allows overriding the socket path so the daemon may be listening at an arbitrary Unix domain socket location. Fixes #1800
2017-10-24 Remove the remote-builds optionEelco Dolstra1-1/+1
This is superfluous since you can now just set "builders" to empty, e.g. "--builders ''".
2017-09-14 RemoteStore: Add option to drop old connections from the poolEelco Dolstra1-1/+15
This is a hack to make hydra-queue-runner free its temproots periodically, thereby ensuring that garbage collection of the corresponding paths is not blocked until the queue runner is restarted. It would be better if temproots could be released earlier than at process exit. I started working on a RAII object returned by functions like addToStore() that releases temproots. However, this would be a pretty massive change so I gave up on it for now.
2017-08-28 Give activities a verbosity level againEelco Dolstra1-1/+2
And print them (separately from the progress bar) given sufficient -v flags.
2017-08-28 Tunnel progress messages from the daemon to the clientEelco Dolstra1-11/+58
This makes the progress bar work for non-root users.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-5/+5
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-04 Support base-64 hashesEelco Dolstra1-2/+2
Also simplify the Hash API. Fixes #1437.
2017-07-03 Replace a few bool flags with enumsEelco Dolstra1-6/+6
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-05-02 build-remote: Fix fallback to other machines when connecting failsEelco Dolstra1-1/+7
Opening an SSHStore or LegacySSHStore does not actually establish a connection, so the try/catch block here did nothing. Added a Store::connect() method to test whether a connection can be established.
2017-04-26 Add Store nesting to fix import-from-derivation within filterSourceShea Levy1-0/+2
2017-04-20 Read per-user settings from ~/.config/nix/nix.confEelco Dolstra1-1/+1
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-3/+1
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Add a Config class to simplify adding configuration settingsEelco Dolstra1-1/+1
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-06 Implement RemoteStore::queryMissing()Eelco Dolstra1-0/+25
This provides a significant speedup, e.g. 64 s -> 12 s for nix-build --dry-run -I nixpkgs=channel:nixos-16.03 '<nixpkgs/nixos/tests/misc.nix>' -A test on a cold local and CloudFront cache. The alternative is to use lots of concurrent daemon connections but that seems wasteful.
2017-03-16 copyPaths(): Use queryValidPaths() to reduce SSH latencyEelco Dolstra1-1/+1
2017-03-03 Cache connection failuresEelco Dolstra1-1/+14
2017-03-03 Improve SSH handlingEelco Dolstra1-5/+5
* Unify SSH code in SSHStore and LegacySSHStore. * Fix a race starting the SSH master. We now wait synchronously for the SSH master to finish starting. This prevents the SSH clients from starting their own connections. * Don't use a master if max-connections == 1. * Add a "max-connections" store parameter. * Add a "compress" store parameter.
2017-03-01 RemoteStore::addToStore(): Send NAR rather than string containing NAREelco Dolstra1-2/+3
This allows the NAR to be streamed in the future (though we're not doing that yet).
2017-03-01 Handle importing NARs containing files greater than 4 GiBEelco Dolstra1-13/+11
Also templatize readInt() to work for various integer types.
2017-02-22 RemoteStore::addToStore(): Pass content-addressability assertionEelco Dolstra1-1/+1
... 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 Add a LegacySSHStore that uses nix-store --serveEelco Dolstra1-0/+1
This is useful for nix-copy-closure.
2017-01-16 AutoDeleteArray -> std::unique_ptrEelco Dolstra1-3/+2
Also, switch to C++14 for std::make_unique.
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-3/+3
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-3/+3
2016-11-09 Merge branch 'ssh-store' of https://github.com/shlevy/nixEelco Dolstra1-45/+70
2016-11-09 Implement backwards-compatible RemoteStore::addToStore()Eelco Dolstra1-1/+22
The SSHStore PR adds this functionality to the daemon, but we have to handle the case where the Nix daemon is 1.11. Also, don't require signatures for trusted users. This restores 1.11 behaviour. Fixes https://github.com/NixOS/hydra/issues/398.
2016-10-21 Remove addPathToAccessorEelco Dolstra1-1/+1
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-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-1/+1
2016-09-21 Some notational convenience for formatting stringsEelco Dolstra1-1/+1
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-16 Make computeFSClosure() single-threaded againEelco Dolstra1-30/+34
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 Implement nar-based addToStore for remote-storeShea Levy1-1/+6
2016-09-02 Factor out the unix domain socket-specific code from RemoteStoreShea Levy1-26/+39
2016-08-10 Mark content-addressed paths in the Nix database and in .narinfoEelco Dolstra1-0/+1
This allows such paths to be imported without signatures.
2016-08-10 RemoteStore / nix-daemon: Drop support for Nix < 1.0Eelco Dolstra1-19/+15