Skip to content

Using haskell.nix with stack’s nix integration is unsafe due to patches #400

Closed
@kirelagin

Description

@kirelagin

This is a heads-up issue in case someone will be banging their head against the wall as I did today.

haskell.nix backports GHC MR !948. It’s easy to see that this change is breaking the interface of template-haskell. In particular, it breaks singletons:

        • Couldn't match type ‘Integer’ with ‘Int’
          Expected type: q Int
            Actual type: q Uniq
        • In the expression: return n
          In a case alternative: NameU n -> return n
          In a stmt of a 'do' block:
            case flav of
              NameU n -> return n
              _ -> error "Internal error: `qNewName` didn't return a NameU"
       |
    99 |     NameU n -> return n
       |  

haskell.nix also patches singletons to fix this.

However, if you are using stack with Nix integration and the shell file relies on haskell.nix, you’ll get a compiler with the former patch backported, but the singletons patch will not be applied, as stack builds dependencies itself.

I’m not sure there is any moral to this story except for “be careful” and “let’s replace stack and all other similar tools by Nix ASAP”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions