Skip to content

Cannot start new haskell project due to missing system-cxx-std-lib #2280

Closed
@tathougies

Description

@tathougies

Describe the bug

I started a new haskell.nix project. Previously, I've started many projects using haskell.nix. I set everything up as usual, but when I try to run cabal v2-build for my project (which depends on text), I get the following error:

Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: coopt-types-0.0.0 (user goal)
[__1] trying: text-2.1.2 (dependency of coopt-types)
[__2] trying: text:-pure-haskell
[__3] trying: text:+simdutf
[__4] unknown package: system-cxx-std-lib (dependency of text -pure-haskell +simdutf)
[__4] fail (backjumping, conflict set: system-cxx-std-lib, text, text:pure-haskell, text:simdutf)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, text, bytestring, template-haskell, text:simdutf, text:pure-haskell, system-cxx-std-lib, coopt-types
Try running with --minimize-conflict-set to improve the error message.

A clear and concise description of what the bug is, including:

  • Build system: x86_64-linux
  • GHC version: 9.10.1
  • Haskell.nix version (or commit) used: haskellNix: github:input-output-hk/haskell.nix/54ddc77cd29c19779489d8f7fae14d70e90d8c68

Steps To Reproduce

flake.nix:

{
  description = "Compiler toolkit for Haskell";
  inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
  inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils, haskellNix }:
    flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
    let
      overlays = [ haskellNix.overlay
        (final: prev: {
          # This overlay adds our project to pkgs
          cooptProject =
            final.haskell-nix.project' {
              src = ./.;
              compiler-nix-name = "ghc9101";
              # This is used by `nix develop .` to open a shell for use with
              # `cabal`, `hlint` and `haskell-language-server`
              shell.tools = {
                cabal = {};
                #                hlint = {};
                hpack = {};
                haskell-language-server = {};
              };
              # Non-Haskell shell tools go here
              shell.buildInputs = with pkgs; [
                nixpkgs-fmt
              ];
              # This adds `js-unknown-ghcjs-cabal` to the shell.
              # shell.crossPlatforms = p: [p.ghcjs];
            };
        })
      ];
      pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
      flake = pkgs.cooptProject.flake {
        # This adds support for `nix build .#js-unknown-ghcjs:hello:exe:hello`
        # crossPlatforms = p: [p.ghcjs];
      };
    in flake // {
      # Built by `nix build .`
      packages.default = flake.packages."coopt:lib:coopt";
    });
}

cabal.project:

packages:
        coopt-types

coopt-types/coopt-types.cabal:

cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

name:           coopt-types
version:        0.0.0
build-type:     Simple

library
  exposed-modules:
      Coopt.Types
  other-modules:
      Paths_coopt_types
  build-depends:
      base
    , fingertree
    , text
  default-language: Haskell2010

To reproduce:

run nix develop, and then try to run cabal v2-build coopt-types

Expected behavior

It should resolve packages and compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions