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

Ghc is required but not found. #6

Closed
aljce opened this issue Apr 20, 2016 · 15 comments
Closed

Ghc is required but not found. #6

aljce opened this issue Apr 20, 2016 · 15 comments

Comments

@aljce
Copy link

aljce commented Apr 20, 2016

Getting project config file from STACK_YAML environment
stack will use a locally installed GHCJS
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHCJS and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
Getting project config file from STACK_YAML environment
Ignoring that the GHCJS boot package "scientific" has a different version, 0.3.3.8, than the resolver's wanted version, 0.3.4.4
Ignoring that the GHCJS boot package "case-insensitive" has a different version, 1.2.0.4, than the resolver's wanted version, 1.2.0.5
Ignoring that the GHCJS boot package "hashable" has a different version, 1.2.3.2, than the resolver's wanted version, 1.2.4.0
Ignoring that the GHCJS boot package "async" has a different version, 2.0.1.6, than the resolver's wanted version, 2.1.0
Ignoring that the GHCJS boot package "text" has a different version, 1.2.1.1, than the resolver's wanted version, 1.2.2.0
Ignoring that the GHCJS boot package "syb" has a different version, 0.5.1, than the resolver's wanted version, 0.6
Ignoring that the GHCJS boot package "stm" has a different version, 2.4.4, than the resolver's wanted version, 2.4.4.1
Ignoring that the GHCJS boot package "parallel" has a different version, 3.2.0.6, than the resolver's wanted version, 3.2.1.0
Ignoring that the GHCJS boot package "dlist" has a different version, 0.7.1.1, than the resolver's wanted version, 0.7.1.2
Ignoring that the GHCJS boot package "pretty" has a different version, 1.1.3.2, than the resolver's wanted version, 1.1.2.0
Ignoring that the GHCJS boot package "containers" has a different version, 0.5.6.3, than the resolver's wanted version, 0.5.6.2
Ignoring that the GHCJS boot package "transformers" has a different version, 0.4.3.0, than the resolver's wanted version, 0.4.2.0
happy-1.19.5: configure
happy-1.19.5: build
Progress: 1/6
-- While building package happy-1.19.5 using:
/tmp/stack4329/happy-1.19.5/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /home/kyle/Programming/haskell/try-stack-reflex/.stack-work/logs/happy-1.19.5.log

[1 of 1] Compiling Main             ( /tmp/stack4329/happy-1.19.5/Setup.lhs, /tmp/stack4329/happy-1.19.5/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/setup/Main.js_o )

/tmp/stack4329/happy-1.19.5/Setup.lhs:20:1: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:21:1: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:22:1: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:68:1: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:74:1: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:81:19: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:82:23: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:83:26: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:84:26: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:85:30: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:86:33: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:87:32: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:88:36: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:89:39: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:94:14: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:99:13: Warning: Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:100:17: Warning:
    Tab character

/tmp/stack4329/happy-1.19.5/Setup.lhs:101:23: Warning:
    Tab character
Linking /tmp/stack4329/happy-1.19.5/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/setup/setup.jsexe (Main)
Configuring happy-1.19.5...
Linking /tmp/stack4329/happy-1.19.5/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/setup/setup.jsexe (Main)
Building happy-1.19.5...
Preprocessing executable 'happy' for happy-1.19.5...
[ 1 of 18] Compiling NameSet          ( src/NameSet.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/NameSet.js_o )
[ 2 of 18] Compiling GenUtils         ( src/GenUtils.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/GenUtils.js_o )
[ 3 of 18] Compiling Target           ( src/Target.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Target.js_o )
[ 4 of 18] Compiling AbsSyn           ( src/AbsSyn.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/AbsSyn.js_o )
[ 5 of 18] Compiling ParamRules       ( src/ParamRules.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/ParamRules.js_o )

/tmp/stack4329/happy-1.19.5/src/ParamRules.hs:5:1: Warning:
    Module ‘Control.Monad.Error’ is deprecated:
      Use Control.Monad.Except instead

/tmp/stack4329/happy-1.19.5/src/ParamRules.hs:6:1: Warning:
    Module ‘Control.Monad.Instances’ is deprecated:
      This module now contains no instances and will be removed in the future

/tmp/stack4329/happy-1.19.5/src/ParamRules.hs:31:17: Warning:
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Error, but defined in transformers-0.4.3.0:Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"

/tmp/stack4329/happy-1.19.5/src/ParamRules.hs:71:10: Warning:
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Error, but defined in transformers-0.4.3.0:Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"

/tmp/stack4329/happy-1.19.5/src/ParamRules.hs:72:27: Warning:
    In the use of ‘runErrorT’
    (imported from Control.Monad.Error, but defined in transformers-0.4.3.0:Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
[ 6 of 18] Compiling ParseMonad       ( src/ParseMonad.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/ParseMonad.js_o )
[ 7 of 18] Compiling AttrGrammar      ( src/AttrGrammar.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/AttrGrammar.js_o )
[ 8 of 18] Compiling AttrGrammarParser ( .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/AttrGrammarParser.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/AttrGrammarParser.js_o )
[ 9 of 18] Compiling Grammar          ( src/Grammar.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Grammar.js_o )
[10 of 18] Compiling First            ( src/First.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/First.js_o )
[11 of 18] Compiling LALR             ( src/LALR.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/LALR.js_o )
[12 of 18] Compiling Lexer            ( src/Lexer.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Lexer.js_o )
[13 of 18] Compiling Parser           ( .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Parser.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Parser.js_o )
[14 of 18] Compiling Paths_happy      ( .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/autogen/Paths_happy.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Paths_happy.js_o )
[15 of 18] Compiling ProduceCode      ( src/ProduceCode.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/ProduceCode.js_o )
[16 of 18] Compiling ProduceGLRCode   ( src/ProduceGLRCode.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/ProduceGLRCode.js_o )
[17 of 18] Compiling Info             ( src/Info.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Info.js_o )
[18 of 18] Compiling Main             ( src/Main.lhs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy-tmp/Main.js_o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/happy/happy.jsexe (AbsSyn,AttrGrammar,AttrGrammarParser,First,GenUtils,Grammar,Info,LALR,Lexer,Main,NameSet,ParamRules,ParseMonad,Parser,Paths_happy,ProduceCode,ProduceGLRCode,Target)
setup: The program 'ghc' is required but it could not be found

Do I need a ghc on my path? If so how to I place the stack ghc on my path.

@3noch
Copy link

3noch commented Apr 20, 2016

Do I need a ghc on my path?

Unfortunately, yes.

how do I place the stack ghc on my path.

Here's how I do it: https://github.com/3noch/chess-finder-servant-demo/blob/8d72bd394e3b0effe980a3698e6b8dc923dc80e7/front/Makefile#L13-L17

@aljce
Copy link
Author

aljce commented Apr 20, 2016

Now that I have ghc and happy on my PATH, I am getting this error:
haskell-src-exts-1.17.1: configure
haskell-src-exts-1.17.1: build
Progress: 1/5
-- While building package haskell-src-exts-1.17.1 using:
/home/kyle/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.4.0-ghcjs-0.2.0.20151029_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /home/kyle/Programming/haskell/try-stack-reflex/.stack-work/logs/haskell-src-exts-1.17.1.log

Configuring haskell-src-exts-1.17.1...
Building haskell-src-exts-1.17.1...
Preprocessing library haskell-src-exts-1.17.1...
unused rules: 3
happy: /home/kyle/.stack/snapshots/x86_64-linux/nightly-2015-12-08/7.10.2/share/x86_64-linux-ghc-7.10.2/happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)

@3noch
Copy link

3noch commented Apr 20, 2016

You might be using an old version of GHCJS that, combined with a bug in node, caused errors like that. I wonder if this repo needs to update the GHCJS version.

@aljce
Copy link
Author

aljce commented Apr 20, 2016

how can i udpdate ghcjs?

@3noch
Copy link

3noch commented Apr 20, 2016

Check out my demo project here for an example. Changing the dates on the compiler will get you version from that day's snapshot. https://github.com/3noch/chess-finder-servant-demo/blob/8d72bd394e3b0effe980a3698e6b8dc923dc80e7/front/stack.yaml

@3noch
Copy link

3noch commented Apr 21, 2016

Should have mentioned, that project doesn't build currently. But the GHCJS setup is perfectly legit.

@aljce
Copy link
Author

aljce commented Apr 21, 2016

Alright well stack setup works on the other project so this didnt solve the issue, fails with this again:

contravariant-1.4: copy/register
Progress: 8/21
-- While building package haskell-src-exts-1.17.1 using:
/home/kyle/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.4.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /home/kyle/Programming/haskell/try-stack-reflex/.stack-work/logs/haskell-src-exts-1.17.1.log

Configuring haskell-src-exts-1.17.1...
Building haskell-src-exts-1.17.1...
Preprocessing library haskell-src-exts-1.17.1...
unused rules: 3
happy: /home/kyle/.stack/snapshots/x86_64-linux/nightly-2015-12-08/7.10.2/share/x86_64-linux-ghc-7.10.2/happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)

