-
Notifications
You must be signed in to change notification settings - Fork 240
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
Use cabal 3.8 #1641
Use cabal 3.8 #1641
Conversation
Includes workarounds for: haskell/cabal#8352 haskell/cabal#8370
bors try |
bors try- |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
I have updated the change log, top comment and PR title to include the new |
I also added haskell/cabal#8455 to the list of cabal issues this PR works around. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still liked the buggy behaviour more. It required less manual intervention. Though I guess this is fair.
If cabal fails to find a pkg-config package, what will it do? Can we sensibly tell people to add those things to the pkgconfig selector?
It depends a bit on the project. In some cases cabal will fall back on a plan that does not require the package version or uses a different automatic flag. When it does give an error it looks like this:
We could perhaps add code to parse |
Perhaps we could create an open haskell.nix issue |
BTW I looked into using another I think the only good way to improve the error message is with a patch for cabal. |
Better to augment the troubleshooting page in the docs? I do agree that it's nice if this can be more automatic, but if it can't then we may have to live with it. Do you have to provide dependencies for your transitive deps? How do packages from hackage work? |
+1 to this Q. If I have a dependency on, say, Out-of-scope thoughts & questions: It would in theory be possible to parse the cabal file before the planning stage and use that to guess at But maybe that's out-of-scope for As-is in this PR, it's not the most annoying thing. But it is a step back and definitely worse for the end-user than |
I have a MR for bumping my Haskell gamedev Nix library to this PR: https://gitlab.com/macaroni.dev/macaroni.nix/-/merge_requests/10 I re-read these comments, and I realized I just need to include all my C deps in my |
This is a very big breaking change, no? What's wrong with just partially reverting the patch in question? |
Its a fairly significant bug in haskell.nix that it does not choose an accurate plan based on the available pkg-config package. |
@yvan-sraka and I came up with a better fix that does not require |
For people in the future wondering (what are they talking about?) here is the description of the
|
overlays/cabal-pkg-config.nix
Outdated
# This is a wrapper for `cabal configure` use only. It returns | ||
# package names and versions based on lib/pkgconf-nixpkgs-map.nix. | ||
# It works because cabal calls `--list-all` then passes all the | ||
# packages returned by that to `--modversion`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth elaborating on this a bit - I think there's quite a bit of latent knowledge here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes more docs to come. I'm still working out what to do about the implicit mapping of pkg-config names to nixpkgs names (we probably can't keep that). Currently I have a script trawling through nixpkgs for .pc
to make a more accurate mapping file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to expand this comment a bit.
bors try |
tryBuild succeeded: |
A bug was fixed in cabal (haskell/cabal#6771) that haskell.nix relied on for
pkg-config
in support. To work around this we added a dummypkg-config
thatcabal configure
now uses when haskell.nix runs itcabal configure
internally. That returns version information for all thepkg-config
packages inlib/pkgconfig-nixpkgs-map.nix
. This mapping has also been expanded based on the results of searching nixpkgs for*.pc
files.This PR also includes workarounds for:
haskell/cabal#8352
haskell/cabal#8370
haskell/cabal#8455
Due to the number of materialization changes in this commit the GitHub make sure to scroll down to to see
overlays
andmodules
code changes (unfortunately you will have to clickLoad diff
).