Merge pull request #229 from shlevy/pass-all-inputs

hydra-eval-jobs: Pass all inputs as 'inputs' arg.
This commit is contained in:
Eelco Dolstra 2015-08-04 14:19:23 +02:00
commit 9e33f07cb8

View file

@ -253,16 +253,29 @@ int main(int argc, char * * argv)
EvalState state(searchPath); EvalState state(searchPath);
AutoArgs autoArgs; AutoArgs autoArgs;
Value * inputsSet = state.allocValue();
state.mkAttrs(*inputsSet, autoArgs_.size());
for (auto & i : autoArgs_) { for (auto & i : autoArgs_) {
Symbol inputName = state.symbols.create(i.first);
bool first = true;
for (auto & j : i.second) { for (auto & j : i.second) {
Value * v = state.allocValue(); Value * v = state.allocValue();
if (j[0] == 'E') if (j[0] == 'E')
state.eval(state.parseExprFromString(string(j, 1), absPath(".")), *v); state.eval(state.parseExprFromString(string(j, 1), absPath(".")), *v);
else else
mkString(*v, string(j, 1)); mkString(*v, string(j, 1));
autoArgs[state.symbols.create(i.first)].push_back(v); autoArgs[inputName].push_back(v);
if (first) {
inputsSet->attrs->push_back(Attr(inputName, v));
first = false;
} }
} }
}
Symbol sInputs = state.symbols.create("inputs");
if (autoArgs.find(sInputs) == autoArgs.end()) {
inputsSet->attrs->sort();
autoArgs[sInputs].push_back(inputsSet);
}
store = openStore(); store = openStore();