rizo / onix

Build OCaml projects with Nix.
54 stars 1 forks source link

Improve error message for missing pkgs #26

Open rizo opened 1 month ago

rizo commented 1 month ago
nix develop -f default.nix -j auto -i -k TERM -k PATH -k HOME -v shell
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/zhzn4n299d4z0cxq50bmbm3sxxhaa7i8-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:334:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/zhzn4n299d4z0cxq50bmbm3sxxhaa7i8-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:381:7:

          380|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          381|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          382|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       error: attribute '""' missing

       at /nix/store/gfh9vqp59rybks8mr7js7qb7qlki3xp0-source/nix/api.nix:325:38:

          324|       rootPkgNames = opamRootsToPackageNames config.opamFiles;
          325|       rootPkgs = builtins.map (name: allPkgs.${name}) rootPkgNames;
             |                                      ^
          326|
       Did you mean one of pp or re?
make: *** [onix.mk:4: shell] Error 1
rizo commented 1 month ago

Caused by using opam instead of pkg_name.opam.