Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

I followed all the instructions mentioned in "Installing ghc-mod" with stack but it had some issues #945

Open
shubhamkumar13 opened this issue Feb 5, 2019 · 3 comments

Comments

@shubhamkumar13
Copy link

`shubham@shubham:~$ stack install ghc-mod
WARNING: Ignoring out of range dependency (allow-newer enabled): Cabal-2.4.1.0. ghc-mod requires: >=1.18 && <1.25
WARNING: Ignoring out of range dependency (allow-newer enabled): base-4.12.0.0. ghc-mod requires: >=4.6.0.1 && <4.10
WARNING: Ignoring out of range dependency (allow-newer enabled): Cabal-2.4.1.0. cabal-helper requires: >=1.14 && <1.25
WARNING: Ignoring out of range dependency (allow-newer enabled): process-1.6.3.0. cabal-helper requires: >=1.1.0.1 && <1.5
WARNING: Ignoring out of range dependency (allow-newer enabled): temporary-1.3. cabal-helper requires: <1.3 && >=1.2.0.4
WARNING: Ignoring out of range dependency (allow-newer enabled): extra-1.6.14. ghc-mod requires: <1.6 && >=1.4
WARNING: Ignoring out of range dependency (allow-newer enabled): ghc-8.6.3. ghc-mod requires: >=7.6 && <8.2
WARNING: Ignoring out of range dependency (allow-newer enabled): ghc-8.6.3. ghc-syb-utils requires: >=7.0 && <8.4
WARNING: Ignoring out of range dependency (allow-newer enabled): haskell-src-exts-1.20.3. ghc-mod requires: <1.20 && >=1.18
WARNING: Ignoring out of range dependency (allow-newer enabled): hlint-2.1.11. ghc-mod requires: <2.1 && >=2.0.8
WARNING: Ignoring out of range dependency (allow-newer enabled): monad-journal-0.8.1. ghc-mod requires: <0.8 && >=0.4
WARNING: Ignoring out of range dependency (allow-newer enabled): optparse-applicative-0.14.3.0. ghc-mod requires: >=0.13.0.0 && <0.14
WARNING: Ignoring out of range dependency (allow-newer enabled): temporary-1.3. ghc-mod requires: <1.3 && >=1.2.0.3
transformers-base-0.4.5.2: configure
transformers-base-0.4.5.2: build
cabal-helper-0.7.3.0: configure
Could not find custom-setup dep: Cabal
ghc-syb-utils-0.2.3.3: configure
djinn-ghc-0.0.2.3: download
ghc-syb-utils-0.2.3.3: build
djinn-ghc-0.0.2.3: configure
transformers-base-0.4.5.2: copy/register
djinn-ghc-0.0.2.3: build
djinn-ghc-0.0.2.3: copy/register
Progress 4/12

-- While building package ghc-syb-utils-0.2.3.3 using:
/home/shubham/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /home/shubham/.stack/global-project/.stack-work/logs/ghc-syb-utils-0.2.3.3.log

Configuring ghc-syb-utils-0.2.3.3...
Preprocessing library for ghc-syb-utils-0.2.3.3..
Building library for ghc-syb-utils-0.2.3.3..
[1 of 1] Compiling GHC.SYB.Utils    ( GHC/SYB/Utils.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/GHC/SYB/Utils.o )

/tmp/stack10061/ghc-syb-utils-0.2.3.3/GHC/SYB/Utils.hs:258:64: error:
    • Couldn't match type ‘RdrName’ with ‘GhcPass pass0’
        arising from a use of ‘ppr’
    • In the second argument of ‘(.)’, namely ‘ppr’
      In the second argument of ‘(.)’, namely ‘showSDoc_ . ppr’
      In the second argument of ‘(.)’, namely
        ‘(++ "}") . showSDoc_ . ppr’
    |
258 |         overLit    = ("{HsOverLit:"++) . (++"}") . showSDoc_ . ppr
    |                                                                ^^^

-- While building package cabal-helper-0.7.3.0 using:
/home/shubham/.stack/programs/x86_64-linux/ghc-8.6.3/bin/ghc --make -odir /tmp/stack10061/cabal-helper-0.7.3.0/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup -hidir /tmp/stack10061/cabal-helper-0.7.3.0/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup -i -i. -clear-package-db -global-package-db -package-db=/home/shubham/.stack/snapshots/x86_64-linux/lts-13.1/8.6.3/pkgdb -package-db=/home/shubham/.stack/global-project/.stack-work/install/x86_64-linux/lts-13.1/8.6.3/pkgdb -hide-all-packages -package=Cabal -package-id=base-4.12.0.0 -package-id=containers-0.6.0.1 -package-id=directory-1.3.3.0 -package-id=filepath-1.4.2.1 -package-id=process-1.6.3.0 -package-id=template-haskell-2.14.0.0 -package-id=transformers-0.5.5.0 -optP-include -optP/tmp/stack10061/cabal-helper-0.7.3.0/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/setup_macros.h /tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs /home/shubham/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack10061/cabal-helper-0.7.3.0/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/setup -threaded
Process exited with code: ExitFailure 1
Logs have been written to: /home/shubham/.stack/global-project/.stack-work/logs/cabal-helper-0.7.3.0.log

[1 of 2] Compiling Main             ( /tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs, /tmp/stack10061/cabal-helper-0.7.3.0/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/Main.o )

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:87:60: error:
    • Couldn't match expected type ‘UnitId’
                  with actual type ‘PathTemplate’
    • In the third argument of ‘substPathTemplate’, namely
        ‘(progPrefix lbi)’
      In the expression:
        substPathTemplate (packageId pd) lbi (progPrefix lbi)
      In an equation for ‘progprefix’:
          progprefix = substPathTemplate (packageId pd) lbi (progPrefix lbi)
   |
87 |         progprefix = substPathTemplate (packageId pd) lbi (progPrefix lbi)
   |                                                            ^^^^^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:88:60: error:
    • Couldn't match expected type ‘UnitId’
                  with actual type ‘PathTemplate’
    • In the third argument of ‘substPathTemplate’, namely
        ‘(progSuffix lbi)’
      In the expression:
        substPathTemplate (packageId pd) lbi (progSuffix lbi)
      In an equation for ‘progsuffix’:
          progsuffix = substPathTemplate (packageId pd) lbi (progSuffix lbi)
   |
88 |         progsuffix = substPathTemplate (packageId pd) lbi (progSuffix lbi)
   |                                                            ^^^^^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:28: error:
    • Couldn't match expected type ‘[a]’
                  with actual type ‘PathTemplate -> FilePath’
    • Probable cause: ‘progprefix’ is applied to too few arguments
      In the first argument of ‘(++)’, namely ‘progprefix’
      In the expression: progprefix ++ exeName exe ++ progsuffix
      In an equation for ‘fixedExeBaseName’:
          fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
    • Relevant bindings include
        fixedExeBaseName :: [a]
          (bound at /tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:9)
   |
89 |         fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
   |                            ^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:42: error:
    • Couldn't match expected type ‘[a]’
                  with actual type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’
    • In the first argument of ‘(++)’, namely ‘exeName exe’
      In the second argument of ‘(++)’, namely
        ‘exeName exe ++ progsuffix’
      In the expression: progprefix ++ exeName exe ++ progsuffix
    • Relevant bindings include
        fixedExeBaseName :: [a]
          (bound at /tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:9)
   |
89 |         fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
   |                                          ^^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:57: error:
    • Couldn't match expected type ‘[a]’
                  with actual type ‘PathTemplate -> FilePath’
    • Probable cause: ‘progsuffix’ is applied to too few arguments
      In the second argument of ‘(++)’, namely ‘progsuffix’
      In the second argument of ‘(++)’, namely
        ‘exeName exe ++ progsuffix’
      In the expression: progprefix ++ exeName exe ++ progsuffix
    • Relevant bindings include
        fixedExeBaseName :: [a]
          (bound at /tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:89:9)
   |
89 |         fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
   |                                                         ^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:91:60: error:
    • Couldn't match type ‘Distribution.System.Platform -> String’
                     with ‘[Char]’
      Expected type: String
        Actual type: Distribution.System.Platform -> String
    • Probable cause: ‘exeExtension’ is applied to too few arguments
      In the second argument of ‘(<.>)’, namely ‘exeExtension’
      In the second argument of ‘(</>)’, namely
        ‘fixedExeBaseName <.> exeExtension’
      In the expression: bindir </> fixedExeBaseName <.> exeExtension
   |
91 |         fixedExeFileName = bindir </> fixedExeBaseName <.> exeExtension
   |                                                            ^^^^^^^^^^^^

/tmp/stack10061/cabal-helper-0.7.3.0/Setup.hs:92:64: error:
    • Couldn't match type ‘Distribution.System.Platform -> String’
                     with ‘[Char]’
      Expected type: String
        Actual type: Distribution.System.Platform -> String
    • Probable cause: ‘exeExtension’ is applied to too few arguments
      In the second argument of ‘(<.>)’, namely ‘exeExtension’
      In the second argument of ‘(</>)’, namely
        ‘fixedExeBaseName <.> exeExtension’
      In the expression: libexecdir </> fixedExeBaseName <.> exeExtension
   |
92 |         newExeFileName   = libexecdir </> fixedExeBaseName <.> exeExtension
   |                                                                ^^^^^^^^^^^^

shubham@shubham:~$
`

