1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01:00

Split shell & json creation for build environments with structured attrs

This commit is contained in:
Maximilian Bosch 2021-05-13 16:11:56 +02:00
parent 447928bdb5
commit f1e281c4fe
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
4 changed files with 20 additions and 13 deletions

View file

@ -1086,10 +1086,9 @@ void LocalDerivationGoal::initEnv()
void LocalDerivationGoal::writeStructuredAttrs()
{
if (auto structAttrs = parsedDrv->generateStructuredAttrs(inputRewrites, worker.store, inputPaths)) {
auto value = structAttrs.value();
auto jsonSh = value.first;
auto json = value.second;
if (auto structAttrsJson = parsedDrv->prepareStructuredAttrs(inputRewrites, worker.store, inputPaths)) {
auto json = structAttrsJson.value();
auto jsonSh = parsedDrv->writeStructuredAttrsShell(json);
writeFile(tmpDir + "/.attrs.sh", rewriteStrings(jsonSh, inputRewrites));
chownToBuilder(tmpDir + "/.attrs.sh");