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: apply-refact version has to match ghc #85617

Merged

Conversation

andys8
Copy link
Member

@andys8 andys8 commented Apr 20, 2020

Motivation for this change

Installation of apply-refact fails with current unstable.

nix-env -f "<nixpkgs>" -iA haskellPackages.apply-refact
Configuring apply-refact-0.8.0.0...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1022:20 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.0.1.0:Distribution.Simple
  defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing or private dependencies:
ghc >=8.10.1, ghc-exactprint >=0.6.3

builder for '/nix/store/9bzq6sgwc9m5s46lfr312amzakhal3w7-apply-refact-0.8.0.0.drv' failed with exit code 1
error: build of '/nix/store/9bzq6sgwc9m5s46lfr312amzakhal3w7-apply-refact-0.8.0.0.drv' failed

This commit maps:

  • ghc 8.6 to apply-refact 0.6
  • ghc 8.8 to apply-refact 0.7
  • ghc 8.10 to apply-refact 0.8

See:

https://hackage.haskell.org/package/apply-refact/changelog
mpickering/apply-refact#56

Things done

I've found: be23568

I tried to create a similar configuration, but I've no idea if it actually works. @peti

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@@ -91,4 +91,7 @@ self: super: {
# ghc versions prior to 8.8.x needs additional dependency to compile successfully.
ghc-lib-parser-ex = addBuildDepend super.ghc-lib-parser-ex self.ghc-lib-parser;

# Only 0.6 is compatible with ghc 8.6 https://hackage.haskell.org/package/apply-refact/changelog
apply-refact = super.apply-refact_0_6_0_0;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for trying to fix this!

However, there are a couple things you'll need to fix up before this can be merged in:

First, Haskell-related PRs should generally be based on the haskell-updates branch (not master), and they should be targetting the haskell-updates branch here on GitHub (not master). Please change this.

Second, this apply-refact_0_6_0_0 derivation unfortunately does not currently exist.

If you do nix repl /some/path/to/nixpkgs, and then type haskellPackages.apply-refact_0_6_0_0 (or haskell.packages.ghc865.apply-refact_0_6_0_0, you should see a message that the derivation can't be found.

However, there is a list of extra derivations to generate here:

extra-packages:
- aeson < 0.8 # newer versions don't work with GHC 7.6.x or earlier
- ansi-terminal == 0.10.3 # required by cabal-plan, and policeman in ghc-8.8.x
- aeson-pretty < 0.8 # required by elm compiler
- apply-refact < 0.4 # newer versions don't work with GHC 8.0.x
- binary > 0.7 && < 0.8 # keep a 7.x major release around for older compilers

If you add something like

- apply-refact == 0.6.0.0
- apply-refact == 0.7.0.0

to this list, then these new derivations will be generated next time the Haskell packages are regenerated.

I think I might have explained a little how this works here? https://discourse.nixos.org/t/haskellpackages-stm-containers-fails-to-build/5416/4

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I tried to integrate it. Is the automatic generation of packages working on haskell-updates only or on forks of it, too?

@andys8 andys8 force-pushed the fix/haskell-apply-refact-version branch from 3d9ff98 to 7a6ca42 Compare April 21, 2020 19:31
@andys8 andys8 changed the base branch from master to haskell-updates April 21, 2020 19:32
@andys8 andys8 force-pushed the fix/haskell-apply-refact-version branch from 7a6ca42 to 48df87e Compare April 21, 2020 19:33
This commit maps:

* GHC 8.6 to apply-refact 0.6
* GHC 8.8 to apply-refact 0.7
* GHC 8.10 to apply-refact 0.8

See:
<https://hackage.haskell.org/package/apply-refact/changelog>
<mpickering/apply-refact#56>
@andys8 andys8 force-pushed the fix/haskell-apply-refact-version branch from 48df87e to 1c70da8 Compare April 21, 2020 19:44
Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for fixing this up!

@cdepillabout cdepillabout merged commit 0f64501 into NixOS:haskell-updates Apr 22, 2020
@cdepillabout
Copy link
Member

Keep a lookout on the haskell-updates branch for the Haskell package set to be regenerated. When that happens, these apply-refact packages should be available.

@andys8
Copy link
Member Author

andys8 commented Aug 27, 2020

Maybe matching versions is not necessary anymore:

https://hackage.haskell.org/package/apply-refact-0.8.2.1/changelog

The current latest version seems to support multiple ghc versions.

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

2 participants