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

Can't build, ghc 7.10? #39

Open
NobbZ opened this issue Jan 17, 2015 · 10 comments
Open

Can't build, ghc 7.10? #39

NobbZ opened this issue Jan 17, 2015 · 10 comments

Comments

@NobbZ
Copy link

NobbZ commented Jan 17, 2015

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…

@adituv
Copy link

adituv commented Mar 26, 2015

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
Copy link

adituv commented Mar 26, 2015

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.

schell/hdevtools@master...adituv:master

@schell
Copy link

schell commented Mar 26, 2015

@adituv - thanks 👍 I'll take a look ASAP.

@cartazio
Copy link

cartazio commented Apr 3, 2015

BUMP :)

@DilumAluthge
Copy link

I'm running into this issue as well.

@schell
Copy link

schell commented Apr 6, 2015

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 schell@b722973. Thanks! I'll push to hackage if all is well.

@kolmodin
Copy link

kolmodin commented Apr 7, 2015

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

@schell
Copy link

schell commented Apr 7, 2015

@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 added a commit to schell/hdevtools that referenced this issue Apr 7, 2015
@schell
Copy link

schell commented Apr 7, 2015

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
Copy link

schell commented Apr 7, 2015

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.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 16, 2016
CHANGELOG:
## 0.1.2.2 - 2016-01-11

 * Added type checking support for tests and benchmarks in stack projects.

and

all changes ( 0.1.0.5 -> 0.1.2.2 ) from https://github.com/hdevtools/hdevtools/

0.1.2.2
- Update to stack lts-4.1, added CHANGELOG, prepare release 0.1.2.2
- Updated LICENSE and maintainers in hdevtools.cabal.
- Fix for when 'dist' is not existing
- Merge pull request #21 from dan-t/fix_for_tests_benchmarks
  Fix compiling of test/benchmark section files
   This ensures that the dependencies of the test and benchmark sections
   are considered and therefore files from these sections can be compiled.
- Merge pull request #19 from dan-t/fix_dist_dir
  Select the right 'dist' directory in the sandbox case
- Add support for passing extra options to Cabal
- update stack.yaml
- add support for ghc-7.8
- move

0.1.2.1, 0.1.2.0
- added FindSymbol to other-modules
- Fixes for ghc < 7.10
- findsymbol: add support for ghc 7.10
- Change help message of findsymbol command
- Load each file/target separately for the 'findsymbol' command
   To be able to continue loading of files and reading their module
   graph if an error occured during the loading of a file, because
   if all files are loaded at once, then GHC stops the loading
   if an error occured.
- Return each module only once
- Don't output any GHC warings/errors for the 'findsymbol' command
- Allow multiple source files for 'findsymbol'
- findsymbol with sourcefile
- Handle GHC exceptions
- Error message for 'findsymbol', if no modules could be found
- Add command findsymbol

0.1.1.9
- cleanup
- only uses stack if stack cmd available
- fixed warnings
- version bump - non-breaking api additions for stack
- added CPP check for GHC version
- Fixes 'unboxed tuples' issue
- Add imports for <$> and <*>
- ok, with the new update, works perfectly with both stack and raw cabal
- next up, how to fix the optP params
- done with Stack module
- update screenshot
- adding --path option to check files placed in temporary directories

0.1.0.9
- Don't crash when there is a leftover socket file
   Previously, when there was a socket file in the current directly
   and no server was running, 'hdevtools check' would fail with:

   hdevtools: bind: resource busy (Address already in use)

0.1.0.8
- Cabal can find ghc

0.1.0.7
- moved issues/homepage link to github.com/schell/hdevtools
- 7.10 support, fixed warnings in 7.10 and 7.8, fixes bitc/hdevtools#39
- Adds 7.10 support
- Merge pull request #1 from rampion/master
  Replace pattern match with func for compatibility

0.1.0.6
- updated cabal for interim hackage takeover
- changes for GHC API 7.8.3
- Adds support for ghc7.8
- Pass path to cabal config from client to server.
   This allows running hdevtools first time from
   anywhere, not just from cabal package's
   (sub)directory.
- Search for .cabal file from target file directory
   Currently search for .cabal file is done from current directory
   which requires that hdevtools is run from package directory or
   it's subdirectory which is not always easy to achieve when
   hdevtools is run from inside editor.
   This fix changes search logic so that .cabal file is searched
   starting from target file's directory (for commands that have
   target file) or from current directory for other commands.
- Switch off cabal support for older GHC versions
- Filter out -Werror from cabal GHC options
- Cabal workaround inplace library dependency
- Add cabal version info to help message
- Support running from cabal package subdirectories
- Add handling of Cabal errors
- Add support for cabalized projects
- Changed showDoc mode 1 to showDoc mode 0
- Updates for changes in GHC API. Fixes #24.
   Updates to GHC API Pretty.showDoc
- Merge pull request #9 from takano-akio/ignore-epipe
  Server shouldn't crash when the client dies
   This commit makes the server not crash when the client dies
   in the middle of command execution.
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

6 participants