1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

OutputSpec: Allow all valid output names

Fixes #7624.
This commit is contained in:
Eelco Dolstra 2023-01-18 14:14:29 +01:00
parent d385c13202
commit 95cfd50d25
3 changed files with 13 additions and 11 deletions

View file

@ -42,20 +42,21 @@ nix build -f multiple-outputs.nix --json 'a^*' --no-link | jq --exit-status '
nix build -f multiple-outputs.nix --json e --no-link | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a", "b"]))
(.outputs | keys == ["a_a", "b"]))
'
# But not when it's overriden.
nix build -f multiple-outputs.nix --json e^a --no-link | jq --exit-status '
nix build -f multiple-outputs.nix --json e^a_a --no-link
nix build -f multiple-outputs.nix --json e^a_a --no-link | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a"]))
(.outputs | keys == ["a_a"]))
'
nix build -f multiple-outputs.nix --json 'e^*' --no-link | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a", "b", "c"]))
(.outputs | keys == ["a_a", "b", "c"]))
'
# Test building from raw store path to drv not expression.
@ -104,7 +105,7 @@ nix build "$drv^*" --no-link --json | jq --exit-status '
nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a", "b"]))
(.outputs | keys == ["a_a", "b"]))
'
testNormalization () {

View file

@ -91,9 +91,9 @@ rec {
e = mkDerivation {
name = "multiple-outputs-e";
outputs = [ "a" "b" "c" ];
meta.outputsToInstall = [ "a" "b" ];
buildCommand = "mkdir $a $b $c";
outputs = [ "a_a" "b" "c" ];
meta.outputsToInstall = [ "a_a" "b" ];
buildCommand = "mkdir $a_a $b $c";
};
independent = mkDerivation {