Commit 66016feb authored by Robert Hensing's avatar Robert Hensing
Browse files

lib.callPackageWith: Use resolveDefaultNix

Tested with:
1. Replace the callPackageWith call by `null`, to simulate an ancient Nix
2. Run the following commands in a terminal in nixpkgs:

    $ mkdir test/

    $ echo '{ asdfasdfasdf }: null' >test/default.nix

    $ nix repl -f .

    nix-repl> callPackage ./test { }
    error:
          … while calling the 'abort' builtin
            at /home/user/src/nixpkgs/lib/customisation.nix:312:7:
              311|     else
              312|       abort "lib.customisation.callPackageWith: ${error}";
                |       ^
              313|

          error: evaluation aborted with the following error message: 'lib.customisation.callPackageWith: Function called without required argument "asdfasdfasdf" at /home/user/src/nixpkgs/test/default.nix'
parent ecc039f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ rec {
            if loc != null then
              loc.file + ":" + toString loc.line
            else if !isFunction fn then
              toString fn + optionalString (pathIsDirectory fn) "/default.nix"
              toString (lib.filesystem.resolveDefaultNix fn)
            else
              "<unknown location>";
        in