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

Cabal 3.12 #2309

Open
mniip opened this issue Jan 24, 2025 · 1 comment
Open

Cabal 3.12 #2309

mniip opened this issue Jan 24, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@mniip
Copy link

mniip commented Jan 24, 2025

We're currently experiencing a combination of unfortunate circumstances:

  • We have packages with build-type: Custom in our dependency closure, meaning they depend on setup.Cabal.
  • cabal --enable-multi-repl requires setup.Cabal >= 3.12.
  • cabal freeze writes a freeze file that includes setup.* dependencies, so having a freeze file staged under git requires committing to a single choice of a setup.Cabal version.
  • haskell.nix uses nix-tools compiled against Cabal 3.10.3.0
  • Cabal 3.10's planner requires setup.Cabal < 3.12 in the plan: Does cabal-3.10 impose setup.Cabal < 3.12? haskell/cabal#9917
  • I couldn't figure out how to make haskell.nix use a differently compiled nix-tools.
  • nix-tools does not support Cabal 3.12 anyway
    Cabal ^>=3.12,
    Cabal-syntax ^>=3.12

Would it be possible to migrate nix-tools to Cabal 3.12, or otherwise lift the restriction and have a way for me to override the Cabal version used in nix-tools?

@mniip mniip added the enhancement New feature or request label Jan 24, 2025
@mniip
Copy link
Author

mniip commented Jan 26, 2025

Looks like nix-tools does work with 3.12 actually. There's an allow-newer in its cabal.project:

allow-newer:
algebraic-graphs:deepseq,
hackage-db:base,
hackage-db:Cabal,

and it builds just fine.

I am able to work around this issue by overriding nix-tools for a specific project like so:

pkgs.haskell-nix.cabalProject {
  inherit compiler-nix-name;
  src = ...;
  nix-tools = pkgs.haskell-nix.nix-tools-set {
    inherit compiler-nix-name; # Don't build a new GHC (9.10.1) just for this
    cabalProjectLocal = ''
      constraints:
        Cabal ==3.12.1.0
    '';
};

cabalProjectLocal is not the prettiest, there's probably some better way to do this via modules. And also a better way to override this for the entire pkgs rather than just a single project. (I couldn't figure out how to do either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant