aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/remote-store.cc
AgeCommit message (Collapse)Author
2020-09-22RemoteStore::addCAToStore(): Don't hold connection while calling queryPathInfo()Eelco Dolstra
This leads to a deadlock if we're at the connection limit.
2020-09-22Style fixesEelco Dolstra
2020-09-22Merge branch 'add-ca-to-store' of https://github.com/hercules-ci/nixEelco Dolstra
2020-09-22Merge remote-tracking branch 'upstream/master' into templated-daemon-protocolJohn Ericson
2020-09-21Move Callback into its own headerEelco Dolstra
This gets rid of the inclusion of <future> in util.hh, cutting compilation time by ~20s (CPU time). Issue #4045.
2020-09-21wopAddToStore: return ValidPathInfoRobert Hensing
A ValidPathInfo is created anyway. By returning it we can save a roundtrip and we have a nicer interface.
2020-09-21wopAddToStore: add RepairFlagRobert Hensing
2020-09-21Move FramedSink next to FramedSourceRobert Hensing
2020-09-21Refactor wopAddToStore to make wopAddTextToStore obsoleteRobert Hensing
2020-09-21Overhaul wopAddToStoreRobert Hensing
2020-09-17Move FramedSource and FramedSink, extract withFramedSinkRobert Hensing
2020-09-16Merge remote-tracking branch 'upstream/master' into ↵John Ericson
remove-storetype-delegate-regStore
2020-09-16Fix build issues with gccregnat
2020-09-16Document the new store hierarchyregnat
2020-09-16Properly filter the stores according to their declared uriSchemesregnat
When opening a store, only try the stores whose `uriSchemes()` include the current one
2020-09-16Correctly call all the parent contructors of the storesregnat
Using virtual inheritance means that only the default constructors of the parent classes will be called, which isn't what we want
2020-09-16Separate store configs from the implemsregnat
Rework the `Store` hierarchy so that there's now one hierarchy for the store configs and one for the implementations (where each implementation extends the corresponding config). So a class hierarchy like ``` StoreConfig-------->Store | | v v SubStoreConfig----->SubStore | | v v SubSubStoreConfig-->SubSubStore ``` (with virtual inheritance to prevent DDD). The advantage of this architecture is that we can now introspect the configuration of a store without having to instantiate the store itself
2020-09-16Fix the registration of storesregnat
2020-09-16Make the store plugins more introspectableregnat
Directly register the store classes rather than a function to build an instance of them. This gives the possibility to introspect static members of the class or choose different ways of instantiating them.
2020-09-15Merge remote-tracking branch 'upstream/master' into ↵John Ericson
remove-storetype-delegate-regStore
2020-09-15gracefully handle old daemon versionsregnat
Add a fallback path in `queryPartialDerivationOutputMap` for daemons that don't support it. Also upstreams a couple methods from `SSHStore` to `RemoteStore` as this is needed to handle the fallback path.
2020-09-13Fix unspecified behaviour in readStorePathCAMapaszlig
When deploying a Hydra instance with current Nix master, most builds would not run because of errors like this: queue monitor: error: --- Error --- hydra-queue-runner error: --- UsageError --- nix-daemon not a content address because it is not in the form '<prefix>:<rest>': /nix/store/...-somedrv The last error message is from parseContentAddress, which expects a colon-separated string, however what we got here is a store path. Looking at the worker protocol, the following message sent to the Nix daemon caused the error above: 0x1E -> wopQuerySubstitutablePathInfos 0x01 -> Number of paths 0x16 -> Length of string "/nix/store/...-somedrv" 0x00 -> Length of string "" Looking at writeStorePathCAMap, the store path is indeed the first field that's transmitted. However, readStorePathCAMap expects it to be the *second* field *on my machine*, since expression evaluation order is a classic form of unspecified behaviour[1] in C++. This has been introduced in https://github.com/NixOS/nix/pull/3689, specifically in commit 66a62b3189c8c9b0965850e6b3c9b0fda0b50fd8. [1]: https://en.wikipedia.org/wiki/Unspecified_behavior#Order_of_evaluation_of_subexpressions Signed-off-by: aszlig <aszlig@nix.build>
2020-08-27RemoteStore::addToStore(): Fix race between stderrThread and NAR writerEelco Dolstra
As pointed out by @B4dM4n, the call to to.flush() on stderrThread is unsafe because the NAR writer thread is also writing to 'to'. Fixes #3943.
2020-08-21tabs -> spacesJohn Ericson
Sorry I let the tab sneak in there in the first place.
2020-08-20Merge remote-tracking branch 'upstream/master' into templated-daemon-protocolJohn Ericson
2020-08-20Merge pull request #3859 from obsidiansystems/drv-outputs-map-allow-missingEelco Dolstra
`queryDerivationOutputMap` no longer assumes all outputs have a mapping
2020-08-20Rename drv output querying functionsJohn Ericson
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap` - `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap`
2020-08-19Use `RemoteStore` to open connection for proxying daemonJohn Ericson
Removes duplicate websocket opening code, and also means we should be able to to ssh-ssh-... daemon relays, not just uds-uds-... ones.
2020-08-19Merge branch 'master' of github.com:NixOS/nix into ↵John Ericson
remove-storetype-delegate-regStore
2020-08-19Merge branch 'master' of github.com:NixOS/nix into templated-daemon-protocolJohn Ericson
2020-08-07Merge branch 'drv-outputs-map-allow-missing' of ↵John Ericson
github.com:obsidiansystems/nix into templated-daemon-protocol
2020-08-07Specialize `std::optional<StorePath>` so this is backwards compatibleJohn Ericson
While I am cautious to break parametricity, I think it's OK in this cases---we're not about to try to do some crazy polymorphic protocol anytime soon.
2020-08-06Use template structs instead of phantomsCarlo Nucera
2020-08-06Merge branch 'drv-outputs-map-allow-missing-namespace' of ↵Carlo Nucera
github.com:obsidiansystems/nix into templated-daemon-protocol
2020-08-06Minimize the usage of `Hash::dummy`John Ericson
2020-08-05WIP: Put the worker protocol `read` and `write` in a namespace to disambigJohn Ericson
2020-08-05Proxy -> Phantom to match RustJohn Ericson
Sorry, Haskell.
2020-08-05Remove optionality in ValidPathInfo::narInfoCarlo Nucera
2020-08-05Merge remote-tracking branch 'obsidian/drv-outputs-map-allow-missing' into ↵John Ericson
templated-daemon-protocol
2020-08-05Merge remote-tracking branch 'upstream/master' into ↵John Ericson
drv-outputs-map-allow-missing
2020-08-04Remove stray tabsJohn Ericson
2020-08-04Get rid of some unneeded temporariesJohn Ericson
2020-08-04Organize and format code a bitJohn Ericson
2020-08-04Remove unused functionsJohn Ericson
2020-08-04Remove unneeded definitionJohn Ericson
Template instantiations will cover this case fine.
2020-08-04WIP systematize more of the worker protocolJohn Ericson
This refactor should *not* change the wire protocol.
2020-08-01Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2020-07-31Merge branch 'master' of github.com:NixOS/nix into drv-outputs-map-allow-missingCarlo Nucera
2020-07-30Merge branch 'master' of github.com:NixOS/nix into better-ca-parse-errorsCarlo Nucera
2020-07-30Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer