Test the fake derivations channel, asserting nested packages are properly represented.

This is a breaking change. Previously, packages named `packageset.foo`
would be exposed in the fake derivation channel as `packageset-foo`.

Presumably this was done to avoid needing to track attribute sets, and
to avoid the complexity. I think this now correctly handles the
complexity and properly mirrors the input expressions layout.
This commit is contained in:
Graham Christensen
2021-03-17 11:20:19 -04:00
parent 88e0198a8e
commit 019aef3d41
3 changed files with 109 additions and 5 deletions

View File

@ -0,0 +1,36 @@
with import ./config.nix;
rec {
# Given a jobset containing a package set named X with an interior member Y,
# expose the interior member Y with the name X-Y. This is to exercise a bug
# in the NixExprs view's generated Nix expression which flattens the
# package set namespace from `X.Y` to `X-Y`. If the bug is present, the
# resulting expression incorrectly renders two `X-Y` packages.
packageset = {
recurseForDerivations = true;
deeper = {
recurseForDerivations = true;
deeper = {
recurseForDerivations = true;
nested = mkDerivation {
name = "much-too-deep";
builder = ./empty-dir-builder.sh;
};
};
};
nested = mkDerivation {
name = "actually-nested";
builder = ./empty-dir-builder.sh;
};
nested2 = mkDerivation {
name = "actually-nested2";
builder = ./empty-dir-builder.sh;
};
};
packageset-nested = mkDerivation {
name = "actually-top-level";
builder = ./empty-dir-builder.sh;
};
}