valderman / haste-compiler

A GHC-based Haskell to JavaScript compiler
http://haste-lang.org
BSD 3-Clause "New" or "Revised" License
1.45k stars 109 forks source link

Any tips for installing with stack #376

Closed ChristopherKing42 closed 8 years ago

ChristopherKing42 commented 8 years ago

So I tried installing with stack, but it complained about base or something

Here is a paste (its somewhat long): https://gist.github.com/ChristopherKing42/23f416389bfd7259a5f5

It think the important part is this (line 143):

>>>> Cabal errors begin
cabal: Could not resolve dependencies:
next goal: base (user goal)
rejecting: base-4.8.2.0, 4.8.1.0 (global constraint requires ==4.8.0.0)
rejecting: base-4.8.0.0 (only already installed instances can be used)
rejecting: base-4.7.0.2/installed-bfd..., 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1,
4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2,
4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint
requires ==4.8.0.0)
Dependency tree exhaustively searched.
<<<< Cabal errors end

If you're not sure what went wrong, I can always ask on Reddit or StackOverflow.

AphonicChaos commented 8 years ago

@ChristopherKing42 haste installs fine using curated package sets for me (eg, --solver is unnecessary). That is, stack install haste-compiler worked just fine. I should note that I'm using LTS 5.4, though I think it's worked on versions before that (including a few nightlies).

Relevant info for you to compare with:

$ stack --version
Version 0.1.10.1 x86_64
$ ghc --version
The Glorious Glasgo Haskell Compilation System, version 7.10.3
$ cabal --version
cabal-install version 1.22.8.0
using version 1.22.5.0 of the Cabal library
$ uname -a
Linux vapor 4.4.2-1-ARCH #1 SMP PREEMPT Thu Feb 18 12:11:13 CET 2016 x86_64 GNU/Linux
ChristopherKing42 commented 8 years ago

@aspidites I tried it from source.

AphonicChaos commented 8 years ago

Ah. I'm running into issues as well. I filed a ticket as I was getting error messages when trying write a usable stack.yaml file. Even if it's not a bug, feedback I receive there should be relevant.

In the ticket I was using lts-5.5, but 5.4 shoudl suffice. Note that you also need to explicitly include extra deps since they aren't on stackage at all.

mgsloan commented 8 years ago

https://github.com/commercialhaskell/stack/issues/1865#issuecomment-191073022

Here's the config generated by stack init --solver --ignore-subdirs for HEAD of the repo:

resolver: lts-5.5
extra-deps:
- HTTP-4000.2.23
- base-orphans-0.5.3
- ghc-simple-0.3
- shellmate-0.2.3
- tar-0.5.0.1
- text-1.2.2.0

I think the need for extra-deps is due to shellmate's tight version constraint on the HTTP package.

AphonicChaos commented 8 years ago

Thanks, @mgsloan , those steps worked for me. I'll probably put up a PR for adding that stack.yaml file to the repo unless @valderman objects.

@ChristopherKing42 can you confirm that @mgsloan's steps work for you as well?

Note that to boot I did stack exec haste-boot -- --local (note the extra -- which is necessary to pass args).

valderman commented 8 years ago

I'd gladly accept any PR improving stack compatibility. Support is sorely needed, but I haven't had time to work on things in the "very useful, but not very science" category lately.

ChristopherKing42 commented 8 years ago

@mgsloan That seemed to work (although I'm having other problems now.)