concurhaskell / concur-react-starter

A starter kit for concur-react projects
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Stack won't support GHCJS 8.0.1 on arch linux #1

Open cfraz89 opened 6 years ago

cfraz89 commented 6 years ago

Hi,

When building the starter with stack, I got the following output: Downloaded ghcjs-0.2.1.9007019_ghc-8.0.1. Setting up GHCJS build environmentNo information found for ghc-8.0.1. Supported versions for OS key 'linux64-tinfo6-nopie': GhcVersion 8.0.2, GhcVersion 8.2.1, GhcVersion 8.2.2

$ stack --version Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

If I update the stack-ghcjs.yaml to use a newer untested build of ghcjs, everything is ok.

resolver: lts-9.13
packages:
- location: .
- location:
    git: https://github.com/ajnsit/concur
    commit: 06f8b226935bad2bfd4c6b8b6a76cfab730988aa
  extra-dep: true
  subdirs:
    - concur-core
    - concur-react
extra-deps:
- natural-transformation-0.4
flags: {}
extra-package-dbs: []

compiler: ghcjs-0.2.1.9009013_ghc-8.0.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9009013_ghc-8.0.2:
           url: http://tolysz.org/ghcjs/untested/ghc-8.0-2017-11-15-lts-9.13-9009013.tar.gz
           sha1: c07cd955d86e78d4f72448d7039d1f1dfbb46685
cfraz89 commented 6 years ago

Actually no good. With this ghcjs booting fails:

GHC/TopHandler.hs:88:29: error:
    Data constructor not in scope: STG_SIG_RST :: CInt
cabal: Error: some packages failed to install:
base-4.9.1.0-DUroNgAKIGQCIqmcCr1i33 failed during the building phase. The
exception was:
ExitFailure 1
primitive-0.6.2.0-CrQJFOPTQVY76A6o8V1CkN depends on primitive-0.6.2.0 which
failed to install.
transformers-0.5.2.0-IGRvs8mRrJ09Lm6BZ7wb9k depends on transformers-0.5.2.0
which failed to install.
ajnsit commented 6 years ago

Thanks for the bug report! This seems to be an issue with stack/ghcjs itself on Arch Linux. I don't have a quick solution since I don't use Arch myself, however I'll look into it and get back to you.

cfraz89 commented 6 years ago

Ok got it going with the is stack-ghcs.yaml:

resolver: lts-8.11
packages:
- location: .
- location:
    git: https://github.com/ajnsit/concur
    commit: 06f8b226935bad2bfd4c6b8b6a76cfab730988aa
  extra-dep: true
  subdirs:
    - concur-core
    - concur-react
extra-deps:
- natural-transformation-0.4
flags: {}
extra-package-dbs: []

compiler: ghcjs-0.2.1.9008011_ghc-8.0.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9008011_ghc-8.0.2:
           url: https://github.com/matchwood/ghcjs-stack-dist/raw/master/ghcjs-0.2.1.9008011.tar.gz
           sha1: a72a5181124baf64bcd0e68a8726e65914473b3b

It's this ghcjs build: https://github.com/matchwood/ghcjs-stack-dist Not official, but it works.

cfraz89 commented 6 years ago

Ok next question... Got everything building, however upon attempting to render the page in the build folder, I get

