aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorArtemis Tosini <lix@artem.ist>2024-05-25 22:14:55 +0000
committerArtemis Tosini <lix@artem.ist>2024-05-25 22:14:55 +0000
commit53e2b0740ca8b034e360f4b1111b9dce1d18f3d5 (patch)
tree00937403771cd794cbe82206db1c9f652a2863a5 /src/libstore
parentdd53bce476805b41f2e9858e64e38574a88db77f (diff)
libstore: remove duplicate builder variable
The `builder` local variable and duplicate `args.push_back` are no longer required since the Darwin sandbox stopped using `sandbox-exec`. The `drv->isBuiltin` check is not required either, as args are not accessed when the builder is builtin. Change-Id: I80b939bbd6f727b01793809921810ff09b579d54
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build/local-derivation-goal.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 2a64d7b5c..9be780212 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -2008,8 +2008,6 @@ void LocalDerivationGoal::runChild()
/* Fill in the arguments. */
Strings args;
- std::string builder = "invalid";
-
#if __APPLE__
/* This has to appear before import statements. */
std::string sandboxProfile = "(version 1)\n";
@@ -2130,15 +2128,9 @@ void LocalDerivationGoal::runChild()
_exit(1);
}
}
+#endif
- builder = drv->builder;
args.push_back(std::string(baseNameOf(drv->builder)));
-#else
- if (!drv->isBuiltin()) {
- builder = drv->builder;
- args.push_back(std::string(baseNameOf(drv->builder)));
- }
-#endif
for (auto & i : drv->args)
args.push_back(rewriteStrings(i, inputRewrites));
@@ -2193,9 +2185,9 @@ void LocalDerivationGoal::runChild()
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
}
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
#else
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
#endif
throw SysError("executing '%1%'", drv->builder);