2021-02-12 21:51:36 +00:00
|
|
|
source common.sh
|
|
|
|
|
2022-04-01 03:57:51 +00:00
|
|
|
enableFeatures "computed-derivations"
|
|
|
|
restartDaemon
|
|
|
|
|
2021-02-12 21:51:36 +00:00
|
|
|
drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath)
|
2022-05-12 20:10:02 +00:00
|
|
|
if nix build "$drv^not-an-output" --json; then
|
2021-02-12 21:51:36 +00:00
|
|
|
fail "'not-an-output' should fail to build"
|
|
|
|
fi
|
|
|
|
|
2022-05-12 20:10:02 +00:00
|
|
|
nix build "$drv^first" --json | jq --exit-status '
|
2021-02-12 21:51:36 +00:00
|
|
|
(.[0] |
|
|
|
|
(.drvPath | match(".*multiple-outputs-a.drv")) and
|
|
|
|
(.outputs |
|
2022-03-25 16:46:28 +00:00
|
|
|
(keys | length == 1) and
|
2022-03-10 17:03:16 +00:00
|
|
|
(.first | match(".*multiple-outputs-a-first")) and
|
|
|
|
(has("second") | not)))
|
2021-02-12 21:51:36 +00:00
|
|
|
'
|