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

haskell: get cabal-install 3.0.0.0 building on ghc-8.6.5 and ghc-8.8.1 #67624

Closed

Conversation

cdepillabout
Copy link
Member

@cdepillabout cdepillabout commented Aug 28, 2019

Motivation for this change

Taking a look at hdyra, it appears that cabal-install has recently been updated to 3.0.0.0, but it is failing to build on both GHC-8.6.5 and GHC-8.8.1:

This PR tries to fix cabal-install-3.0.0.0 so it builds on both GHC-8.6.5 and GHC-8.8.1.

Here's a summary of why cabal-install-3.0.0.0 doesn't work on both GHCs, and the changes I made in this PR:

  • GHC-8.6.5:

    • cabal-install requires the resolv package. However, the most recent version of resolv (0.1.1.3) requires base-4.13 (GHC-8.8.1). So this PR makes sure a resolve_0_1_1_2 is generated, and then uses that to build cabal-install. (Although, I haven't actually generated hackage-packages.nix, so this code shouldn't work until hackage-packages.nix is regenerated).
  • GHC-8.8.1:

    • cabal-install has an unnecessary dependency on base <= 4.13, so it has been jailbroken.

    • the regex-base package needs to be jailbroken (and patched) to work with base-4.13 (GHC-8.8.1), however the build-depend is in a conditional, which it appears jailbreak-cabal can't deal with. So I've had to do this by hand.

I also removed the cabal-install-3 derivation, since it isn't needed anymore.

With these changes, I am now able to build cabal-install:

$ nix-build -A haskell.packages.ghc865.cabal-install
/nix/store/91gdifa89jp99123kkklxakkyl234jxb-cabal-install-3.0.0.0
$ nix-build -A haskell.packages.ghc881.cabal-install
/nix/store/ggz9mffjm73kryx517xyja1xx6hakvv1-cabal-install-3.0.0.0
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @peti @infinisil

@cdepillabout
Copy link
Member Author

cdepillabout commented Aug 28, 2019

@GrahamcOfBorg build haskell.packages.ghc865.cabal-install

@GrahamcOfBorg build haskell.packages.ghc881.cabal-install

@GrahamcOfBorg build cabal-install


edit: This was dumb. haskell.packages.ghc865.cabal-install won't be able to be built until hackage2nix is run again and the resolv_0_1_1_2 package is generated for us. When that happens, cabal-install should start building again.

You can see that building haskell.packages.ghc881.cabal-install does currently succeed with this PR though, since it uses the latest version of resolv (0.1.1.3).

@cdepillabout
Copy link
Member Author

Also, I should mention that I was basically just guessing at the correct files to make changes in, so please let me know if I should be making different changes.

@@ -109,13 +96,21 @@ self: super: {
url = "https://raw.githubusercontent.com/hvr/head.hackage/master/patches/cabal-doctest-1.0.6.patch";
sha256 = "0735mkxhv557pgnfvdjakkw9r85l5gy28grdwg929m26ghbf9s8j";
});
QuickCheck = appendPatch super.QuickCheck (pkgs.fetchpatch {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This QuickCheck patch is no longer needed because hackage-packages.nix has a recent version of QuickCheck.

@@ -137,10 +132,6 @@ self: super: {
url = "https://raw.githubusercontent.com/hvr/head.hackage/master/patches/optparse-applicative-0.14.3.0.patch";
sha256 = "068sjj98jqiq3h8h03mg4w2pa11q8lxkx2i4lmxivq77xyhlwq3y";
});
HTTP = appendPatch (doJailbreak super.HTTP) (pkgs.fetchpatch {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch is no longer needed because hackage-packages.nix has a recent version of HTTP.

@@ -85,18 +84,6 @@ self: super: {
sed -i -e 's/time < 1.9/time < 2/' tar.cabal
'';
});
resolv = overrideCabal (overrideSrc super.resolv {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version of resolv now builds with ghc-8.8.1.

@peti peti force-pushed the haskell-updates branch 6 times, most recently from 367d0eb to 79cfb44 Compare September 3, 2019 07:24
@cdepillabout
Copy link
Member Author

cdepillabout commented Sep 4, 2019

@peti Is there anything you'd like me to do to help out with this? It looks like there are some conflicts now, so should I try to fix them and rebase this on the current haskell-updates?

@peti
Copy link
Member

peti commented Sep 4, 2019

should I try to fix them and rebase this on the current haskell-updates?

Yes, that would be very helpful! Please re-base the PR and ping me one more time. I'll take a lot of the remainder of the changes then. Sorry for the delay!

@peti peti force-pushed the haskell-updates branch 3 times, most recently from 3de4c46 to 75388ff Compare September 6, 2019 15:28
@cdepillabout
Copy link
Member Author

Looks like this is all already building on the current haskell-updates branch, so I'm going to go ahead and close it.

Thanks!

@cdepillabout cdepillabout deleted the fix-cabal-install branch September 7, 2019 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants