yamafaktory / reflex-starter

A simple starter project for building Reflex applications with Stack.
BSD 3-Clause "New" or "Revised" License
36 stars 3 forks source link

Build fails with recent versions of node (v6.6.0, v6.7.0) #3

Open jonathanknowles opened 8 years ago

jonathanknowles commented 8 years ago

Thanks for providing this example of how to build reflex with stack. :+1:

When using recent versions of node (for example, 6.6.0 or 6.7.0), the build appears to fail:

$ node --version
v6.7.0
$ git clone https://github.com/yamafaktory/reflex-starter reflex-starter
Cloning into 'reflex-starter'...
remote: Counting objects: 109, done.
remote: Total 109 (delta 0), reused 0 (delta 0), pack-reused 109
Receiving objects: 100% (109/109), 12.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (70/70), done.
Checking connectivity... done.
$ cd reflex-starter
$ stack setup
stack will use a sandboxed GHCJS it installed
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
$ stack build
Ignoring that the GHCJS boot package "attoparsec" has a different version, 0.13.0.1, than the resolver's wanted version, 0.13.0.2
Ignoring that the GHCJS boot package "scientific" has a different version, 0.3.3.8, than the resolver's wanted version, 0.3.4.6
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.6
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.1
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
StateVar-1.1.0.4: configure
dependent-sum-0.3.2.2: configure
data-default-class-0.0.1: configure
base-orphans-0.5.4: configure
Progress: 4/46
--  While building package base-orphans-0.5.4 using:
      /home/jsk/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs configure --with-ghc=/usr/bin/ghc --with-ghc-pkg=/usr/bin/ghc-pkg --with-ghcjs=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs --with-ghcjs-pkg=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/pkgdb --libdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/lib --bindir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/bin --datadir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/share --libexecdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/libexec --sysconfdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/etc --docdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/base-orphans-0.5.4 --htmldir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/base-orphans-0.5.4 --haddockdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/base-orphans-0.5.4 --dependency=base=base-4.8.0.0-03fecfa83bdebabc2c85fc0330af3050 --dependency=ghc-prim=ghc-prim-0.4.0.0-befc8fea2f3d1fbb5c8d9d76daa004f8 --ghcjs
    Process exited with code: ExitFailure 1
    Logs have been written to: /private/jsk/projects/current/reflex-starter/.stack-work/logs/base-orphans-0.5.4.log

    Configuring base-orphans-0.5.4...
    setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2:
    .stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs/: does not exist

--  While building package data-default-class-0.0.1 using:
      /home/jsk/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs configure --with-ghc=/usr/bin/ghc --with-ghc-pkg=/usr/bin/ghc-pkg --with-ghcjs=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs --with-ghcjs-pkg=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/pkgdb --libdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/lib --bindir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/bin --datadir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/share --libexecdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/libexec --sysconfdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/etc --docdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/data-default-class-0.0.1 --htmldir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/data-default-class-0.0.1 --haddockdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/data-default-class-0.0.1 --dependency=base=base-4.8.0.0-03fecfa83bdebabc2c85fc0330af3050 --ghcjs
    Process exited with code: ExitFailure 1
    Logs have been written to: /private/jsk/projects/current/reflex-starter/.stack-work/logs/data-default-class-0.0.1.log

    Configuring data-default-class-0.0.1...
    setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2:
    .stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs/: does not exist

--  While building package dependent-sum-0.3.2.2 using:
      /home/jsk/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs configure --with-ghc=/usr/bin/ghc --with-ghc-pkg=/usr/bin/ghc-pkg --with-ghcjs=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs --with-ghcjs-pkg=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/pkgdb --libdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/lib --bindir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/bin --datadir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/share --libexecdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/libexec --sysconfdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/etc --docdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/dependent-sum-0.3.2.2 --htmldir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/dependent-sum-0.3.2.2 --haddockdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/dependent-sum-0.3.2.2 --dependency=base=base-4.8.0.0-03fecfa83bdebabc2c85fc0330af3050 --ghcjs
    Process exited with code: ExitFailure 1
    Logs have been written to: /private/jsk/projects/current/reflex-starter/.stack-work/logs/dependent-sum-0.3.2.2.log

    Configuring dependent-sum-0.3.2.2...
    setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2:
    .stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs/: does not exist

--  While building package StateVar-1.1.0.4 using:
      /home/jsk/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs configure --with-ghc=/usr/bin/ghc --with-ghc-pkg=/usr/bin/ghc-pkg --with-ghcjs=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs --with-ghcjs-pkg=/home/jsk/.stack/programs/x86_64-linux/ghcjs-0.2.0.20160528_ghc-7.10.2/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/pkgdb --libdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/lib --bindir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/bin --datadir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/share --libexecdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/libexec --sysconfdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/etc --docdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/StateVar-1.1.0.4 --htmldir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/StateVar-1.1.0.4 --haddockdir=/home/jsk/.stack/snapshots/x86_64-linux/lts-5.18/ghcjs-0.2.0_ghc-7.10.2/doc/StateVar-1.1.0.4 --dependency=base=base-4.8.0.0-03fecfa83bdebabc2c85fc0330af3050 --dependency=stm=stm-2.4.4-e008007f94052adff66e538c2b2db729 --dependency=transformers=transformers-0.4.3.0-ac873fa89348d2fb5e56cb91787da605 --ghcjs
    Process exited with code: ExitFailure 1
    Logs have been written to: /private/jsk/projects/current/reflex-starter/.stack-work/logs/StateVar-1.1.0.4.log

    Configuring StateVar-1.1.0.4...
    setup-Simple-Cabal-1.22.8.0-ghcjs-0.2.0_ghc-7.10.2:
    .stack-work/dist/x86_64-linux/Cabal-1.22.8.0_ghcjs/: does not exist

Let me know if you need me to provide any further info.

yamafaktory commented 8 years ago

@jonathanknowles Thank you for your feedback!

I was going to tell you to eventually open an issue on the stack tracker and I noticed you already did it here https://github.com/commercialhaskell/stack/issues/2642.

Did you try to update the compiler version (compiler: ghcjs-0.2.0.20160929_ghc-7.10.2 )? And maybe also the deps and the resolver?

I will try that at home later!

tolysz commented 8 years ago

I updated some instructions on how to use ghcjs with stack. It lies shy at the bottom, but if it will be useful it will be moved slightly up https://docs.haskellstack.org/en/stable/ghcjs/#comunity-repacks It should build with node-6.6.0

jonathanknowles commented 8 years ago

Hi @yamafaktory

Thanks for your reply!

I tried specifying the latest versions of reflex and ghcjs, as follows:

$ cat stack.yaml
resolver: lts-7.1

flags: {}

extra-deps:
  - ghcjs-dom-0.2.3.1
  - haskell-src-exts-1.16.0.1
  - reflex-0.4.0
  - reflex-dom-0.3
  - ref-tf-0.4

extra-package-dbs: []

compiler: ghcjs-0.2.1.9007001_ghc-8.0.1
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9007001_ghc-8.0.1:
        url: "http://ghcjs.luite.com/master-20160528.tar.gz"

Attempting to compile produces the following output:

$ stack build

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

In the dependencies for ghcjs-dom-0.2.3.1:
    transformers-0.5.2.0 must match >=0.2 && <0.5 (latest applicable is 0.4.3.0)
needed due to reflex-starter-1.2.3 -> ghcjs-dom-0.2.3.1

In the dependencies for ref-tf-0.4:
    transformers-0.5.2.0 must match >=0.2 && <0.5 (latest applicable is 0.4.3.0)
needed due to reflex-starter-1.2.3 -> ref-tf-0.4

In the dependencies for reflex-0.4.0:
    base-4.9.0.0 must match >=4.7 && <4.9 (latest applicable is 4.8.2.0)
    template-haskell-2.11.0.0 must match >=2.9 && <2.11 (latest applicable is 2.10.0.0)
    these-0.7.2 must match >=0.4 && <0.7 (latest applicable is 0.6.2.1)
needed due to reflex-starter-1.2.3 -> reflex-0.4.0

In the dependencies for reflex-dom-0.3:
    base-4.9.0.0 must match >=4.7 && <4.9 (latest applicable is 4.8.2.0)
    data-default-0.7.1.1 must match ==0.5.* (latest applicable is 0.5.3)
    lens-4.14 must match >=4.7 && <4.14 (latest applicable is 4.13.2.1)
    these-0.7.2 must match >=0.4 && <0.7 (latest applicable is 0.6.2.1)
    time-1.6.0.1 must match ==1.4.* || ==1.5.* (latest applicable is 1.5.0.1)
    transformers-0.5.2.0 must match ==0.3.* || ==0.4.* (latest applicable is 0.4.3.0)
needed due to reflex-starter-1.2.3 -> reflex-dom-0.3

Plan construction failed.

I think this is because:

  1. The latest version of reflex (0.4.0) requires base < 4.9
  2. The latest version of GHCJS (as mentioned in this thread) implies base == 4.9.

It seems that I could solve this problem by using an earlier version of GHCJS, but all the earlier versions of GHCJS that I've tried run into errors when using the latest versions of Node (6.6.0 onwards).

Perhaps the problem can be fixed by asking the reflex team to make a new release with a more relaxed upper bound on base. (It seems that the work has already been done in the reflex github repository with this change. Though perhaps they have reasons for holding back.

Would be interested to hear your thoughts, and whether there's an easier fix that I've missed. Thanks again for your help :)

tolysz commented 8 years ago

I am testing it at https://github.com/tolysz/reflex-starter/tree/lts-7.1 But 2 things! allow-newer: true ghcjs-0.2.1.9007001_ghc-8.0.1: is not a random label it needs to point to a specific snapshot

I am testing building with travis and will PR once it is working

yamafaktory commented 8 years ago

@tolysz Thanks a lot for your work! I wanted to fix that yesterday evening using your tarball as URL, but then I had some issues with stack on my NixOS laptop!

tolysz commented 8 years ago

OK, there is a PR https://github.com/yamafaktory/reflex-starter/pull/4 Which: uses lts-7.1, ghc8, and improves rebuilds (I hope).

Most constraints from the stack.yaml could go, but ;) it is your job @yamafaktory to have the latest reflex.

yamafaktory commented 8 years ago

This is great @tolysz! No need to update reflex as v0.4.0 is actually the latest https://hackage.haskell.org/package/reflex.

yamafaktory commented 8 years ago

@jonathanknowles is the issue solved for you with the latest updates?