lorri icon indicating copy to clipboard operation
lorri copied to clipboard

Better error message if a `buildInput` is not a drv

Open Profpatsch opened this issue 3 years ago • 1 comments

When I you lorri init and add a packageset to the buildInputs instead of a drv, e.g. pkgs.eclipses, the resulting error message is very bad:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    pkgs.hello
    pkgs.eclipses
  ];
}

=>

…
LogLine("error: cannot coerce a set to a string, at /home/philip/.cache/lorri/cas/3a83fbad2f114b4f4f431db2014c985c:40:7"), LogLine("(use \'--show-trace\' to show detailed location information)")] } })

It comes out of our own nix file, so I’m pretty certain we can add a check that throws a better error message.

Profpatsch avatar May 05 '21 08:05 Profpatsch

You'll want to do this for at least nativeBuildInputs.

buildInputs isn't quite suitable for developer tools, build tools and such. Such a shell will break with strictDeps.

roberth avatar Aug 21 '21 21:08 roberth