![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <worker.hh>
Public Member Functions | |
| LocalBuilder (ref< Store > store, ref< Store > evalStore) | |
| void | buildPaths (const std::vector< DerivedPath > &reqs, BuildMode buildMode) override |
| std::vector< KeyedBuildResult > | buildPathsWithResults (const std::vector< DerivedPath > &reqs, BuildMode buildMode) override |
| BuildResult | buildDerivation (const StorePath &drvPath, const BasicDerivation &drv, BuildMode buildMode) override |
| void | ensurePath (const StorePath &path) override |
| void | repairPath (const StorePath &path) override |
| Public Member Functions inherited from nix::Builder | |
| virtual void | anchor () |
Owns a worker. Optimization around ensurePath to prevent a Worker from being constructed when it's not needed.
|
overridevirtual |
Build a single non-materialized derivation (i.e. not from an on-disk .drv file).
| drvPath | This is used to deduplicate worker goals so it is imperative that is correct. That said, it doesn't literally need to be store path that would be calculated from writing this derivation to the store: it is OK if it instead is that of a Derivation which would resolve to this (by taking the outputs of it's input derivations and adding them as input sources) such that the build time referenceable-paths are the same. |
In the input-addressed case, we usually do use an "original" unresolved derivations's path, as that is what will be used in the buildPaths case. Also, the input-addressed output paths are verified only by that contents of that specific unresolved derivation, so it is nice to keep that information around so if the original derivation is ever obtained later, it can be verified whether the trusted user in fact used the proper output path.
In the content-addressed case, we want to always use the resolved drv path calculated from the provided derivation. This serves two purposes:
Implements nix::Builder.
|
overridevirtual |
For each path, if it's a derivation, build it. Building a derivation means ensuring that the output paths are valid. If they are already valid, this is a no-op. Otherwise, validity can be reached in two ways. First, if the output paths is substitutable, then build the path that way. Second, the output paths can be created by running the builder, after recursively building any sub-derivations. For inputs that are not derivations, substitute them.
Implements nix::Builder.
|
overridevirtual |
Like buildPaths(), but return a vector of BuildResult BuildResults corresponding to each element in paths. Note that in case of a build/substitution error, this function won't throw an exception, but return a BuildResult containing an error message.
Implements nix::Builder.
|
overridevirtual |
Ensure that a path is valid. If it is not currently valid, it may be made valid by running a substitute (if defined for the path).
The path is registered as a temporary GC root first, whether or not it was already valid, so that a concurrent garbage collection cannot delete it while the caller is still using it.
Implements nix::Builder.
|
overridevirtual |
Repair the contents of the given path by redownloading it using a substituter (if available).
Implements nix::Builder.