Skip to content

Unable to override Stackage resolver compiler #2039

Closed
@cydparser

Description

@cydparser

I'm unable to build a project that uses lts-21.9 (GHC 9.4.6, which isn't in hackage.nix) when overriding the compiler to GHC 9.4.7. The error output indicates that hackage.nix still looks for the GHC 9.4.6 boot packages:

  at /nix/store/ivkj98w7sd5lps7xdg8bb0xf7gbrf0cg-source/overlays/ghc-packages.nix:188:3:

     187|   # The import nix results for each ghc boot package for each ghc.
     188|   ghc-boot-packages = builtins.mapAttrs
        |   ^
     189|     (ghcName: value: builtins.mapAttrs

  error: attribute 'ghc946' missing

  at /nix/store/ivkj98w7sd5lps7xdg8bb0xf7gbrf0cg-source/overlays/haskell.nix:126:36:

     125|                 pkg-def-extras = [ stack-pkgs.extras
     126|                                    final.ghc-boot-packages.${compiler.nix-name}
        |                                    ^
     127|                                  ]
  Did you mean one of ghc926, ghc941, ghc942, ghc943 or ghc944?

nix-info:

system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.13.5

I can minimally reproduce the error with:

stack.yaml:

resolver: lts-21.9
compiler: ghc-9.4.7
compiler-check: match-exact
packages:
  - '.'

default.nix:

let
  haskell-nix = import (builtins.fetchGit {
    url = "https://github.com/input-output-hk/haskell.nix.git";
    rev = "ad55e20414448da4e8c0ede27362c06f6b1c2ad2";
  }) {};

  pkgs = import haskell-nix.sources.nixpkgs-unstable haskell-nix.nixpkgsArgs;

  project = pkgs.haskell-nix.project {
    src = pkgs.haskell-nix.haskellLib.cleanGit {
      name = "foo";
      src = ./.;
    };
  };
in
  if pkgs.lib.inNixShell
  then project.shellFor {}
  else project

Adding compiler-nix-name = "ghc947"; doesn't help.

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