mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
parent
6925a772d0
commit
77e4802ce2
@ -700,7 +700,7 @@ struct CmdDevelop : Common, MixEnvironment
|
|||||||
// we are about to exec out of this process without running C++ destructors.
|
// we are about to exec out of this process without running C++ destructors.
|
||||||
getEvalState()->evalCaches.clear();
|
getEvalState()->evalCaches.clear();
|
||||||
|
|
||||||
runProgramInStore(store, UseLookupPath::Use, shell, args, buildEnvironment.getSystem());
|
execProgramInStore(store, UseLookupPath::Use, shell, args, buildEnvironment.getSystem());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "command.hh"
|
#include "command.hh"
|
||||||
|
#include "eval.hh"
|
||||||
#include "run.hh"
|
#include "run.hh"
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
@ -99,7 +100,11 @@ struct CmdShell : InstallablesCommand, MixEnvironment
|
|||||||
for (auto & arg : command)
|
for (auto & arg : command)
|
||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
|
|
||||||
runProgramInStore(store, UseLookupPath::Use, *command.begin(), args);
|
// Release our references to eval caches to ensure they are persisted to disk, because
|
||||||
|
// we are about to exec out of this process without running C++ destructors.
|
||||||
|
getEvalState()->evalCaches.clear();
|
||||||
|
|
||||||
|
execProgramInStore(store, UseLookupPath::Use, *command.begin(), args);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "command.hh"
|
#include "command.hh"
|
||||||
#include "installable-value.hh"
|
#include "installable-value.hh"
|
||||||
|
#include "eval.hh"
|
||||||
#include "run.hh"
|
#include "run.hh"
|
||||||
|
|
||||||
using namespace nix;
|
using namespace nix;
|
||||||
@ -49,7 +50,11 @@ struct CmdFmt : SourceExprCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runProgramInStore(store, UseLookupPath::DontUse, app.program, programArgs);
|
// Release our references to eval caches to ensure they are persisted to disk, because
|
||||||
|
// we are about to exec out of this process without running C++ destructors.
|
||||||
|
evalState->evalCaches.clear();
|
||||||
|
|
||||||
|
execProgramInStore(store, UseLookupPath::DontUse, app.program, programArgs);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ std::string chrootHelperName = "__run_in_chroot";
|
|||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
void runProgramInStore(ref<Store> store,
|
void execProgramInStore(ref<Store> store,
|
||||||
UseLookupPath useLookupPath,
|
UseLookupPath useLookupPath,
|
||||||
const std::string & program,
|
const std::string & program,
|
||||||
const Strings & args,
|
const Strings & args,
|
||||||
@ -128,7 +128,11 @@ struct CmdRun : InstallableValueCommand
|
|||||||
Strings allArgs{app.program};
|
Strings allArgs{app.program};
|
||||||
for (auto & i : args) allArgs.push_back(i);
|
for (auto & i : args) allArgs.push_back(i);
|
||||||
|
|
||||||
runProgramInStore(store, UseLookupPath::DontUse, app.program, allArgs);
|
// Release our references to eval caches to ensure they are persisted to disk, because
|
||||||
|
// we are about to exec out of this process without running C++ destructors.
|
||||||
|
state->evalCaches.clear();
|
||||||
|
|
||||||
|
execProgramInStore(store, UseLookupPath::DontUse, app.program, allArgs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ enum struct UseLookupPath {
|
|||||||
DontUse
|
DontUse
|
||||||
};
|
};
|
||||||
|
|
||||||
void runProgramInStore(ref<Store> store,
|
void execProgramInStore(ref<Store> store,
|
||||||
UseLookupPath useLookupPath,
|
UseLookupPath useLookupPath,
|
||||||
const std::string & program,
|
const std::string & program,
|
||||||
const Strings & args,
|
const Strings & args,
|
||||||
|
Loading…
Reference in New Issue
Block a user