Skip to content

"haskellPackages.extend" and "haskellPackages.override" are incompatible #26561

@ElvishJerricco

Description

@ElvishJerricco

If you use extend to change stuff like the package set, it will remove override, preventing you from doing things like overriding the GHC used, or the all-cabal-hashes. Even if it didn't remove override, I'm guessing the override function installed by nixpkgs.callPackage would operate on the pre-extend object, thus eliminating any extensions added that way.

Fundamentally, I think nixpkgs.callPackage just needs to install an extend function itself, rather than having haskellPackages make its own. It needs to use the self: super: style so that you can extend the package with overrides arbitrarily many times. If it had this, the overrides argument to haskell-modules/default.nix wouldn't be necessary, since it would essentially be a strictly worse version of extend.

$ nix-repl "<nixpkgs>"
nix-repl> ((haskellPackages.extend (self: super: {})).override {}).ghc
error: attribute ‘override’ missing, at (string):1:2

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: haskellGeneral-purpose, statically typed, purely functional programming language

    Projects

    Status

    Enhancements

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions