1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

Add name to BasicDerivation

We always have a name for BasicDerivation, since we have a derivation
store path that has a name.
This commit is contained in:
Matthew Bauer 2020-07-08 15:38:01 -04:00
parent 7d8d78f06a
commit af95a7c16b
6 changed files with 21 additions and 14 deletions

View file

@ -102,9 +102,11 @@ static void prim_scopedImport(EvalState & state, const Pos & pos, Value * * args
Path realPath = state.checkSourcePath(state.toRealPath(path, context));
StorePath storePath = state.store->parseStorePath(path);
// FIXME
if (state.store->isStorePath(path) && state.store->isValidPath(state.store->parseStorePath(path)) && isDerivation(path)) {
Derivation drv = readDerivation(*state.store, realPath);
if (state.store->isStorePath(path) && state.store->isValidPath(storePath) && isDerivation(path)) {
Derivation drv = readDerivation(*state.store, realPath, std::string(storePath.name()));
Value & w = *state.allocValue();
state.mkAttrs(w, 3 + drv.outputs.size());
Value * v2 = state.allocAttr(w, state.sDrvPath);