aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/daemon.cc
AgeCommit message (Collapse)Author
2023-01-26warnings: enhance the case of untrusted substituter for untrusted userSolène Rapenne
2023-01-14Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-14Make `ValidPathInfo` have plain `StorePathSet` references like beforeJohn Ericson
This change can wait for another PR.
2023-01-06Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-06Do big rename to clean up codeJohn Ericson
- `PathReferences` -> `References` - `PathReferences<StorePath>` -> `StoreReference` - `references` -> `others` - `hasSelfReference` -> `self` And get rid of silly subclassing
2023-01-06Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-06Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-12-07Remove repeat and enforce-determinism optionsLinus Heckemann
These only functioned if a very narrow combination of conditions held: - The result path does not yet exist (--check did not result in repeated builds), AND - The result path is not available from any configured substituters, AND - No remote builders that can build the path are available. If any of these do not hold, a derivation would be built 0 or 1 times regardless of the repeat option. Thus, remove it to avoid confusion.
2022-09-22Allow pass max-silent-time and build-poll-interval to daemon untrustedMatthew Bauer
These settings seem harmless, they control the same polling functionality that timeout does, but with different behavior. Should be safe for untrusted users to pass in.
2022-03-25Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2022-03-25Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-03-18Generalize `DerivationType` in preparation for impure derivationsJohn Ericson
2022-03-11Deduplicate the Store downcasting with a templateJohn Ericson
2022-03-11Factor out a `LogStore` interfaceJohn Ericson
Continue progress on #5729. Just as I hoped, this uncovered an issue: the daemon protocol is missing a way to query build logs. This doesn't effect `unix://`, but does effect `ssh://`. A FIXME is left for this, so we come back to it later.
2022-03-11Rename `requireGcStore` to `GcStore::require`John Ericson
I should have done this to begin with. This will be nicer once more Store sub-interfaces exist too, to illustrate the pattern.
2022-03-10Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2022-03-10Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-03-08Add Store::buildPathsWithResults()Eelco Dolstra
This function is like buildPaths(), except that it returns a vector of BuildResults containing the exact statuses and output paths of each derivation / substitution. This is convenient for functions like Installable::build(), because they then don't need to do another series of calls to get the outputs of CA derivations. It's also a precondition to impure derivations, where we *can't* query the output of those derivations since they're not stored in the Nix database. Note that PathSubstitutionGoal can now also return a BuildStatus.
2022-03-03Factor out a `GcStore` interfaceJohn Ericson
Starts progress on #5729. The idea is that we should not have these default methods throwing "unimplemented". This is a small step in that direction. I kept `addTempRoot` because it is a no-op, rather than failure. Also, as a practical matter, it is called all over the place, while doing other tasks, so the downcasting would be annoying. Maybe in the future I could move the "real" `addTempRoot` to `GcStore`, and the existing usecases use a `tryAddTempRoot` wrapper to downcast or do nothing, but I wasn't sure whether that was a good idea so with a bias to less churn I didn't do it yet.
2022-03-01Move `BuildResult` defintion to its own headerJohn Ericson
Just like we did for `ValidPathInfo` in d92d4f85a5c8a2a2385c084500a8b6bd54b54e6c.
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2022-01-25nix store ping: Report Nix daemon versionEelco Dolstra
Fixes #5952.
2022-01-18Add command 'nix store copy-log'Eelco Dolstra
Fixes #5222.
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2021-12-22Remove CPU lockingEelco Dolstra
This was already accidentally disabled in ba87b08. It also no longer appears to be beneficial, and in fact slow things down, e.g. when evaluating a NixOS system configuration: elapsed time: median = 3.8170 mean = 3.8202 stddev = 0.0195 min = 3.7894 max = 3.8600 [rejected, p=0.00000, Δ=0.36929±0.02513]
2021-12-09Merge pull request #5695 from obsidiansystems/tidy-loggingEelco Dolstra
Tidy up the logging
2021-11-30Push wopAddToStore old style stream adapters into smaller scopesJohn Ericson
This doesn't fix the bug, but makes the code less difficult to read. Also improve the comments, now that it is clear what part is needed in each code path.
2021-11-30Nix daemon stream old wopAddToStoreJohn Ericson
No more buffering in string.
2021-11-30Tidy up the loggingJohn Ericson
Use the macros more, so we properly skip work when the log level excludes. Also log the daemon operation number on the daemon side.
2021-11-09Merge pull request #5494 from tweag/balsoft/allow-references-in-addPathEelco Dolstra
Allow references in addPath
2021-11-05addPath: allow paths with referencesAlexander Bantyev
Since 4806f2f6b0fd2cae401b89fe19d8c528ffd88b5f, we can't have paths with references passed to builtins.{path,filterSource}. This prevents many cases of those functions called on IFD outputs from working. Resolve this by passing the references found in the original path to the added path.
2021-10-28Merge remote-tracking branch 'origin/master' into non-blocking-gcEelco Dolstra
2021-10-27daemon: Accept 'repeat' setting from untrusted usersEelco Dolstra
Fixes #5352.
2021-10-26Make experimental-features a proper typeregnat
Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it.
2021-10-23addToStore, addToStoreFromDump: add references argumentAlexander Bantyev
Allow to pass a set of references to be added as info to the added paths.
2021-10-13Remove syncWithGC()Eelco Dolstra
2021-10-01Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2021-10-01Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2021-09-30Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2021-09-30Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2021-09-30`std::visit` by referenceJohn Ericson
I had started the trend of doing `std::visit` by value (because a type error once mislead me into thinking that was the only form that existed). While the optomizer in principle should be able to deal with extra coppying or extra indirection once the lambdas inlined, sticking with by reference is the conventional default. I hope this might even improve performance.
2021-08-30Don’t accept experimental features from the clientregnat
If the client sends an “experimental features” setting, just ignore it
2021-07-26Low-latency closure copyEelco Dolstra
This adds a new store operation 'addMultipleToStore' that reads a number of NARs and ValidPathInfos from a Source, allowing any number of store paths to be copied in a single call. This is much faster on high-latency links when copying a lot of small files, like .drv closures. For example, on a connection with an 50 ms delay: Before: $ nix copy --to 'unix:///tmp/proxy-socket?root=/tmp/dest-chroot' \ /nix/store/90jjw94xiyg5drj70whm9yll6xjj0ca9-hello-2.10.drv \ --derivation --no-check-sigs real 0m57.868s user 0m0.103s sys 0m0.056s After: real 0m0.690s user 0m0.017s sys 0m0.011s
2021-07-22Hacky fast closure copying mechanismEelco Dolstra
2021-05-19Always send the realisations as JSONregnat
Align all the worker protocol with `buildDerivation` which inlines the realisations as one opaque json blob. That way we don’t have to bother changing the remote store protocol when the definition of `Realisation` changes, as long as we keep the json backwards-compatible
2021-05-03Bump version number for `DerivedPath` changesMaximilian Bosch
I guess I misunderstood John's initial explanation about why wildcards for outputs are sent to older stores[1]. My `nix-daemon` from 2021-03-26 also has version 1.29, but misses the wildcard[2]. So bumping seems to be the right call. [1] https://github.com/NixOS/nix/pull/4759#issuecomment-830812464 [2] 255d145ba7ac907d1cba8d088da556b591627756
2021-04-13Fix registerDrvOutput with the daemonregnat
Resolve a protocol issue that caused the daemon to endlessly wait for some information that the client doesn't ever send
2021-04-05Merge commit '1b6cf0d5f56e166a1cbbf38142375b7a92fc88f2' into ca-drv-exoticJohn Ericson
2021-04-05Merge commit 'd5cef6c33a051dfc672cb1e5f4739948b167315b' into ca-drv-exoticJohn Ericson
2021-04-05Merge commit 'e12308dd63f0ad27b22dcdb3da89c411eebcad2b' into ca-drv-exoticJohn Ericson