1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 16:59:35 +01:00

Make the derivation check more lazy

This commit is contained in:
regnat 2021-06-09 20:44:51 +02:00
parent 2324ee4891
commit 3a9753132e

View file

@ -9,6 +9,7 @@
#include "shared.hh"
#include "eval-cache.hh"
#include "attr-path.hh"
#include "value.hh"
#include <regex>
#include <fstream>
@ -100,7 +101,10 @@ struct CmdSearch : InstallableCommand, MixJSON
};
try {
if (state->isDerivation(current)) {
auto maybeTypeField = state->lazyGetAttrField(current, {state->sType}, noPos, *vTmp);
if (maybeTypeField == EvalState::LazyValueType::PlainValue
&& vTmp->type() == nix::nString
&& strcmp(vTmp->string.s, "derivation") == 0) {
size_t found = 0;
state->getAttrFieldThrow(current, {state->sName}, noPos, *vTmp);