|
Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
|
Public Member Functions | |
| Evaluator (AsyncIoRoot &aio, const SearchPath &_searchPath, ref< Store > store, std::shared_ptr< Store > buildStore=nullptr, std::function< ReplExitStatus(EvalState &es, ValMap const &extraEnv)> debugRepl=nullptr) | |
| Evaluator (const Evaluator &)=delete | |
| Evaluator (Evaluator &&)=delete | |
| Evaluator & | operator= (const Evaluator &)=delete |
| Evaluator & | operator= (Evaluator &&)=delete |
| Expr & | parseExprFromFile (const CheckedSourcePath &path) |
| Expr & | parseExprFromFile (const CheckedSourcePath &path, std::shared_ptr< StaticEnv > &staticEnv) |
| Expr & | parseExprFromString (std::string s, const SourcePath &basePath, std::shared_ptr< StaticEnv > &staticEnv, const FeatureSettings &xpSettings=featureSettings) |
| Expr & | parseExprFromString (std::string s, const SourcePath &basePath, const FeatureSettings &xpSettings=featureSettings) |
| std::variant< std::unique_ptr< Expr >, ExprReplBindings > | parseReplInput (std::string s, const SourcePath &basePath, std::shared_ptr< StaticEnv > &staticEnv, const FeatureSettings &xpSettings=featureSettings) |
| Expr & | parseStdin () |
| void | evalLazily (Expr &e, Value &v) |
| BindingsBuilder | buildBindings (size_t capacity) |
| void | maybePrintStats () |
| void | printStatistics () |
| bool | fullGC () |
| box_ptr< EvalState > | begin (AsyncIoRoot &aio) |
Public Attributes | |
| SymbolTable | symbols |
| PosTable | positions |
| const StaticSymbols | s |
| EvalMemory | mem |
| EvalRuntimeCaches | caches |
| EvalPaths | paths |
| EvalBuiltins | builtins |
| EvalStatistics | stats |
| RepairFlag | repair |
| const ref< Store > | store |
| ref< Store > | buildStore |
| std::unique_ptr< DebugState > | debug |
| EvalErrorContext | errors |
Friends | |
| class | EvalBuiltins |
| class | EvalState |
| box_ptr< EvalState > nix::Evaluator::begin | ( | AsyncIoRoot & | aio | ) |
Create an EvalState in prepation to evaluate some amount of Nix code.
While preparation of evaluation can be done with Evaluator itself only, actually evaluating things requires an EvalState. This function creates an EvalState and returns it. At most one EvalState per Evaluator may be live at any given point, and references to this EvalState must not live anywhere except in the returned box, local variables, or arguments. Any reference held in an object type is illegal, be it in a lambda capture, a pointer member of an object, a hidden member such as arguments passed to functions by std::thread or std::async—all references held where they could be copied are moved from are disallowed. EvalState is thus a witness type that a given thread may evaluate nix code and must never be run inside kj::Promise context. This is due to a kj limitation, in which it is not possible to block on a promise while already running in a promise without doing this blocking on a different event loop/thread.
Creates a thunk that will evaluate the given expression when forced.
| bool nix::Evaluator::fullGC | ( | ) |
Perform a full memory garbage collection - not incremental.
| void nix::Evaluator::maybePrintStats | ( | ) |
Print statistics, if enabled.
Performs a full memory GC before printing the statistics, so that the GC statistics are more accurate.
| Expr & nix::Evaluator::parseExprFromFile | ( | const CheckedSourcePath & | path | ) |
Parse a Nix expression from the specified file.
| Expr & nix::Evaluator::parseExprFromString | ( | std::string | s, |
| const SourcePath & | basePath, | ||
| std::shared_ptr< StaticEnv > & | staticEnv, | ||
| const FeatureSettings & | xpSettings = featureSettings ) |
Parse a Nix expression from the specified string.
| void nix::Evaluator::printStatistics | ( | ) |
Print statistics, unconditionally, cheaply, without performing a GC first.
| RepairFlag nix::Evaluator::repair |
If set, force copying files to the Nix store even if they already exist there.