Pass configuration settings to the substituters

Previously substituters could read nix.conf themselves, but this
didn't take --option flags into account.
This commit is contained in:
Eelco Dolstra 2012-07-30 16:09:54 -04:00
parent f9613da180
commit d059bf48e4
5 changed files with 37 additions and 6 deletions

View file

@ -931,6 +931,10 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter &
written in Perl (i.e. all of them) fail. */
unsetenv("DYLD_LIBRARY_PATH");
/* Pass configuration options (including those overriden
with --option) to the substituter. */
setenv("_NIX_OPTIONS", packSettings().c_str(), 1);
fromPipe.readSide.close();
toPipe.writeSide.close();
if (dup2(toPipe.readSide, STDIN_FILENO) == -1)