Any ideas? Should I open a bug with ghcjs?

@3noch
Copy link

3noch commented Apr 21, 2016

Can you post your stack.yaml?

@aljce
Copy link
Author

aljce commented Apr 22, 2016

kyle@Kyles-Laptop:~/Programming/haskell/try-stack-reflex$ cat stack.yaml
resolver: lts-5.1
compiler: ghcjs-0.2.0.20160202_ghc-7.10.2

packages:

extra-deps:

  • ghcjs-dom-0.2.3.1
  • ref-tf-0.4

require-stack-version: ">= 0.1.8"
setup-info:
ghcjs:
source:
ghcjs-0.2.0.20160202_ghc-7.10.2:
url: "http://ghcjs.luite.com/master-20160202.tar.gz"

@3noch
Copy link

3noch commented Apr 22, 2016

Try changing all of the occurrences of 20160202 to something more recent, like 20160422. Then run stack setup. Also you should be using a recent version of node.

@aljce
Copy link
Author

aljce commented Apr 22, 2016

Latest attempt:

kyle@Kyles-Laptop:/Programming/web/try-stack-reflex$ stack setup --stack-setup-yaml=stack.yaml
stack will use a locally installed GHCJS
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHCJS and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
kyle@Kyles-Laptop:
/Programming/web/try-stack-reflex$ stack build
/home/kyle/Programming/web/try-stack-reflex/reflex-todomvc: canonicalizePath: does not exist (No such file or directory)

This is very odd because when I changed the stack.yaml to look like this:

resolver: lts-5.1
compiler: ghcjs-0.2.0.20160422_ghc-7.10.2

packages:

extra-deps:

  • ghcjs-dom-0.2.3.1
  • ref-tf-0.4

require-stack-version: ">= 0.1.8"
setup-info:
ghcjs:
source:
ghcjs-0.2.0.20160422_ghc-7.10.2:
url: "http://ghcjs.luite.com/master-20160422.tar.gz"

It didnt download a new ghcjs.

For completeness:

kyle@Kyles-Laptop:~/Programming/web/try-stack-reflex$ node --version
v4.4.3

@3noch
Copy link

3noch commented Apr 22, 2016

Hmm...that's odd. You definitely want it to download a new GHCJS. Try deleting ~/.ghcjs and maybe ~/.stack and running it again. Also if you're able, you could upgrade node (that's decently old).

@aljce
Copy link
Author

aljce commented Apr 22, 2016

I deleted my .ghcjs but it didnt download the new version. Then I ran stack setup and then stack build this was the error on stack build

kyle@Kyles-Laptop:~/Programming/web/try-stack-reflex$ stack build
/home/kyle/Programming/web/try-stack-reflex/reflex-todomvc: canonicalizePath: does not exist (No such file or directory)

Why isnt stack installing a new version? This is crazy.

@3noch
Copy link

3noch commented Apr 22, 2016

When all else fails, delete ~/.stack. :(

@aljce
Copy link
Author

aljce commented Aug 29, 2016

I am no longer on arch so this issue can no longer be tested.

@aljce aljce closed this as completed Aug 29, 2016
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

2 participants