File tree Expand file tree Collapse file tree 2 files changed +19
-29
lines changed Expand file tree Collapse file tree 2 files changed +19
-29
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,18 @@ cat > $flake1Dir/flake.nix <<EOF
5656 a12 = self.drvCall.outPath;
5757
5858 a13 = "\$ {self.drvCall.drvPath}\$ {self.drvCall.outPath}";
59+
60+ a14 = with import ./config.nix; mkDerivation {
61+ name = "dot-installable";
62+ outputs = [ "foo" "out" ];
63+ meta.outputsToInstall = [ "out" ];
64+ buildCommand = ''
65+ mkdir \$ foo \$ out
66+ echo "foo" > \$ foo/file
67+ echo "out" > \$ out/file
68+ '';
69+ outputSpecified = true;
70+ };
5971 };
6072}
6173EOF
@@ -94,3 +106,10 @@ nix build --json --out-link $TEST_ROOT/result $flake1Dir#a12
94106
95107expectStderr 1 nix build --impure --json --out-link $TEST_ROOT /result $flake1Dir #a13 \
96108 | grepQuiet " has 2 entries in its context. It should only have exactly one entry"
109+
110+ # Test accessing output in installables with `.` (foobarbaz.<output>)
111+ nix build --json --no-link $flake1Dir #a14.foo | jq --exit-status '
112+ (.[0] |
113+ (.drvPath | match(".*dot-installable.drv")) and
114+ (.outputs | keys == ["foo"]))
115+ '
Original file line number Diff line number Diff line change @@ -285,35 +285,6 @@ git -C "$flake3Dir" add flake.lock
285285
286286git -C " $flake3Dir " commit -m ' Add lockfile'
287287
288- # Test accessing output in installables with `.` (foobarbaz.<output>)
289- cat > " $flake3Dir /flake.nix" << EOF
290- {
291- outputs = {self}: {
292- packages.$system .hello = (import ./config.nix).mkDerivation {
293- name = "hello";
294- outputs = [ "foo" "out" ];
295- meta.outputsToInstall = [ "out" ];
296- buildCommand = ''
297- mkdir \$ foo \$ out
298- echo "foo" > \$ foo/file
299- echo "out" > \$ out/file
300- '';
301- outputSpecified = true;
302- };
303- };
304- }
305- EOF
306-
307- cp ../config.nix " $flake3Dir "
308- git -C " $flake3Dir " add flake.nix config.nix
309- git -C " $flake3Dir " commit -m ' multi outputs flake'
310-
311- nix build " $flake3Dir #hello.foo" --json --no-link | jq --exit-status '
312- (.[0] |
313- (.drvPath | match(".*hello.drv")) and
314- (.outputs | keys == ["foo"]))
315- '
316-
317288# Test whether registry caching works.
318289nix registry list --flake-registry " file://$registry " | grepQuiet flake3
319290mv " $registry " " $registry .tmp"
You can’t perform that action at this time.
0 commit comments