1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Expose mkOutputString as method of EvalState

This commit is contained in:
John Ericson 2023-05-10 20:47:25 -04:00
parent 0a9afce3b9
commit 8e1a990268
3 changed files with 51 additions and 30 deletions

View file

@ -129,30 +129,6 @@ static SourcePath realisePath(EvalState & state, const PosIdx pos, Value & v, co
}
}
/**
* Inverse of one of the `EvalState::coerceToDerivedPath()` cases.
*/
static void mkOutputString(
EvalState & state,
Value & value,
const StorePath & drvPath,
const std::string outputName,
std::optional<StorePath> optOutputPath)
{
value.mkString(
optOutputPath
? state.store->printStorePath(*std::move(optOutputPath))
/* Downstream we would substitute this for an actual path once
we build the floating CA derivation */
: downstreamPlaceholder(*state.store, drvPath, outputName),
NixStringContext {
NixStringContextElem::Built {
.drvPath = drvPath,
.output = outputName,
}
});
}
/**
* Add and attribute to the given attribute map from the output name to
* the output path, or a placeholder.
@ -173,8 +149,7 @@ static void mkOutputString(
const StorePath & drvPath,
const std::pair<std::string, DerivationOutput> & o)
{
mkOutputString(
state,
state.mkOutputString(
attrs.alloc(o.first),
drvPath,
o.first,