hdevtools icon indicating copy to clipboard operation
hdevtools copied to clipboard

Can't build, ghc 7.10?

Open NobbZ opened this issue 10 years ago • 10 comments

Hi there!

I can't build due to following errors:

$ cabal build
The sandbox was created after the package was already configured.
Re-configuring with most recently used options. If this fails, please run
configure manually.
Resolving dependencies...
Configuring hdevtools-0.1.0.5...
Building hdevtools-0.1.0.5...
Preprocessing executable 'hdevtools' for hdevtools-0.1.0.5...
[ 2 of 10] Compiling Info             ( src/Info.hs, dist/build/hdevtools/hdevtools-tmp/Info.o )

src/Info.hs:130:59:
    Not in scope: data constructor ‘GHC.MatchGroup’
    Perhaps you meant one of these:
      variable ‘GHC.mkMatchGroup’ (imported from GHC),
      ‘GHC.DocGroup’ (imported from GHC)

src/Info.hs:164:5:
    Not in scope: ‘Pretty.showDocWith’
    Perhaps you meant ‘Pretty.showDoc’ (imported from Pretty)

src/Info.hs:191:67:
    Not in scope: type constructor or class ‘GHC.PostTcType’
    Perhaps you meant one of these:
      ‘GHC.PostTcExpr’ (imported from GHC),
      ‘GHC.PostTcTable’ (imported from GHC),
      ‘GHC.PostTc’ (imported from GHC)

src/Info.hs:229:12:
    Not in scope:
      type constructor or class ‘PprTyThing.PrintExplicitForalls’

Maybe there are more errors in later modules…

NobbZ avatar Jan 17 '15 10:01 NobbZ

For the PostTcType one, that was broken in this commit from 6 months ago. To fix it, replace GHC.PostTcType with GHC.PostTc GHC.Id Ghc.Type. Doing this, I got loads more errors, though, so I'm delaying a pull request until I can deal with them.

The issues I have are as follows:

  • The above mentioned one. PostTcType is changed to PostTc Id Type. This is a change in the GHC API
  • src/Cabal.hs. The Cabal API changed for GHCOptions, introducing a NubListR datatype, which takes care of the duplication instead of the explicit nubs currently present. Easily fixed.
  • src/Cabal.hs. Within the above sections, the tuples within ghcOptPackages now have a third element following the id. Again easily fixed.
  • src/Cabal.hs. The first parameter of renderGhcOptions is now of type Compiler, and I'm not entirely sure how to safely get a value of that type. I have tried the following, but am not certain of its correctness:
import qualified Distribution.Simple.GHC as GHC(configure)

-- ...

(ghcInfo,_,_) <- GHC.configure silent (Just path) Nothing defaultProgramConfiguration
return $ Right $ renderGhcOptions ghcInfo ghcOpts

adituv avatar Mar 26 '15 16:03 adituv

I've created the beginnings of a fix, but it breaks compatibility with all previous GHC and Cabal versions. If someone could either take my fix and do some CPP magic or advise me on how to do this, that would be excellent.

@schell, your thoughts would be greatly appreciated too.

https://github.com/schell/hdevtools/compare/master...adituv:master

adituv avatar Mar 26 '15 17:03 adituv

@adituv - thanks :+1: I'll take a look ASAP.

schell avatar Mar 26 '15 18:03 schell

BUMP :)

cartazio avatar Apr 03 '15 20:04 cartazio

I'm running into this issue as well.

DilumAluthge avatar Apr 05 '15 15:04 DilumAluthge

Hi all - I've merged @adituv's changes and added CPP conditionals for backward compatibility. Can you guys check and see if it still compiles on 7.10? I'm still on 7.8 and don't want to rebuild my whole toolchain. The changes are in master of schell/hdevtools and the commit is specifically https://github.com/schell/hdevtools/commit/b722973e65de03b0b6ae948f2e95343162fa51f8. Thanks! I'll push to hackage if all is well.

schell avatar Apr 06 '15 15:04 schell

I built https://github.com/schell/hdevtools using GHC 7.10.1. It does build, but with some warnings.

 $ git log -1
commit b722973e65de03b0b6ae948f2e95343162fa51f8
Author: Schell Scivally <[email protected]>
Date:   Mon Apr 6 08:24:34 2015 -0700

    Adds 7.10 support

 $ cabal configure -v
...
Configuring hdevtools-0.1.0.7...
Dependency Cabal ==1.22.2.0: using Cabal-1.22.2.0
Dependency base ==4.8.0.0: using base-4.8.0.0
Dependency cmdargs ==0.10.12: using cmdargs-0.10.12
Dependency directory ==1.2.2.0: using directory-1.2.2.0
Dependency filepath ==1.4.0.0: using filepath-1.4.0.0
Dependency ghc ==7.10.1: using ghc-7.10.1
Dependency ghc-paths ==0.1.0.9: using ghc-paths-0.1.0.9
Dependency network ==2.6.0.2: using network-2.6.0.2
Dependency syb ==0.4.4: using syb-0.4.4
Dependency time ==1.5.0.1: using time-1.5.0.1
Dependency unix ==2.7.1.0: using unix-2.7.1.0
Using Cabal-1.22.2.0 compiled by ghc-7.10
Using compiler: ghc-7.10.1
...
 $ cabal build
Building hdevtools-0.1.0.7...
Preprocessing executable 'hdevtools' for hdevtools-0.1.0.7...
[ 1 of 11] Compiling Paths_hdevtools  ( dist/build/autogen/Paths_hdevtools.hs, dist/build/hdevtools/hdevtools-tmp/Paths_hdevtools.o )
[ 2 of 11] Compiling Info             ( src/Info.hs, dist/build/hdevtools/hdevtools-tmp/Info.o )

src/Info.hs:144:9: Warning: Defined but not used: ‘fm_inst_env’

src/Info.hs:154:5: Warning: Defined but not used: ‘modu’

src/Info.hs:155:5: Warning: Defined but not used: ‘rn_env’

src/Info.hs:156:5: Warning: Defined but not used: ‘ty_env’
[ 3 of 11] Compiling Util             ( src/Util.hs, dist/build/hdevtools/hdevtools-tmp/Util.o )
[ 4 of 11] Compiling Types            ( src/Types.hs, dist/build/hdevtools/hdevtools-tmp/Types.o )
[ 5 of 11] Compiling Daemonize        ( src/Daemonize.hs, dist/build/hdevtools/hdevtools-tmp/Daemonize.o )
[ 6 of 11] Compiling CommandArgs      ( src/CommandArgs.hs, dist/build/hdevtools/hdevtools-tmp/CommandArgs.o )
[ 7 of 11] Compiling Cabal            ( src/Cabal.hs, dist/build/hdevtools/hdevtools-tmp/Cabal.o )

src/Cabal.hs:12:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()

src/Cabal.hs:129:18: Warning: Defined but not used: ‘ghcVersion’
[ 8 of 11] Compiling CommandLoop      ( src/CommandLoop.hs, dist/build/hdevtools/hdevtools-tmp/CommandLoop.o )

src/CommandLoop.hs:13:1: Warning:
    The import of ‘Data.Traversable’ is redundant
      except perhaps to import instances from ‘Data.Traversable’
    To import instances alone, use: import Data.Traversable()
[ 9 of 11] Compiling Server           ( src/Server.hs, dist/build/hdevtools/hdevtools-tmp/Server.o )
[10 of 11] Compiling Client           ( src/Client.hs, dist/build/hdevtools/hdevtools-tmp/Client.o )
[11 of 11] Compiling Main             ( src/Main.hs, dist/build/hdevtools/hdevtools-tmp/Main.o )

src/Main.hs:4:1: Warning:
    The import of ‘Data.Traversable’ is redundant
      except perhaps to import instances from ‘Data.Traversable’
    To import instances alone, use: import Data.Traversable()
Linking dist/build/hdevtools/hdevtools ...

kolmodin avatar Apr 07 '15 11:04 kolmodin

@kolmodin Thanks! I'm taking the plunge and downloading 7.10 right now and will see what I can do about the warnings. I'll then push to hackage unless anyone else gives me some reason not to in that time.

schell avatar Apr 07 '15 16:04 schell

I've updated the warnings for both 7.8 and 7.10 and am uploading to hackage. I can't close this issue though, @bitc will have to at his leisure.

schell avatar Apr 07 '15 20:04 schell

I've added issues to my fork and updated the cabal file so new issues can be reported there where I can maintain them. Thanks.

schell avatar Apr 07 '15 21:04 schell