den icon indicating copy to clipboard operation
den copied to clipboard

BUG: Class forwarder breaks when imported from mutual provider

Open musjj opened this issue 6 months ago • 5 comments

Reproduction: https://github.com/musjj/forward-bug

Proof of regression: https://github.com/musjj/forward-bug/actions/runs/26342181368

Description

When a class forwarder is imported from a mutual provider aspect, it will fail to forward certain classes. This is a regression from how it behaved in v0.16.0.

{ den, lib, ... }:
let
  nixClass =
    { class, aspect-chain }:
    den._.forward {
      each = [
        "nixos"
        "homeManager"
      ];
      fromClass = _: "nix";
      intoClass = lib.id;
      intoPath = _: [ "nix" ];
      fromAspect = _: lib.head aspect-chain;
      adaptArgs = lib.id;
    };
in
{
  den.hosts.x86_64-linux.igloo.users.tux = { };

  den.default.includes = [ den._.mutual-provider ];

  den.aspects.tux.provides.igloo = {
    includes = [ nixClass ];
    nix.settings.core = 64;
  };
}

Here, nix.settings.core will be forwarded to nixos but not homeManager.

Related:

  • https://github.com/denful/den/discussions/566

musjj avatar May 23 '26 20:05 musjj

@musjj can you confirm this is fixed? If not, we can re-open it and explore further

sini avatar May 29 '26 22:05 sini

Thank you, the test seems to pass but I still can't test it on my main config yet due to several other forwarding bugs. I'll try to make a reproduction of each one of them.

musjj avatar May 29 '26 22:05 musjj

We can re-use this issue.

If you can help me understand the specific edge cases that would be super helpful. Sorry for the regressions.

sini avatar May 29 '26 23:05 sini

Whoops, I've already opened an issue here: https://github.com/denful/den/issues/575

Should I copy it here and close that?

musjj avatar May 29 '26 23:05 musjj

No, you're good.

sini avatar May 29 '26 23:05 sini