haskell / haskell/cabal

Make Cabal v3 Nix-friendly

Open
#5,858 14 comments 8 reactions 0 assignees View on GitHub
cabal-install: nix integration cabal-install: v2-build system meta: tracking
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

(I couldn't find an issue for this as a high-level thing, so I thought it was worth having one.)

There are a lot of awesome new features in Cabal v3, and I and many others are excited to use them.

However, I'm also a member of another group of users: those who make heavy use of Nix. For a number of reasons, Nix is very popular amongst the Haskell community, and `nixpkgs` builds a huge number of Haskell packages. And many of the industrial users are quite tightly wedded to it - for things like cross-compilation there are few compelling alternatives.

Now, most people using Nix to build Haskell packages do use Cabal. `nixpkgs` uses the lower-level `Setup.hs` machinery, but of course that still depends heavily on Cabal as a library.

So it would be great if Cabal v3 was awesome for Nix users too! I don't think this should be too hard - it mostly just means remembering it as a use case and a few key things like:
- Nix wants to be able to handle providing dependencies. Historically providing a populated package db has worked well for this.
- Nix builds happen in sandboxes that restrict things like network access, external folder access, etc.

Here are some existing issues that I think are relevant to Nix users:
- https://github.com/haskell/cabal/issues/4542 (fixed :tada:)
- https://github.com/haskell/cabal/issues/5783
- https://github.com/haskell/cabal/issues/4770 (maybe fixed?)
- https://github.com/haskell/cabal/issues/5322 (fixed)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked issues 4542, 5783, 4770, and 5322, then examine the Cabal v3 changes relevant to Nix users. Clarify the concrete compatibility gaps around dependency provisioning and sandboxed builds; done should mean those Nix constraints are explicitly supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.