What is invalid-cabal-flag-settings in base package?


#1

I try to build base-4.11.1.0 (for diagrams-gtk) using cabal2nix and it fail with missing dependency invalid-cabal-flag-settings

$ cabal2nix cabal://base-4.11.1.0 > base.nix

generated base.nix

{ mkDerivation, ghc-prim, invalid-cabal-flag-settings, rts, stdenv
}:
mkDerivation {
  pname = "base";
  version = "4.11.1.0";
  sha256 = "ef005c5d390756da26b31be37584a7990a671d8f65d1ea12443562e2b17b5e60";
  libraryHaskellDepends = [
    ghc-prim invalid-cabal-flag-settings rts
  ];
  description = "Basic libraries";
  license = stdenv.lib.licenses.bsd3;
}

looking on https://hackage.haskell.org/package/base-4.11.1.0 it have invalid-cabal-flag-settings listed as dependency, so I guess it not cabal2nix problem.

What is invalid-cabal-flag-settings dependency?


#2

That dependency comes from this section:

    -- sanity-check to ensure exactly one flag is set
    if !((flag(integer-gmp) && !flag(integer-simple)) || (!flag(integer-gmp) && flag(integer-simple)))
        build-depends: invalid-cabal-flag-settings<0

Looks like somehow both the integer-gmp and integer-simple flags are set?


#3

Do you know if this is the only working way for cabal to do this kind of check or it is just the legacy code that nobody don’t want to touch?

This hack cause the special-case problem on downstream tools like hackage and cabal2nix.


#4

I don’t think it’s the only way, but I also don’t think it’s a legacy hack.