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

Building with GHCJS intermittently crashes #1629

Closed
3noch opened this issue Jan 9, 2016 · 7 comments
Closed

Building with GHCJS intermittently crashes #1629

3noch opened this issue Jan 9, 2016 · 7 comments

Comments

@3noch
Copy link
Member

3noch commented Jan 9, 2016

I'm building a project that uses GHCJS improved base and Reflex-DOM. However, intermittently, the build would fail with:

--  While building package http-types-0.8.6 using:
      /Users/elliot/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.4.0-ghcjs-0.2.0_ghc-7.10.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0_ghcjs configure --with-ghcjs=/Users/elliot/.stack/programs/x86_64-osx/ghcjs-0.2.0.20160107_ghc-7.10.2/bin/ghcjs --with-ghcjs-pkg=/Users/elliot/.stack/programs/x86_64-osx/ghcjs-0.2.0.20160107_ghc-7.10.2/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/pkgdb --libdir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/lib --bindir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/bin --datadir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/share --libexecdir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/libexec --sysconfdir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/etc --docdir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/doc/http-types-0.8.6 --htmldir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/doc/http-types-0.8.6 --haddockdir=/Users/elliot/.stack/snapshots/x86_64-osx/lts-3.10/ghcjs-0.2.0_ghc-7.10.2/doc/http-types-0.8.6 --dependency=array=array-0.5.1.0-1b14ea9bda4435fa660b7cafe6707fb1 --dependency=base=base-4.8.0.0-a3a3ebe3085e9d11c37cceba58a4365f --dependency=blaze-builder=blaze-builder-0.4.0.1-aae1a4fc552cf015dda7e237bc69495d --dependency=bytestring=bytestring-0.10.6.0-5352fe91f9dde68208480250c39ad337 --dependency=case-insensitive=case-insensitive-1.2.0.4-d5842f851021a2824729738f97017002 --dependency=text=text-1.2.1.1-143e2b21f3b7f11ce926e3b74b97d235 --ghcjs
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/elliot/a/mine/haskapp/front/.stack-work/logs/http-types-0.8.6.log

    Configuring http-types-0.8.6...
    setup-Simple-Cabal-1.22.4.0-ghcjs-0.2.0_ghc-7.10.2: Pattern match failure in
    do expression at Distribution/Simple/GHCJS.hs:104:3-27

When I installed http-types by itself, it worked: stack install http-types-0.8.6

This looks like it could easily be an upstream bug, but I couldn't find it so I'm filing it here so it is at least visible.

@3noch
Copy link
Member Author

3noch commented Jan 9, 2016

$ stack --version
Version 1.0.1, Git revision b10bee1d0e49aa230e9929c3a9e797581b250ebe x86_64

@mgsloan
Copy link
Contributor

mgsloan commented Jan 9, 2016

Yikes, that's not very good error reporting.. Error is from https://github.com/haskell/cabal/blob/4f6e9a5b63640f4203560f3c7a89131fc66fdd7e/Cabal/Distribution/Simple/GHCJS.hs#L104 , I guess indicating that it couldn't find ghcjs-pkg, or couldn't get its version.

I'm betting this is related to #1496 / ghcjs/ghcjs#451 - pretty sure it's an upstream issue with ghcjs / cabal. I find it highly unlikely that such nondeterminism would come from stack, so closing this issue. I'm leaving open the other issue, since it seems to be the main place people are communicating about this issue. It's also possible that stack is doing something wrong that causes this, but since the same issue crops up when using cabal, I doubt it.

Out of curiosity, did you install GHCJS using stack?

@mgsloan mgsloan added this to the Support milestone Jan 9, 2016
@mgsloan
Copy link
Contributor

mgsloan commented Jan 9, 2016

Maybe it'd be good to open an issue with cabal, at least about that error reporting? Having pattern matching in a do that can fail is pretty bad..

@mgsloan
Copy link
Contributor

mgsloan commented Jan 9, 2016

I just figured out #1496 - it's due to node version. Things work for me with v0.10 . Does that also resolve this?

@3noch
Copy link
Member Author

3noch commented Jan 11, 2016

I wondered if it was node! I'll see what I find.

@geraldus
Copy link

I have this issue as well.

$ stack --version
Version 1.0.2 x86_64

$ node --version
v5.4.1

$ stack exec ghcjs -- --version
The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.2.0.20151029 (GHC 7.10.2)

I'll try to downgrade node and see what will happen.

@geraldus
Copy link

I've upgraded node to v5.5.0, then removed contents of ~/.ghcjs and re-booted GHCJS again:

stack setup

After successful boot I was able to build my project.

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

No branches or pull requests

3 participants