eldritch horrors
61eed2c97c
this finally gives us a witness type we can use to prove that a certain
call graph subtree can't be used in kj promises using only a single new
assumption: if EvalState& is never held as a reference member of a type
and instead only ever passes as an argument or held on the stack we can
be certain that anything that has access to en EvalState ref must never
be run inside a promise and, crucially, that anything that doesn't have
access to an EvalState& *can* be run inside a promise without problems.
Change-Id: I6c15ada479175ad7e6cd3e4a729a5586b3ba30d6
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#pragma once
|
|
///@file
|
|
|
|
#include "lix/libcmd/installable-value.hh"
|
|
#include "lix/libexpr/eval-cache.hh"
|
|
#include "lix/libstore/outputs-spec.hh"
|
|
#include "lix/libcmd/command.hh"
|
|
#include "lix/libcmd/common-eval-args.hh"
|
|
#include "lix/libexpr/eval.hh"
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
namespace nix {
|
|
|
|
class InstallableAttrPath : public InstallableValue
|
|
{
|
|
SourceExprCommand & cmd;
|
|
RootValue v;
|
|
std::string attrPath;
|
|
ExtendedOutputsSpec extendedOutputsSpec;
|
|
|
|
InstallableAttrPath(
|
|
ref<eval_cache::CachingEvaluator> state,
|
|
SourceExprCommand & cmd,
|
|
Value * v,
|
|
const std::string & attrPath,
|
|
ExtendedOutputsSpec extendedOutputsSpec);
|
|
|
|
std::string what() const override { return attrPath; };
|
|
|
|
std::pair<Value *, PosIdx> toValue(EvalState & state) override;
|
|
|
|
DerivedPathsWithInfo toDerivedPaths(EvalState & state) override;
|
|
|
|
public:
|
|
|
|
static InstallableAttrPath parse(
|
|
ref<eval_cache::CachingEvaluator> state,
|
|
SourceExprCommand & cmd,
|
|
Value * v,
|
|
std::string_view prefix,
|
|
ExtendedOutputsSpec extendedOutputsSpec);
|
|
};
|
|
|
|
}
|