-
Notifications
You must be signed in to change notification settings - Fork 696
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
Make Cabal v3 Nix-friendly #5858
Comments
Hi Michael, thanks for you summary. I'm however slightly confused. You say
Yet all the issues is about Let's not mix two things:
I assume you experience problems with the last point? Don't use Nix and So there are two ways:
For comparison:
TL;DR we (well, nix users) need |
@phadej thanks for the ping. In fact we do use nix-tools in production. @michaelpj will soon as well (ha!). Not to derail this discussion much, but nix-tools does contain |
@phadej thanks, this is very clarifying. Indeed, despite using Nix for building at scale we do also use I want to highlight two cases: development workflow, and niceties of My typical development workflow when working on a package consists of:
I've tried to replicate this across several packages using
I think So here's a question: what would it take to persuade Cabal to accept some dependencies that I've already built? Can we transfer packages from a package db? Could we instead construct a store in the form that Cabal v3 expects and point it at it? (I believe that last point is already doable by setting |
It does already pick them up if they're registered in the global pkg-db; that's e.g. how cabal is able to use the pre-built packages provided by Linux distros (e.g. Debian has about 800 Haskell libraries from Hackage pre-built, and cabal tries to use them if possible!) |
Huh, great. I thought I had observed this not happening - let me see if I can reproduce that, and if so I'll report a bug. |
Nope, can't reproduce, looks like I was doing something weird. So it looks like things are in a better place than I thought they were, hooray! I think my only real complaint now is |
While perhaps not a
|
For the record, quite a while ago I played around with the second option here but never was quite satisfied with the result. |
Prompted by this discussion and necessity, I sat down this afternoon to clean up the In short, it allows |
(I actually typed up this answer already 2 days ago but failed to send it) @bgamari btw, your problem is yet another one which is not Nix specific at all, but occurs with other Linux distributions such as Debian-derived or Redhat-derived ones as well which provide packaged C libraries, and therefore this is a well known issue; and there's an old idea that never got implemented on how to address this which aims to extend the At this point I'm starting to think that we don't need any Nix specific features at all in cabal; all problems I've heard so far about Nix-integration are merely specific instances of a more general problems that actually affect a larger target audience as well and therefore ought to be addressed by a slightly more general mechanism. |
Right. Note that there is also another issue with the current incarnation of |
that's not a problem with the incarnation though but rather a problem with how people use it; ideally you'd rather have it behind an automatic flag where the branch using the However, there's something you wouldn't be able to express currently; and to address this case I wanted to see something like a "have(pkgconfig)" conditional:
this would provide a way to be more explicit about which fallback strategy to use. These
|
Does this issue also include that If so, it there a "workaround"? Hmm, I just noticed that |
#5783 should be kind of fixed once cabal-install-3.4 reaches nixpkgs: #4821 (comment) But maybe we want to patch/ build the package in Nix with that option enabled by default? |
(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-levelSetup.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:
Here are some existing issues that I think are relevant to Nix users:
The text was updated successfully, but these errors were encountered: