Skip to content

BUG (regression?): Identical values from multiple aspects conflict #674

Description

@dnlzro

Description

When two aspects define the same value on an option, I'd expect those values to merge without issue. But after a recent change (I think), mergeableType in nix/lib/aspects/fx/edges/route.nix is throwing on equal values.

e.g., I had configured enable = true on the same option across multiple aspects, which was fine before, but now my config is broken.

Reproduction

{ denTest, inputs, ... }:
{
  flake.tests.scalar-merge = {
    test-identical-derivations-merge = denTest (
      { config, den, ... }:
      {
        imports = [ inputs.den.flakeOutputs.packages ];

        den.hosts.x86_64-linux.igloo.users.tux = { };

        den.aspects.pkg-one.packages =
          { pkgs, ... }: { shared = pkgs.writeText "shared" "same"; };
        den.aspects.pkg-two.packages =
          { pkgs, ... }: { shared = pkgs.writeText "shared" "same"; };

        den.schema.flake-system.includes = [
          den.aspects.pkg-one
          den.aspects.pkg-two
        ];

        expr = builtins.readFile config.flake.packages.x86_64-linux.shared;
        expected = "same";
      }
    );
  };
}

This fails with den: the option 'shared' has conflicting definitions from multiple aspects.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions