Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: for derivation output selection with . #10316

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/functional/flakes/build-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ cat > $flake1Dir/flake.nix <<EOF
a12 = self.drvCall.outPath;

a13 = "\${self.drvCall.drvPath}\${self.drvCall.outPath}";

a14 = with import ./config.nix; mkDerivation {
name = "dot-installable";
outputs = [ "foo" "out" ];
meta.outputsToInstall = [ "out" ];
buildCommand = ''
mkdir \$foo \$out
echo "foo" > \$foo/file
echo "out" > \$out/file
'';
outputSpecified = true;
};
Ericson2314 marked this conversation as resolved.
Show resolved Hide resolved
};
}
EOF
Expand Down Expand Up @@ -94,3 +106,10 @@ nix build --json --out-link $TEST_ROOT/result $flake1Dir#a12

expectStderr 1 nix build --impure --json --out-link $TEST_ROOT/result $flake1Dir#a13 \
| grepQuiet "has 2 entries in its context. It should only have exactly one entry"

# Test accessing output in installables with `.` (foobarbaz.<output>)
nix build --json --no-link $flake1Dir#a14.foo | jq --exit-status '
(.[0] |
(.drvPath | match(".*dot-installable.drv")) and
(.outputs | keys == ["foo"]))
'
Loading