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

GHCJS resolver doesn't work #982

Closed
novaluke opened this issue Sep 11, 2015 · 6 comments
Closed

GHCJS resolver doesn't work #982

novaluke opened this issue Sep 11, 2015 · 6 comments

Comments

@novaluke
Copy link

Following the information here results in:

$ stack --version
Version 0.1.4.1 (UNKNOWN commits) X86_64
$ ghcjs --version
The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.1.0 (GHC 7.10.2)
$ stack build --resolver ghcjs-0.1.0_ghc-7.10.2
No compiler found, expected minor version match with ghcjs-0.1.0_ghc-7.10.2 (x86_64) (based on resolver setting in /path/to/project/stack.yaml). Try running stack setup to locally install the correct GHC

On the other hand, using an invalid resolver value provides this message:

option --resolver: Invalid resolver value: foo. Possible valid values include lts-2.12, nightly-YYYY-MM-DD, ghc-7.10.2, and ghcjs-0.1.0-ghc-7.10.2.

So I tried to use the value given by the error message, but apparently using that resolver value does not work either:

$ stack build --resolver ghcjs-0.1.0-ghc-7.10.2
option --resolver: Invalid resolver value: ghcjs-0.1.0-ghc-7.10.2. Possible valid values include lts-2.12, nightly-YYYY-MM-DD, ghc-7.10.2, and ghcjs-0.1.0-ghc-7.10.2. See https://www.stackage.org/snapshots for a complete list.
@mgsloan
Copy link
Contributor

mgsloan commented Sep 12, 2015

The error message has been fixed in the development version, sorry about that 06d71e4

You need to have that version of GHCJS on your path, such that ghcjs --version reports that version. Then, it should work. stack setup is not yet supported for ghcjs, but the imminent plan is to have stack setup install things from source.

@novaluke
Copy link
Author

Ah ok, that clears up which resolver value is the correct one, thanks.

I think (somewhat sheepishly) that perhaps my problem was not running ghcjs-boot before trying to use it with stack, since I've done that now and it's no longer complaining that it can't find the compiler. It's now complaining about finding dependencies, so I'm assuming that I've made it past the original issue in this thread. Thanks again!

@nrolland
Copy link
Contributor

is there a guide/overview/reference on how to develop in ghcjs using stack ?

@mgsloan
Copy link
Contributor

mgsloan commented Sep 25, 2015

@nrolland Not yet, somewhat because "stack setup" didn't yet support it. However, that changed recently - #749 !

It's on my TODO list to add a template for GHCJS and write a guide on how to use it, good idea!

@nrolland
Copy link
Contributor

Cool! Anything, however primitive would be useful to serve as a starting point and reference.

Stack and ghcjs are both very exciting pieces of the Haskell ecosystem.

@mgsloan
Copy link
Contributor

mgsloan commented Sep 25, 2015

A really quick tutorial would be:

Put this in your stack.yaml, next to the cabal file for your ghcjs project (just a standard cabal file)

resolver: ghcjs-0.1.0.20150924_ghc-7.10.2
compiler-check: match-exact

Run stack setup to install it (will take a while, it builds a lot of stuff). Then, stack build, and it should build. Then, you can find the output in the directory yielded by stack path --local-install-root

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