nix-shell: Replace resolving failure error by an assertion

This shouldn’t happen in practice, so better make it explicit
This commit is contained in:
regnat 2021-06-22 11:29:55 +02:00
parent 56605b4688
commit 3b58dbb356

View file

@ -389,8 +389,7 @@ static void main_nix_build(int argc, char * * argv)
if (settings.isExperimentalFeatureEnabled("ca-derivations")) { if (settings.isExperimentalFeatureEnabled("ca-derivations")) {
auto resolvedDrv = drv.tryResolve(*store); auto resolvedDrv = drv.tryResolve(*store);
if (!resolvedDrv) assert(resolvedDrv && "Successfully resolved the derivation");
throw Error("unable to resolve the derivation '%s'. nix-shell cant continue", drvInfo.queryDrvPath());
drv = *resolvedDrv; drv = *resolvedDrv;
} }