nixpkgs/pkgs/stdenv/generic
Graham Christensen b80c9ce4a9
stdenv: Validate meta.outputsToInstall
If meta.outputsToInstall is set to include absent outputs, various
tools break including channel updates and nix-env.

    grahamc@Morbo> nix-env -i -f . -A elf-header-real
    installing 'elf-header'
    error: this derivation has bad 'meta.outputsToInstall'

This patch verifies each value in meta.outputsToInstall is a valid
output. It validates this condition only if checkMeta is true.

    grahamc@Morbo> nix-build . -A elf-header-real
    error: Package ‘elf-header’ in /home/grahamc/projects/nixpkgs/pkgs/development/libraries/elf-header/default.nix:36 has invalid meta.outputsToInstall, refusing to evaluate.

    The package elf-header has set meta.outputsToInstall to: bin

    however elf-header only has the outputs: out

    and is missing the following ouputs:

      - bin

    (use '--show-trace' to show detailed location information)

Note, now the nix-env experience is decidedly worse for users who have
checkMeta set to true:

    grahamc@Morbo> nix-env -i -f . -A elf-header-real; echo $?
    0

though since this is already an issue for unfree, broken, unsupported,
and insecure validity problems I'm not sure we should do something
different here.
2018-09-18 10:38:44 -04:00
..
builder.sh stdenvs: Distinguish between extraBuildInputs and extraNativeBuildInputs 2017-08-18 12:02:13 -04:00
check-meta.nix stdenv: Validate meta.outputsToInstall 2018-09-18 10:38:44 -04:00
default-builder.sh
default.nix top-level, stdenv: Make system and stdenv.system describe the hostPlatform. 2018-09-06 08:33:51 -04:00
make-derivation.nix mkDerivation: Fix cross compilation 2018-09-03 23:18:24 -04:00
setup.sh stdenv/build-support: support .tbz and .txz tarballs 2018-07-30 15:30:16 -04:00