Download the React DevTools for a better development experience: https://fb.me/react-devtools
You might need to use a local HTTP server (instead of file://): https://fb.me/react-devtools-faq
rts.js:7228 uncaught exception in Haskell main thread: TypeError: Cannot read property 'createElement' of undefined
rts.js:7228 TypeError: Cannot read property 'createElement' of undefined
    at h$$o8 (out.js:16205)
    at h$runThreadSlice (rts.js:8264)
    at h$runThreadSliceCatch (rts.js:8221)
    at h$mainLoop (rts.js:8216)
    at rts.js:2521
    at runIfPresent (rts.js:2539)
    at onGlobalMessage (rts.js:2580)

It seems like the webpacked index.compiled.js isn't getting bundled into the output js. For the life of me can't figure out why though...

ajnsit commented 6 years ago

@cfraz89 I tried with that stack.yaml and it seems to work. Can you delete node_modules, .stack-work, and jsbits/index.compiled.js and then try building? Also paste your build logs here.

cfraz89 commented 6 years ago
➜  concur-react-starter git:(master) ✗ rm -rf node_modules  
➜  concur-react-starter git:(master) ✗ rm -rf .stack-work   
➜  concur-react-starter git:(master) ✗ npm install &> npm.log
➜  concur-react-starter git:(master) ✗ webpack &> webpack.log
➜  concur-react-starter git:(master) ✗ stack build --stack-yaml stack-ghcjs.yaml &> stack.log
➜  concur-react-starter git:(master) ✗ chrome .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/myproj/myproj.jsexe/index.html

npm.log

> uglifyjs-webpack-plugin@0.4.6 postinstall /home/chris/Projects/concur-react-starter/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN myproject@1.0.0 No repository field.
npm WARN myproject@1.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 266 packages in 2.523s

webpack.log

Hash: 44decc34f19a432348bd
Version: webpack 3.10.0
Time: 483ms
            Asset    Size  Chunks                    Chunk Names
index.compiled.js  725 kB       0  [emitted]  [big]  main
  [14] ./js-src/index.js 168 bytes {0} [built]
    + 26 hidden modules

stack.log

Cloning 06f8b226935bad2bfd4c6b8b6a76cfab730988aa from https://github.com/ajnsit/concur
Cloning into '/home/chris/Projects/concur-react-starter/.stack-work/downloaded/OxLTfrOzoSFH'...
Submodule 'concur-vdom/ghcjs-ffiqq' (https://github.com/ghcjs/ghcjs-ffiqq.git) registered for path 'concur-vdom/ghcjs-ffiqq'
Submodule 'ghcjs-vdom' (https://github.com/ajnsit/ghcjs-vdom.git) registered for path 'concur-vdom/ghcjs-vdom'
Cloning into '/home/chris/Projects/concur-react-starter/.stack-work/downloaded/OxLTfrOzoSFH/concur-vdom/ghcjs-ffiqq'...
Cloning into '/home/chris/Projects/concur-react-starter/.stack-work/downloaded/OxLTfrOzoSFH/concur-vdom/ghcjs-vdom'...
Submodule path 'concur-vdom/ghcjs-ffiqq': checked out 'b52338c2dcd3b0707bc8aff2e171411614d4aedb'
Submodule path 'concur-vdom/ghcjs-vdom': checked out 'c9a72e5d6a2556900bfea96e3078adfc89aba858'

Warning: Directory listed in myproject.cabal file does not exist: src-ghcjs
Ignoring that the GHCJS boot package "aeson" has a different version, 1.1.1.0, than the resolver's wanted version, 1.0.2.1
natural-transformation-0.4: configure
natural-transformation-0.4: build
natural-transformation-0.4: copy/register
concur-core-0.1.0.0: configure (lib)
concur-core-0.1.0.0: build (lib)
concur-core-0.1.0.0: copy/register
concur-react-0.1.0.0: configure (lib + exe)
concur-react-0.1.0.0: build (lib + exe)
concur-react-0.1.0.0: copy/register
Building all executables for `myproject' once. After a successful build of all of them, only specified executables will be rebuilt.
myproject-0.1.0.0: configure (exe)
Configuring myproject-0.1.0.0...
Warning: 'hs-source-dirs: src-ghcjs' directory does not exist.
myproject-0.1.0.0: build (exe)
Preprocessing executable 'myproj' for myproject-0.1.0.0...
[1 of 1] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/myproj/myproj-tmp/Main.js_o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/myproj/myproj.jsexe (Main)

Warning: Directory listed in myproject.cabal file does not exist: src-ghcjs
myproject-0.1.0.0: copy/register
Installing executable(s) in
/home/chris/Projects/concur-react-starter/.stack-work/install/x86_64-linux/lts-8.11/ghcjs-0.2.1.9008011_ghc-8.0.2/bin
Warning: the following files would be used as linker inputs, but linking is not being done: .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/myproj/myproj
Completed 4 action(s).