nixpkgs/pkgs/build-support/fetchgithub
Sergei Trofimovich 6104083817 build-support/fetchgithub: fix metadata eval for arguments without locations
Without the change metadata evaluation fails on package like
`zammad.src` where no fields are defined in `.nix `files:

    src = fetchFromGitHub (lib.importJSON ./source.json);

There evaluation fails as:

    $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta'
    error:
           23|     # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
           24|     position = "${position.file}:${toString position.line}";
             |     ^
           25|   };
       error: value is null while a set was expected

After the change evaluation succeeds as:

    $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta'
    { homepage = "https://github.com/zammad/zammad"; }
2023-12-31 11:44:22 +00:00
..
default.nix build-support/fetchgithub: fix metadata eval for arguments without locations 2023-12-31 11:44:22 +00:00