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

Build and test with GHC 8.6 (0.8-series) #62

Closed
langston-barrett opened this issue Jan 16, 2019 · 3 comments
Closed

Build and test with GHC 8.6 (0.8-series) #62

langston-barrett opened this issue Jan 16, 2019 · 3 comments

Comments

@langston-barrett
Copy link

It does not appear that cabal-helper is tested using GHC 8.6 (from the gitlab-ci.yml file). When building the latest release (though I haven't tested the latest commit) with GHC 8.6, I get

Building library for cabal-helper-0.8.1.2..
[1 of 4] Compiling CabalHelper.Shared.InterfaceTypes ( src/CabalHelper/Shared/InterfaceTypes.hs, dist/build/CabalHelper/Shared/InterfaceTypes.o )            
[2 of 4] Compiling CabalHelper.Shared.Sandbox ( src/CabalHelper/Shared/Sandbox.hs, dist/build/CabalHelper/Shared/Sandbox.o )                                 
[3 of 4] Compiling Paths_cabal_helper ( dist/build/autogen/Paths_cabal_helper.hs, dist/build/Paths_cabal_helper.o )
[4 of 4] Compiling Distribution.Helper ( lib/Distribution/Helper.hs, dist/build/Distribution/Helper.o )

lib/Distribution/Helper.hs:383:3: error:
    • Could not deduce (Control.Monad.Fail.MonadFail m)
        arising from a do statement
        with the failable pattern ‘[Just (ChResponseVersion pkgName
                                                            pkgVer)]’
      from the context: MonadQuery m
        bound by the type signature for:
                   getPackageId :: forall (m :: * -> *).
                                   MonadQuery m =>
                                   m (String, Version)
        at lib/Distribution/Helper.hs:381:1-51
      Possible fix:
        add (Control.Monad.Fail.MonadFail m) to the context of
          the type signature for:
            getPackageId :: forall (m :: * -> *).
                            MonadQuery m =>
                            m (String, Version)
    • In a stmt of a 'do' block:
        [Just (ChResponseVersion pkgName pkgVer)] <- readHelper
                                                       ["package-id"]
      In the expression:
        do [Just (ChResponseVersion pkgName pkgVer)] <- readHelper
                                                          ["package-id"]
           return (pkgName, pkgVer)
      In the second argument of ‘(>>=)’, namely
        ‘\ QueryEnv {..}
           -> do [Just (ChResponseVersion pkgName pkgVer)] <- readHelper [...]
                 return (pkgName, pkgVer)’
    |
383 |   [ Just (ChResponseVersion pkgName pkgVer) ] <- readHelper [ "package-id" ]                                                                           
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                           
@DanielG
Copy link
Owner

DanielG commented Jan 22, 2019

Indeed this version was released way before GHC 8.6 came out, so duh. The dependency bounds also seem to correctly exclude 8.6 when using cabal. AFAIK Nix's tooling is just being stupid here by even allowing this to get to compilation without informing the user the package versions are actually out of bounds.

Anyways I started fixing 8.6 on the 0.8-series branch, it compiles but one of the Cabal compilation tests fails not sure if thats our fault or Cabal-2.2.0.1 just doesn't support being compiled with GHC 8.6: https://gitlab.com/dxld/cabal-helper/pipelines/43773099 (see log below).

The next release will have full support for 8.6 but I don't have time to figure this out for the old release series. If you need this and want to help figuring out if Cabal-2.2.0.1 is supposed to compile with 8.6 would be a start.

CI log for referecen:

====== Compiling with Cabal-2.2.0.1
cabal-helper-wrapper: Installing a private copy of Cabal because we couldn't
find the right version in your global/user package-db, this might take a
while but will only happen once per Cabal version you're using.

If anything goes horribly wrong just delete this directory and try again:
    /tmp/compile-test-home/.cache/cabal-helper

If you want to avoid this automatic installation altogether install
version 2.2.0.1 of Cabal manually (into your user or global package-db):
    $ cabal install Cabal --constraint "Cabal == 2.2.0.1"

Installing Cabal 2.2.0.1 ...
cd /tmp/cabal-helper-Cabal-source-b25afa7aef82c708; cabal get Cabal-2.2.0.1
Downloading  Cabal-2.2.0.1
Downloaded   Cabal-2.2.0.1
Unpacking to Cabal-2.2.0.1/
ghc-pkg --numeric-version
=> 8.6.2

ghc-pkg init /tmp/compile-test-home/.cache/cabal-helper/cabal-helper0.8.1.2-Cabal2.2.0.1-ghc8.6.2.package-db
ghc-pkg --numeric-version
=> 2.4.0.0

cd /; cabal --package-db=clear --package-db=global --package-db=/tmp/compile-test-home/.cache/cabal-helper/cabal-helper0.8.1.2-Cabal2.2.0.1-ghc8.6.2.package-db --prefix=/tmp/compile-test-home/.cache/cabal-helper/cabal-helper0.8.1.2-Cabal2.2.0.1-ghc8.6.2.package-db/prefix --with-ghc=ghc --no-require-sandbox install /tmp/cabal-helper-Cabal-source-b25afa7aef82c708/Cabal-2.2.0.1 -v --only-dependencies
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

/usr/bin/alex --version
/usr/bin/gcc -dumpversion
looking for tool haddock near compiler in /usr/local/bin
found haddock in /usr/local/bin/haddock
/usr/local/bin/haddock --version
/usr/bin/happy --version
looking for tool hpc near compiler in /usr/local/bin
found hpc in /usr/local/bin/hpc
/usr/local/bin/hpc version
looking for tool hsc2hs near compiler in /usr/local/bin
found hsc2hs in /usr/local/bin/hsc2hs
/usr/local/bin/hsc2hs --version
/usr/local/bin/ghc -hide-all-packages -c /tmp/18582-0.c -o /tmp/18582-1.o
/usr/bin/ld.gold -x -r /tmp/18582-1.o -o /tmp/18582-2.o
looking for tool runghc near compiler in /usr/local/bin
found runghc in /usr/local/bin/runghc
/usr/local/bin/runghc --version
/bin/tar --help
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2019-01-18T16:13:00Z
Failed to query pkg-config, Cabal will continue without solving for pkg-config
constraints: dieVerbatim: user error (CallStack (from HasCallStack):
die', called at libraries/Cabal/Cabal/Distribution/Simple/Program/Db.hs:423:28
in Cabal-2.4.0.1:Distribution.Simple.Program.Db
requireProgram, called at ./Distribution/Solver/Types/PkgConfigDb.hs:65:21 in
main:Distribution.Solver.Types.PkgConfigDb
cabal: The program 'pkg-config' is required but it could not be found.
)
Resolving dependencies...
In order, the following would be installed:
containers-0.5.11.0 (latest: 0.6.0.1) (via: binary-0.8.6.0) (new version)
binary-0.8.6.0 (latest: 0.10.0.0) (via: text-1.2.3.1) (reinstall) (changes:
containers-0.6.0.1 removed)
text-1.2.3.1 (via: parsec-3.1.13.0) (reinstall) (changes: binary-0.8.6.0
removed)
parsec-3.1.13.0 (reinstall) (changes: text-1.2.3.1 removed)
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/Install.hs:567:56 in main:Distribution.Client.Install
cabal: The following packages are likely to be broken by the reinstalls:
Cabal-2.4.0.1
libiserv-8.6.1
ghci-8.6.2
ghc-8.6.2
ghc-boot-8.6.2
Use --force-reinstalls if you want to install anyway.

@DanielG DanielG changed the title Build and test with GHC 8.6 Build and test with GHC 8.6 (0.8-series) Jan 22, 2019
DanielG added a commit that referenced this issue May 18, 2019
@DanielG
Copy link
Owner

DanielG commented May 18, 2019

@DanielG DanielG closed this as completed May 18, 2019
@juhp
Copy link

juhp commented May 19, 2019

Thanks - just for the record, I managed to build cabal-helper-0.8.1.0 for Fedora 30 (basically LTS 12) with these bounds changes:

cabal-tweak-dep-ver cabal-plan '< 0.4' '< 0.5'
cabal-tweak-dep-ver temporary  '< 1.3' '< 1.4'

See https://src.fedoraproject.org/rpms/ghc-cabal-helper/c/59086368b5300a300c4fc95ee1f36dd51d5b2208 for full details about the Fedora package.

Edit: ah but you don't recommend using 0.8.1.0 and 0.8.1.1?

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

3 participants