mirror of
https://github.com/NixOS/nix.git
synced 2025-11-27 12:41:00 +01:00
Perform input rewrites only in LocalDerivationGoal
This commit is contained in:
parent
6f206549ba
commit
644415d391
4 changed files with 14 additions and 12 deletions
|
|
@ -1086,8 +1086,17 @@ void LocalDerivationGoal::initEnv()
|
|||
|
||||
void LocalDerivationGoal::writeStructuredAttrs()
|
||||
{
|
||||
if (auto structAttrsJson = parsedDrv->prepareStructuredAttrs(inputRewrites, worker.store, inputPaths)) {
|
||||
if (auto structAttrsJson = parsedDrv->prepareStructuredAttrs(worker.store, inputPaths)) {
|
||||
auto json = structAttrsJson.value();
|
||||
nlohmann::json rewritten;
|
||||
for (auto & [i, v] : json["outputs"].get<nlohmann::json::object_t>()) {
|
||||
/* The placeholder must have a rewrite, so we use it to cover both the
|
||||
cases where we know or don't know the output path ahead of time. */
|
||||
rewritten[i] = rewriteStrings(v, inputRewrites);
|
||||
}
|
||||
|
||||
json["outputs"] = rewritten;
|
||||
|
||||
auto jsonSh = writeStructuredAttrsShell(json);
|
||||
|
||||
writeFile(tmpDir + "/.attrs.sh", rewriteStrings(jsonSh, inputRewrites));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue