nixd
Loading...
Searching...
No Matches
Launch.cpp
Go to the documentation of this file.
1#include "nixd/Eval/Launch.h"
3
4#include <llvm/Support/CommandLine.h>
5
6using namespace llvm::cl;
7using namespace nixd;
8
9namespace {
10
11#define NULL_DEVICE "/dev/null"
12
14 "option-worker-stderr", desc("Directory to write options worker stderr"),
16
18 "nixpkgs-worker-stderr",
19 desc("Writable file path for nixpkgs worker stderr (debugging)"),
21
22} // namespace
23
24void nixd::startAttrSetEval(const std::string &Name,
25 std::unique_ptr<AttrSetClientProc> &Worker) {
26 Worker = std::make_unique<AttrSetClientProc>([&Name]() {
27 freopen(Name.c_str(), "w", stderr);
28 return execl(AttrSetClient::getExe(), "nixd-attrset-eval", nullptr);
29 });
30}
31
32void nixd::startNixpkgs(std::unique_ptr<AttrSetClientProc> &NixpkgsEval) {
34}
35
36void nixd::startOption(const std::string &Name,
37 std::unique_ptr<AttrSetClientProc> &Worker) {
38 std::string NewName = NULL_DEVICE;
39 if (OptionWorkerStderr.getNumOccurrences())
40 NewName = OptionWorkerStderr.getValue() + "/" + Name;
42}
#define NULL_DEVICE
Definition Launch.cpp:11
static const char * getExe()
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
llvm::cl::OptionCategory NixdCategory
void startAttrSetEval(const std::string &Name, std::unique_ptr< AttrSetClientProc > &Worker)
Definition Launch.cpp:24
void startOption(const std::string &Name, std::unique_ptr< AttrSetClientProc > &Worker)
Definition Launch.cpp:36
void startNixpkgs(std::unique_ptr< AttrSetClientProc > &NixpkgsEval)
Definition Launch.cpp:32