Is it incompatible? I also added extra deps in global stack.yaml

@p-alik
Copy link

p-alik commented Mar 2, 2019

I've faced similar issue on NixOS 18.09.

$ stack install ghc-mod --no-copy-bins

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for ghc-mod-5.8.0.0:
    Cabal-2.4.1.0 from stack configuration does not match >=1.18 && <1.25  (latest matching version is 1.24.2.0)
    base-4.12.0.0 from stack configuration does not match >=4.6.0.1 && <4.10  (latest matching version is 4.9.1.0)
    cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version  (latest matching version is 0.7.3.0)
    djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no specified version  (latest matching version is 0.0.2.3)
    extra-1.6.14 from stack configuration does not match <1.6 && >=1.4  (latest matching version is 1.5.3)
    ghc-8.6.3 from stack configuration does not match >=7.6 && <8.2 
    ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no specified version  (latest matching version is 0.2.3.3)
    haskell-src-exts-1.20.3 from stack configuration does not match <1.20 && >=1.18  (latest matching version is 1.19.1)
    hlint-2.1.11 from stack configuration does not match <2.1 && >=2.0.8  (latest matching version is 2.0.15)
    monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4  (latest matching version is 0.7.2)
    optparse-applicative-0.14.3.0 from stack configuration does not match >=0.13.0.0 && <0.14  (latest matching version is 0.13.2.0)
    temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3  (latest matching version is 1.2.1.1)
needed since ghc-mod is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build configuration. This can be convenient when dealing with
    many complicated constraint errors, but results may be unpredictable.

  * Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different GHC version with the matching base.

Plan construction failed.

@Quoteme
Copy link

Quoteme commented Feb 29, 2020

I get the same error as @p-alik :

> stack install ghc-mod

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for ghc-mod-5.8.0.0:
    Cabal-2.4.1.0 from stack configuration does not match >=1.18 && <1.25  (latest matching version
                  is 1.24.2.0)
    base-4.12.0.0 from stack configuration does not match >=4.6.0.1 && <4.10  (latest matching version
                  is 4.9.1.0)
    cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version  (latest
                 matching version is 0.7.3.0)
    djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no specified version  (latest
              matching version is 0.0.2.3)
    extra-1.6.18 from stack configuration does not match <1.6 && >=1.4  (latest matching version is 1.5.3)
    ghc-8.6.5 from stack configuration does not match >=7.6 && <8.2 
    ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no specified version  (latest
                  matching version is 0.2.3.3)
    haskell-src-exts-1.21.1 from stack configuration does not match <1.20 && >=1.18  (latest matching version
                            is 1.19.1)
    hlint-2.1.26 from stack configuration does not match <2.1 && >=2.0.8  (latest matching version is 2.0.15)
    monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4  (latest matching version
                        is 0.7.2)
    optparse-applicative-0.14.3.0 from stack configuration does not match >=0.13.0.0 && <0.14  (latest matching
                                  version is 0.13.2.0)
    temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3  (latest matching version
                  is 1.2.1.1)
needed since ghc-mod is a build target.

Some different approaches to resolving this:

  * Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a
    different GHC version with the matching base.

Plan construction failed.
> stack --version
Version 2.2.0, Git revision 35f5d869558c4ac8c50e33c4930b0b72cb173b8b (dirty) (7929 commits) PRE-RELEASE x86_64
Compiled with:
- Cabal-3.0.1.0
- Glob-0.10.0
- StateVar-1.1.1.1
- aeson-1.4.6.0
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.10.3
- ansi-wl-pprint-0.6.9
- array-0.5.4.0
- asn1-encoding-0.9.6
- asn1-parse-0.9.5
- asn1-types-0.3.3
- async-2.2.2
- attoparsec-0.13.2.3
- attoparsec-iso8601-1.0.1.0
- auto-update-0.1.6
- base-4.13.0.0
- base-compat-0.11.1
- base-orphans-0.8.2
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.3
- basement-0.0.11
- bifunctors-5.5.7
- binary-0.8.7.0
- bitarray-0.0.1.1
- blaze-builder-0.4.1.0
- blaze-html-0.9.1.2
- blaze-markup-0.8.2.3
- bytestring-0.10.10.0
- casa-client-0.0.0
- casa-types-0.0.0
- case-insensitive-1.2.1.0
- cereal-0.5.8.1
- clock-0.8
- colour-2.3.5
- comonad-5.0.6
- conduit-1.3.1.2
- conduit-extra-1.3.4
- connection-0.3.1
- constraints-0.11.2
- containers-0.6.2.1
- contravariant-1.5.2
- cookie-0.4.5
- cryptohash-sha256-0.11.101.0
- cryptonite-0.26
- cryptonite-conduit-0.2.2
- data-default-class-0.1.2.0
- deepseq-1.4.4.0
- digest-0.0.1.2
- directory-1.3.4.0
- distributive-0.6.1
- dlist-0.8.0.7
- easy-file-0.2.2
- echo-0.1.3
- ed25519-0.0.5.0
- either-5.0.1.1
- enclosed-exceptions-1.0.3
- exceptions-0.10.4
- extra-1.6.20
- fast-logger-3.0.1
- file-embed-0.0.11.1
- filelock-0.1.1.4
- filepath-1.4.2.1
- fsnotify-0.3.0.1
- generic-deriving-1.12.4
- ghc-boot-th-8.8.2
- ghc-prim-0.5.3
- githash-0.1.3.3
- hackage-security-0.6.0.0
- hashable-1.2.7.0
- hi-file-parser-0.1.0.0
- hinotify-0.4
- hourglass-0.2.12
- hpack-0.33.0
- hpc-0.6.0.3
- http-api-data-0.4.1.1
- http-client-0.6.4
- http-client-tls-0.3.5.3
- http-conduit-2.3.7.3
- http-download-0.1.0.1
- http-types-0.12.3
- infer-license-0.2.0
- integer-gmp-1.0.2.0
- integer-logarithms-1.0.3
- libyaml-0.1.2
- lifted-async-0.10.0.5
- lifted-base-0.2.3.12
- lukko-0.1.1.1
- megaparsec-7.0.5
- memory-0.15.0
- microlens-0.4.11.2
- microlens-th-0.4.3.4
- mime-types-0.1.0.9
- mintty-0.1.2
- monad-control-1.0.2.3
- monad-logger-0.3.31
- monad-loops-0.4.3
- mono-traversable-1.0.15.1
- mtl-2.2.2
- mustache-2.3.1
- neat-interpolation-0.3.2.6
- network-2.8.0.1
- network-uri-2.6.3.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.15.1.0
- optparse-simple-0.1.1.2
- pantry-0.2.0.0
- parsec-3.1.14.0
- parser-combinators-1.2.1
- path-0.6.1
- path-io-1.5.0
- path-pieces-0.2.1
- pem-0.2.4
- persistent-2.10.5.1
- persistent-sqlite-2.10.6.2
- persistent-template-2.7.4
- pretty-1.1.3.6
- primitive-0.7.0.0
- process-1.6.7.0
- profunctors-5.5.2
- project-template-0.2.0.1
- random-1.1
- regex-applicative-0.3.3.1
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.2.2
- retry-0.8.1.0
- rio-0.1.14.0
- rio-orphans-0.1.1.0
- rio-prettyprint-0.1.0.0
- rts-1.0
- safe-0.3.18
- safe-exceptions-0.1.7.0
- scientific-0.3.6.2
- semigroupoids-5.3.4
- shelly-1.8.1
- silently-1.2.5.1
- socks-0.6.1
- split-0.2.3.3
- stm-2.5.0.0
- stm-chans-3.0.0.4
- streaming-commons-0.2.1.2
- syb-0.7.1
- system-fileio-0.3.16.4
- system-filepath-0.4.14
- tagged-0.8.6
- tar-0.5.1.1
- tar-conduit-0.3.2
- template-haskell-2.15.0.0
- temporary-1.3
- terminal-size-0.3.2.1
- text-1.2.4.0
- text-metrics-0.3.0
- th-abstraction-0.3.2.0
- th-expand-syns-0.4.5.0
- th-lift-0.8.1
- th-lift-instances-0.1.14
- th-reify-many-0.1.9
- time-1.9.3
- time-compat-1.9.2.2
- tls-1.5.4
- transformers-0.5.6.2
- transformers-base-0.4.5.2
- transformers-compat-0.6.5
- type-equality-1
- typed-process-0.2.6.0
- unicode-transforms-0.3.6
- unix-2.7.2.2
- unix-compat-0.5.2
- unix-time-0.4.7
- unliftio-0.2.12
- unliftio-core-0.1.2.0
- unordered-containers-0.2.10.0
- uuid-types-1.0.3
- vector-0.12.1.2
- vector-algorithms-0.8.0.3
- x509-1.7.5
- x509-store-1.6.7
- x509-system-1.6.6
- x509-validation-1.6.11
- yaml-0.11.2.0
- zip-archive-0.4.1
- zlib-0.6.2.1

Warning: this is an unsupported build that may use different versions of
dependencies and GHC than the officially released binaries, and therefore may
not behave identically.  If you encounter problems, please try the latest
official build by running 'stack upgrade --force-download'.

happens on Arch Linux x86_64, Kernel: 5.5.5-arch1-1

@DanielG
Copy link
Owner

DanielG commented Mar 4, 2020

@Quoteme ghc-mod is deprecated and not being maintained anymore, please see the README: https://github.com/DanielG/ghc-mod#legacy

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

No branches or pull requests

4 participants