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

haskellPackages.Agda: Fix build for ghc 8.10.2 → 8.10.3 upgrade #107695

Merged
merged 2 commits into from Dec 28, 2020

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Dec 27, 2020

Motivation for this change

Commit 1998b95 “haskellPackages: update default compiler from ghc 8.10.2 to version 8.10.3” broke Agda because Agda.cabal incorrectly declares a transformers dependency only for ghc < 8.10.3:

if impl(ghc >= 8.6.4) && impl(ghc < 8.10.3)
  build-depends: transformers == 0.5.6.2

if impl(ghc >= 8.4) && impl(ghc < 8.6.4)
  build-depends: transformers == 0.5.5.0

if impl(ghc < 8.4)
  build-depends: transformers == 0.5.2.0

leading to this error:

src/full/Agda/Utils/Maybe.hs:13:1: error:
Could not load module ‘Control.Monad.Trans.Maybe’
It is a member of the hidden package ‘transformers-0.5.6.2’.
Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
13 | import Control.Monad.Trans.Maybe
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Things done
  • 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.

Commit 1998b95 “haskellPackages:
update default compiler from ghc 8.10.2 to version 8.10.3” broke Agda
because Agda.cabal incorrectly declares a transformers dependency only
for ghc < 8.10.3:

    if impl(ghc >= 8.6.4) && impl(ghc < 8.10.3)
      build-depends: transformers == 0.5.6.2

    if impl(ghc >= 8.4) && impl(ghc < 8.6.4)
      build-depends: transformers == 0.5.5.0

    if impl(ghc < 8.4)
      build-depends: transformers == 0.5.2.0

leading to this error:

    src/full/Agda/Utils/Maybe.hs:13:1: error:
    Could not load module ‘Control.Monad.Trans.Maybe’
    It is a member of the hidden package ‘transformers-0.5.6.2’.
    Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
       |
    13 | import Control.Monad.Trans.Maybe
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Comment on lines 102 to 106
# Agda 2.6.1.2 only declares a transformers dependency for ghc < 8.10.3.
Agda = appendPatch super.Agda (pkgs.fetchpatch {
url = "https://github.com/agda/agda/commit/76278c23d447b49f59fac581ca4ac605792aabbc.patch";
sha256 = "1g34g8a09j73h89pk4cdmri0nb0qg664hkff45amcr9kyz14a9f3";
});
Copy link
Member

Choose a reason for hiding this comment

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

Could you instead ask an Adga maintainer (or a Hackage maintainer) to make a Hackage revision fixing this? Doing that would fix this for all Haskellers, instead of just here in nixpkgs.

I'm hoping that a Hackage revision would be able to fix something like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it wouldn’t fix it for other Haskellers, because nixpkgs is already carrying a needed patch for ListLike (a dependency of Agda): see commit 7963b44.

I’ve asked anyway in a comment on agda/agda#5109, but I would not be surprised if upstream wants to wait for the ListLike fix, ddssff/listlike#8.

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 asking upstream.

Feel free to ping me here in a few days if they don't end up getting back to you about doing a Hackage revision, and I'll merge this in for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upstream: “No. Unfortunately, if conditions can not be changed in Hackage.”

Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks unfortunate. I was able to confirm that as well with one of my own packages.

Well thanks for going back and forth with me on this. I'll merge this in.

I imagine this will break the next time a new version for Agda is released, so please be on the lookout for that (and feel free to ping me again when you need this patch removed).

@cdepillabout cdepillabout merged commit 13465ac into NixOS:haskell-updates Dec 28, 2020
@iblech
Copy link
Contributor

iblech commented Dec 28, 2020

Just wanted to say thanks to the two of you, @andersk and @cdepillabout, for the quick pull request, review and merge! For keeping the Agdapad up to date, this was exactly what I needed. Now I'm just waiting for unstable to pick that up. Thank you!

@cdepillabout
Copy link
Member

@iblech You may already be aware, but this should get into master when #107593 is merged, and then that should make its way to the unstable channel a day or two after that.

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

4 participants