1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 07:53:55 +02:00

Limit ParsedDerivation just to the derivation's environment

This moves us towards getting rid of `ParsedDerivation` and just having
`DerivationOptions`.

Co-Authored-By: HaeNoe <git@haenoe.party>
This commit is contained in:
John Ericson 2025-02-03 11:41:33 -05:00
parent d285b80033
commit 1e31b60043
8 changed files with 52 additions and 38 deletions

View file

@ -544,7 +544,7 @@ static void main_nix_build(int argc, char * * argv)
env["NIX_STORE"] = store->storeDir;
env["NIX_BUILD_CORES"] = std::to_string(settings.buildCores);
ParsedDerivation parsedDrv(drv);
ParsedDerivation parsedDrv(drv.env);
DerivationOptions drvOptions;
try {
drvOptions = DerivationOptions::fromParsedDerivation(parsedDrv);
@ -584,7 +584,12 @@ static void main_nix_build(int argc, char * * argv)
for (const auto & [inputDrv, inputNode] : drv.inputDrvs.map)
accumInputClosure(inputDrv, inputNode);
if (auto structAttrs = parsedDrv.prepareStructuredAttrs(*store, drvOptions, inputs)) {
if (auto structAttrs = parsedDrv.prepareStructuredAttrs(
*store,
drvOptions,
inputs,
drv.outputs))
{
auto json = structAttrs.value();
structuredAttrsRC = writeStructuredAttrsShell(json);