aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/legacy-ssh-store.cc
AgeCommit message (Collapse)Author
2020-08-05Add Hash::dummy to signal default valueCarlo Nucera
We did this in the same spirit of the dummy value that's present in libstore/path.hh
2020-08-05Remove optionality in ValidPathInfo::narInfoCarlo Nucera
2020-07-16Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into ↵John Ericson
better-ca-parse-errors
2020-07-15Merge branch 'master' of github.com:NixOS/nix into hash-always-has-typeCarlo Nucera
2020-07-13Remove 'accessor' from addToStore()Eelco Dolstra
This is only used by hydra-queue-runner and it's better to implement it there.
2020-07-01Rename two hash constructors to proper functionsCarlo Nucera
2020-06-23Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-06-22More bug fixingCarlo Nucera
2020-06-19WIP bug fixingCarlo Nucera
2020-06-18Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatypeJohn Ericson
2020-06-16Remove StorePath::clone() and related functionsEelco Dolstra
2020-06-02Apply suggestions from code reviewJohn Ericson
Co-authored-by: Matthew Bauer <mjbauer95@gmail.com>
2020-06-02Change parseCa(Opt) to parseContentAddress(Opt)Carlo Nucera
2020-06-02WIPJohn Ericson
2020-05-28Merge branch 'master' of github.com:NixOS/nix into enum-classCarlo Nucera
2020-03-29Replace some `bool recursive` with a new `FileIngestionMethod` enumJohn Ericson
2020-03-29Use `enum struct` and drop prefixesJohn Ericson
This does a few enums; the rest will be gotten in subsequent commits.
2019-12-10Make the Store API more type-safeEelco Dolstra
Most functions now take a StorePath argument rather than a Path (which is just an alias for std::string). The StorePath constructor ensures that the path is syntactically correct (i.e. it looks like <store-dir>/<base32-hash>-<name>). Similarly, functions like buildPaths() now take a StorePathWithOutputs, rather than abusing Path by adding a '!<outputs>' suffix. Note that the StorePath type is implemented in Rust. This involves some hackery to allow Rust values to be used directly in C++, via a helper type whose destructor calls the Rust type's drop() function. The main issue is the dynamic nature of C++ move semantics: after we have moved a Rust value, we should not call the drop function on the original value. So when we move a value, we set the original value to bitwise zero, and the destructor only calls drop() if the value is not bitwise zero. This should be sufficient for most types. Also lots of minor cleanups to the C++ API to make it more modern (e.g. using std::optional and std::string_view in some places).
2019-10-29queryPathInfoUncached(): Return const ValidPathInfoEelco Dolstra
2019-09-03Add some noexceptsEelco Dolstra
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-01-18unsupported(): Show the name of the unsupported operationEelco Dolstra
2018-09-02Store: expose the protocol version used by a storeDaiderd Jordan
2018-08-30fix `error: unknown serve command 9`Michael Bishop
2018-08-06DohEelco Dolstra
2018-08-03Make adding paths via nix-store --serve run in constant memoryEelco Dolstra
It adds a new operation, cmdAddToStoreNar, that does the same thing as the corresponding nix-daemon operation, i.e. call addToStore(). This replaces cmdImportPaths, which has the major issue that it sends the NAR first and the store path second, thus requiring us to store the incoming NAR either in memory or on disk until we decide what to do with it. For example, this reduces the memory usage of $ nix copy --to 'ssh://localhost?remote-store=/tmp/nix' /nix/store/95cwv4q54dc6giaqv6q6p4r02ia2km35-blender-2.79 from 267 MiB to 12 MiB. Probably fixes #1988.
2018-08-03LegacySSHStore: Add remote-store optionEelco Dolstra
This is primarily useful for testing, e.g. $ nix copy --to 'ssh://localhost?remote-store=/tmp/nix' ...
2018-05-30Simplify the callback mechanismEelco Dolstra
2018-03-21Make 'nix copy --to ssh://...' run in constant memoryEelco Dolstra
2018-03-21Make 'nix copy --from ssh://...' run in constant memoryEelco Dolstra
For instance, this reduced the memory consumption of $ nix copy --from ssh://localhost --to ~/my-nix /nix/store/1n7x0yv8vq6zi90hfmian84vdhd04bgp-blender-2.79a from 632 MiB to 16 MiB.
2018-03-21LegacySSHStore: Allow overriding the path to nix-storeEelco Dolstra
2017-09-08LegacySSHStore: Include signatures etc.Eelco Dolstra
2017-08-16nix copy: Revive progress barEelco Dolstra
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-03Replace a few bool flags with enumsEelco Dolstra
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-05-02build-remote: Fix fallback to other machines when connecting failsEelco Dolstra
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-05-02build-remote: Ugly hackery to get build logs to workEelco Dolstra
The build hook mechanism expects build log output to go to file descriptor 4, so do that.
2017-05-01build-remote: Don't require signaturesEelco Dolstra
This restores the old behaviour.
2017-05-01Implement LegacySSHStore::buildDerivation()Eelco Dolstra
This makes LegacySSHStore usable by build-remote and hydra-queue-runner.
2017-05-01Add a dummy Store::buildPaths() methodEelco Dolstra
This default implementation of buildPaths() does nothing if all requested paths are already valid, and throws an "unsupported operation" error otherwise. This fixes a regression introduced by c30330df6f67c81986dfb124631bc756c8e58c0d in binary cache and legacy SSH stores.
2017-04-13Add a Config class to simplify adding configuration settingsEelco Dolstra
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-03-16ssh:// -> ssh-ng://, legacy-ssh:// -> ssh://Eelco Dolstra
2017-03-16copyPaths(): Use queryValidPaths() to reduce SSH latencyEelco Dolstra
2017-03-16LegacySSHStore: Provide a faster implementation of computeFSClosure()Eelco Dolstra
This avoids the latency of the standard implementation, which can make a huge difference (e.g. 16.5s -> 0.5s on a NixOS system closure).
2017-03-16Fix nix-copy-closure --toEelco Dolstra
2017-03-03Improve SSH handlingEelco Dolstra
* 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-01RemoteStore::addToStore(): Send NAR rather than string containing NAREelco Dolstra
This allows the NAR to be streamed in the future (though we're not doing that yet).
2017-02-21Fix building without S3 supportEelco Dolstra
http://hydra.nixos.org/build/49031196/nixlog/2/raw
2017-02-07Add a LegacySSHStore that uses nix-store --serveEelco Dolstra
This is useful for nix-copy-closure.