Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create shell with cabal-fmt and GHC 9.10 #2205

Closed
m4dc4p opened this issue May 22, 2024 · 3 comments
Closed

Can't create shell with cabal-fmt and GHC 9.10 #2205

m4dc4p opened this issue May 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@m4dc4p
Copy link

m4dc4p commented May 22, 2024

Describe the bug

When trying to create a shell with GHC 9.10.1 and cabal-fmt, the build fails with the following error:

error: The Haskell package set does not contain the package: os-string (build dependency).

This is using the latest haskell.nix.

Steps To Reproduce

This isn't a complete expression but hopefully enough to repro:

{ system ? builtins.currentSystem, compiler-nix-name ? "ghc910" }:
let 
  sources = import ./nix/sources.nix;
  haskell-nix = import sources."haskell.nix" {  };
  
  pkgs = import sources.nixpkgs (haskell-nix.nixpkgsArgs // { inherit system; });

  project = pkgs.haskell-nix.project' {
    inherit compiler-nix-name;
    src = ./.;

    shell = {
      tools = {
        cabal-fmt = {
          version = "latest";
          configureArgs = "--allow-newer=base";
        };
      };
    };
  };
    
in
  { 
    shell = project.shell;
  }

Running nix-shell -A shell will show the problem.

@m4dc4p m4dc4p added the bug Something isn't working label May 22, 2024
@hamishmack
Copy link
Collaborator

I think this should have been fixed by #2207.

@m4dc4p
Copy link
Author

m4dc4p commented Jul 12, 2024

Good to hear! After I posted this, I learned I could have tools compiled by a different version of GHC. For something like cabal-fmt, it was simple to have it continue to be compiled by GHC 9.6, even though I was using 9.10 in my shell.

Thanks for circling back!

@m4dc4p m4dc4p closed this as completed Jul 12, 2024
dhess added a commit to hackworthltd/primer that referenced this issue Jul 18, 2024
Note that Protolude upstream doesn't support GHC 9.10, so we use
a (hopefully temporary) fork.

Temporary workarounds required:

* Disable `hlint`: ndmitchell/hlint#1594
* Disable `cabal-fmt`: input-output-hk/haskell.nix#2205

Signed-off-by: Drew Hess <src@drewhess.com>
dhess added a commit to hackworthltd/primer that referenced this issue Jul 18, 2024
Note that Protolude upstream doesn't support GHC 9.10, so we use
a (hopefully temporary) fork.

Temporary workarounds required:

* Disable `hlint`: ndmitchell/hlint#1594
* Disable `cabal-fmt`: input-output-hk/haskell.nix#2205

Signed-off-by: Drew Hess <src@drewhess.com>
@dhess
Copy link
Contributor

dhess commented Jul 18, 2024

I think this should have been fixed by #2207.

Sorry for being dense, but how, exactly? I've tried adding constraints: os-string installed and constraints: os-string source to cabal.project to no avail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants