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

cabal 3.2.0.0, ghc 8.10.1 does not build packages on macOS #6699

Closed
essandess opened this issue Apr 12, 2020 · 8 comments
Closed

cabal 3.2.0.0, ghc 8.10.1 does not build packages on macOS #6699

essandess opened this issue Apr 12, 2020 · 8 comments

Comments

@essandess
Copy link

essandess commented Apr 12, 2020

I'm trying to use the prebuilt compilation of cabal v. 3.2.0.0 with ghc v. 8.10.1 to update the MacPorts version of hlint and others, but the build fails with errors like these:

:debug:configure system:  cd "/opt/local/var/macports/build/_opt_local_ports_devel_hlint/hlint/work/hlint-2.2.11" && /opt/local/bin/cabal new-configure --prefix=/opt/local --bindir=/opt/local/bin --libdir=/opt/local/lib --libsubdir=hlint --dynlibdir=/opt/local/lib --libexecdir=/opt/local/libexec --libexecsubdir=hlint --datadir=/opt/local/share/hlint --docdir=/opt/local/share/doc/hlint --htmldir=/opt/local/share/doc/hlint --sysconfdir=/opt/local/etc/hlint --enable-documentation --enable-relocatable
:info:configure Resolving dependencies...
:info:configure cabal: Could not resolve dependencies:
:info:configure [__0] trying: hlint-2.2.11 (user goal)
:info:configure [__1] next goal: ghc-lib-parser (dependency of hlint +/-ghc-lib)
:info:configure [__1] rejecting: ghc-lib-parser-8.10.1.20200324 (conflict: hlint +/-ghc-lib =>
:info:configure ghc-lib-parser==8.8.*)
:info:configure [__1] trying: ghc-lib-parser-8.8.3.20200224
:info:configure [__2] next goal: base (dependency of hlint)
:info:configure [__2] rejecting: base-4.14.0.0/installed-4.14.0.0 (conflict: ghc-lib-parser =>
:info:configure base>=4.11 && <4.14)
:info:configure [__2] rejecting: base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, base-4.10.1.0,
:info:configure base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0,
:info:configure base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1,
:info:configure base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0,
:info:configure base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0,
:info:configure base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from
:info:configure non-upgradeable package requires installed instance)
:info:configure [__2] fail (backjumping, conflict set: base, ghc-lib-parser, hlint)
:info:configure non-upgradeable package requires installed instance)
:info:configure [__2] fail (backjumping, conflict set: base, ghc-lib-parser, hlint)
:info:configure After searching the rest of the dependency tree exhaustively, these were the
:info:configure goals I've had most trouble fulfilling: hlint, base, ghc-lib-parser

Related:

@essandess essandess changed the title cabal 3.2.0.0 does not build packages on macOS cabal 3.2.0.0, ghc 8.10.1 does not build packages on macOS Apr 12, 2020
@chshersh
Copy link
Member

@essandess It doesn't look like ghc or cabal issue. You are trying to build hlint version 2.2.11 which depends on older GHC packages. It seems that the latest version of hlint on GitHub is already updated to be compatible with GHC-8.10, but not uploaded to Hackage. You can try building hlint from repository.

@essandess
Copy link
Author

Whoops, thanks, I missed that important detail. Sorry to bug you with this. I'll ask @ndmitchell to update hackage.

We use hackage as source:

https://github.com/macports/macports-ports/blob/e4473e366672ade1b2c809f865a61915c1705e57/devel/hlint/Portfile#L21

@essandess
Copy link
Author

hlint v2.2.11 is uploaded to hackage: http://hackage.haskell.org/package/hlint-2.2.11

I'm downloading from hackage, running this cabal command in the source directory, and getting the errors above. This appears to be an issue with cabal 3.2.0.0 as far as I can tell.

/opt/local/bin/cabal new-configure --prefix=/opt/local --bindir=/opt/local/bin --libdir=/opt/local/lib --libsubdir=hlint --dynlibdir=/opt/local/lib --libexecdir=/opt/local/libexec --libexecsubdir=hlint --datadir=/opt/local/share/hlint --docdir=/opt/local/share/doc/hlint --htmldir=/opt/local/share/doc/hlint --sysconfdir=/opt/local/etc/hlint --enable-documentation --enable-relocatable

@essandess essandess reopened this Apr 12, 2020
@chshersh
Copy link
Member

@essandess I see there was some confusion. hlint-2.2.11 is indeed uploaded to Hackage but the 2.2.11 version is not compatible with GHC-8.10 according to its dependencies. I can see from the Hackage dependencies for hlint the following constraints:

ghc == 8.8.*
ghc-lib-parser == 8.8.*

I advised using the version from GitHub that is compatible with GHC 8.10 according to its code in the hlint.cabal file:

    if !flag(ghc-lib) && impl(ghc >= 8.10.0) && impl(ghc < 8.11.0)
      build-depends:
        ghc == 8.10.*,
        ghc-boot-th,
        ghc-boot
    else
      build-depends:
          ghc-lib-parser == 8.10.*
    build-depends:
        ghc-lib-parser-ex >= 8.10.0.3 && < 8.10.1

Although the value of the version field on GitHub is the same — 2.2.11 — the content of the package on GitHub is not the same as on Hackage. So the actual version of hlint on GitHub is not 2.2.11, it's something different. I can see how this can be confusing. But this is a typical development workflow for Haskell packages:

  1. You release a version to Hackage.
  2. You continue working on your project, implementing features without changing the version in your .cabal file.
  3. Before releasing to Hackage, you evaluate all your changes locally and assign a new version according to your changes, following either PVP or SemVer versioning schemes (or using policeman to detect the new version automatically)

@essandess
Copy link
Author

@chshersh Thank you very much for your help. cc: @ndmitchell

@phadej
Copy link
Collaborator

phadej commented Apr 12, 2020

Doesn't seem to be a Cabal issue.

@phadej phadej closed this as completed Apr 12, 2020
@hvr
Copy link
Member

hvr commented Apr 12, 2020

@essandess for the record, you can consult https://matrix.hackage.haskell.org/package/hlint to see if there exists build-plans for a given GHC

@ndmitchell
Copy link

@essandess - @chshersh is indeed correct. To find the code corresponding to 2.11 in HLint use the 2.11 tag. Otherwise I'd have to make two version changes on every release, and burn up precious version numbers (HLint isn't big enough to have a odd/even stable/unstable pattern).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants