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-boot fails for LTS8 #10

Open
jlandahl opened this issue Jun 2, 2017 · 14 comments
Open

ghcjs-boot fails for LTS8 #10

jlandahl opened this issue Jun 2, 2017 · 14 comments

Comments

@jlandahl
Copy link

jlandahl commented Jun 2, 2017

The following error happens when running ghcjs-boot after installing from an LTS8-based tarball generated by prepare-ghcjs:

System/Posix/IO/Common.hsc:284:1: error:
    parse error (possibly incorrect indentation or mismatched brackets)
cabal: Error: some packages failed to install:
directory-1.3.0.0 depends on unix-2.7.2.1 which failed to install.
ghc-boot-8.0.2 depends on unix-2.7.2.1 which failed to install.
ghci-8.0.2 depends on unix-2.7.2.1 which failed to install.
process-1.4.3.0 depends on unix-2.7.2.1 which failed to install.
unix-2.7.2.1 failed during the building phase. The exception was:
ExitFailure 1

Here's the relevant section of the file in question:

$ cat -n spec-lts8/unix/System/Posix/IO/Common.hsc | head -288 | tail -8
   281	-- | May throw an exception if this is an invalid descriptor.
   282	fdSeek :: Fd -> SeekMode -> FileOffset -> IO FileOffset
   283	fdSeek (Fd fd) mode off =
   284	##if defined(ghcjs_HOST_OS)
   285	  error "installHandler: not available for GHCJS"
   286	##else
   287	  throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
   288	##endif
@dbaynard
Copy link

dbaynard commented Jun 9, 2017

I'd say see ghcjs/ghcjs-boot#43 but it hasn't had any attention yet. I have, though, managed to boot unix with lts-8.17. Working on a way to reproduce using prepare-ghcjs.

@tolysz
Copy link
Owner

tolysz commented Jun 9, 2017 via email

@dbaynard
Copy link

dbaynard commented Jun 9, 2017

It compiles, but closure compiler pops up some errors. Didn't manage to get it working with stack setup (that's the goal of prepare-ghcjs, right?) so that was next on my list but I can't devote a huge amount of time to it.

I won't get a chance to upload a PR just yet, but broadly:

  • stack install from https://github.com/matchwood/ghcjs/tree/lts-8.11 with the modifications below, to ~/Project/ghcjs/ghcjs.
  • I had to stack install happy, alex, hscolour and hsc2hs.
  • I booted from a directory containing the stack.yaml immediately below, with the command
> ghcjs-boot --with-ghc $(cd ~/Projects/ghcjs/ghcjs && stack path --compiler-exe) --with-ghc-pkg $(cd ~/Projects/ghcjs/ghcjs && stack path --compiler-bin)/ghc-pkg --dev --clean
resolver:
  name: default-snapshot
  location: snapshot.yaml

compiler: ghcjs-0.2.1.9008017_ghc-8.0.2

ghc-options:
  "*": -dedupe -O0

The diff is here. I managed to get it working with aeson-1.2.0.0.

diff --git c/ghcjs.cabal w/ghcjs.cabal
index be961d4..c4ce2d6 100644
--- c/ghcjs.cabal
+++ w/ghcjs.cabal
@@ -1,5 +1,5 @@
 Name:           ghcjs
-Version:        0.2.1.9008011
+Version:        0.2.1.9008017
 Description:    Haskell to JavaScript compiler
 License:        MIT
 License-file:   LICENSE
@@ -144,7 +144,7 @@ Library
                    syb            >= 0.6      && < 0.7,
                    bytestring     >= 0.10     && < 0.11,
                    attoparsec     >= 0.12     && < 0.14,
-                   aeson          >= 1.0      && < 1.2,
+                   aeson          >= 1.0      && < 1.3,
                    text           >= 1.2      && < 1.3,
                    wl-pprint-text >= 1.1      && < 1.2,
                    lens           >= 4.0      && < 4.16,

The only change here is to a custom directory, which be better passed at boot.

diff --git c/lib/etc/boot.yaml w/lib/etc/boot.yaml
index d8adf5f..7de83c6 100755
--- c/lib/etc/boot.yaml
+++ w/lib/etc/boot.yaml
@@ -145,7 +145,7 @@ sources:
 
   #ghcjs-boot-dev:        https://github.com/ghcjs/ghcjs-boot
   #ghcjs-boot-dev-branch: master
-  ghcjs-boot-dev:        /blizzard/ghcjs/ghcjs-boot
+  ghcjs-boot-dev:        https://github.com/matchwood/ghcjs-boot
   ghcjs-boot-dev-branch: lts-8.11
 
   # build tools for Windows (http url, local tar archive or directory)

I replaced the extra-deps with a custom snapshot to reduce recompilation.

diff --git c/snapshot.yaml w/snapshot.yaml
new file mode 100644
index 0000000..7d5a01f
--- /dev/null
+++ w/snapshot.yaml
@@ -0,0 +1,7 @@
+resolver: lts-8.17
+
+compiler: ghc-8.0.2
+
+packages:
+- haddock-api-2.17.3.1
+- aeson-1.2.0.0
diff --git c/stack.yaml w/stack.yaml
index 2796012..f6651a7 100644
--- c/stack.yaml
+++ w/stack.yaml
@@ -1,7 +1,4 @@
-resolver: lts-8.11
-extra-deps:
-- haddock-api-2.17.3.1
-- aeson-1.1.1.0
-flags:
-  aeson:
-    cffi: false
\ No newline at end of file
+resolver:
+  name: lts-8.17-mod
+  location: snapshot.yaml
+

@sigrlami
Copy link
Collaborator

sigrlami commented Jul 8, 2017

@tolysz any hints how to fix it? Compiles everything except unix package

resolver: lts-8.21
compiler: ghcjs-0.2.1.9007019_ghc-8.0.1
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9007019_ghc-8.0.1:
           url: http://ghcjs.tolysz.org/ghc-8.0-2017-02-05-lts-7.19-9007019.tar.gz
           sha1: d2cfc25f9cda32a25a87d9af68891b2186ee52f9
Progress: 2/25
--  While building package unix-2.7.2.1 using:
      /tmp/stack20586/unix-2.7.2.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs build --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/sigrlami/work/projects-hs/tenderoom/tenders/back-office/app-bo/.stack-work/logs/unix-2.7.2.1.log

    [1 of 2] Compiling Main             ( /tmp/stack20586/unix-2.7.2.1/Setup.hs, /tmp/stack20586/unix-2.7.2.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/setup/Main.js_o )
    [2 of 2] Compiling StackSetupShim   ( /home/sigrlami/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack20586/unix-2.7.2.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/setup/StackSetupShim.js_o )
    Linking /tmp/stack20586/unix-2.7.2.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/setup/setup.jsexe (Main,StackSetupShim)
    Configuring unix-2.7.2.1...
    configure: WARNING: unrecognized options: --with-compiler
    checking for gcc... /usr/bin/gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /usr/bin/gcc accepts -g... yes
    checking for /usr/bin/gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... /usr/bin/gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking for an ANSI C-conforming const... yes
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... no
    checking dirent.h usability... yes
    checking dirent.h presence... yes
    checking for dirent.h... yes
    checking fcntl.h usability... yes
    checking fcntl.h presence... yes
    checking for fcntl.h... yes
    checking grp.h usability... yes
    checking grp.h presence... yes
    checking for grp.h... yes
    checking limits.h usability... yes
    checking limits.h presence... yes
    checking for limits.h... yes
    checking pwd.h usability... yes
    checking pwd.h presence... yes
    checking for pwd.h... yes
    checking signal.h usability... yes
    checking signal.h presence... yes
    checking for signal.h... yes
    checking for string.h... (cached) yes
    checking sys/resource.h usability... yes
    checking sys/resource.h presence... yes
    checking for sys/resource.h... yes
    checking for sys/stat.h... (cached) yes
    checking sys/times.h usability... yes
    checking sys/times.h presence... yes
    checking for sys/times.h... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking sys/utsname.h usability... yes
    checking sys/utsname.h presence... yes
    checking for sys/utsname.h... yes
    checking sys/wait.h usability... yes
    checking sys/wait.h presence... yes
    checking for sys/wait.h... yes
    checking bsd/libutil.h usability... no
    checking bsd/libutil.h presence... no
    checking for bsd/libutil.h... no
    checking libutil.h usability... no
    checking libutil.h presence... no
    checking for libutil.h... no
    checking pty.h usability... yes
    checking pty.h presence... yes
    checking for pty.h... yes
    checking utmp.h usability... yes
    checking utmp.h presence... yes
    checking for utmp.h... yes
    checking termios.h usability... yes
    checking termios.h presence... yes
    checking for termios.h... yes
    checking time.h usability... yes
    checking time.h presence... yes
    checking for time.h... yes
    checking for unistd.h... (cached) yes
    checking utime.h usability... yes
    checking utime.h presence... yes
    checking for utime.h... yes
    checking for getgrgid_r... yes
    checking for getgrnam_r... yes
    checking for getpwnam_r... yes
    checking for getpwuid_r... yes
    checking for getpwnam... yes
    checking for getpwuid... yes
    checking for getpwent... yes
    checking for getgrent... yes
    checking for lchown... yes
    checking for setenv... yes
    checking for sysconf... yes
    checking for unsetenv... yes
    checking for clearenv... yes
    checking for nanosleep... yes
    checking for ptsname... yes
    checking for setitimer... yes
    checking for readdir_r... yes
    checking for telldir... yes
    checking for seekdir... yes
    checking for _NSGetEnviron... no
    checking whether execvpe is declared... yes
    checking for execvpe... yes
    checking for struct stat.st_atim... yes
    checking for struct stat.st_mtim... yes
    checking for struct stat.st_ctim... yes
    checking for struct stat.st_atimespec... no
    checking for struct stat.st_mtimespec... no
    checking for struct stat.st_ctimespec... no
    checking for struct stat.st_atimensec... no
    checking for struct stat.st_mtimensec... no
    checking for struct stat.st_ctimensec... no
    checking for struct stat.st_atime_n... no
    checking for struct stat.st_mtime_n... no
    checking for struct stat.st_ctime_n... no
    checking for struct stat.st_uatime... no
    checking for struct stat.st_umtime... no
    checking for struct stat.st_uctime... no
    checking for struct passwd.pw_gecos... yes
    checking for utimensat... yes
    checking for futimens... yes
    checking for lutimes... yes
    checking for futimes... yes
    checking for mkstemps... yes
    checking for mkdtemp... yes
    checking for fsync... yes
    checking whether fdatasync is declared... yes
    checking for fdatasync... yes
    checking for posix_fadvise... yes
    checking for posix_fallocate... yes
    checking whether tcdrain is declared... yes
    checking whether ctermid is declared... yes
    checking for library containing shm_open... -lrt
    checking for shm_open... yes
    checking for shm_unlink... yes
    checking value of SIGABRT... 6
    checking value of SIGALRM... 14
    checking value of SIGBUS... 7
    checking value of SIGCHLD... 17
    checking value of SIGCONT... 18
    checking value of SIGFPE... 8
    checking value of SIGHUP... 1
    checking value of SIGILL... 4
    checking value of SIGINT... 2
    checking value of SIGKILL... 9
    checking value of SIGPIPE... 13
    checking value of SIGQUIT... 3
    checking value of SIGSEGV... 11
    checking value of SIGSTOP... 19
    checking value of SIGTERM... 15
    checking value of SIGTSTP... 20
    checking value of SIGTTIN... 21
    checking value of SIGTTOU... 22
    checking value of SIGUSR1... 10
    checking value of SIGUSR2... 12
    checking value of SIGPOLL... 29
    checking value of SIGPROF... 27
    checking value of SIGSYS... 31
    checking value of SIGTRAP... 5
    checking value of SIGURG... 23
    checking value of SIGVTALRM... 26
    checking value of SIGXCPU... 24
    checking value of SIGXFSZ... 25
    checking value of SIG_BLOCK... 0
    checking value of SIG_SETMASK... 2
    checking value of SIG_UNBLOCK... 1
    checking value of SIGINFO... -1
    checking value of SIGWINCH... 28
    checking for _SC_GETGR_R_SIZE_MAX... yes
    checking for _SC_GETPW_R_SIZE_MAX... yes
    checking return type of usleep... int
    checking return type of unsetenv... int
    checking for RTLD_NEXT from dlfcn.h... yes
    checking for RTLD_DEFAULT from dlfcn.h... yes
    checking for openpty... no
    checking for openpty in -lutil... yes
    checking for /dev/ptmx... yes
    checking for /dev/ptc... no
    checking for library containing dlopen... -ldl
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for library containing sem_close... -lpthread
    configure: creating ./config.status
    config.status: creating unix.buildinfo
    config.status: creating include/HsUnixConfig.h
    configure: WARNING: unrecognized options: --with-compiler
    Linking /tmp/stack20586/unix-2.7.2.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/setup/setup.jsexe (Main,StackSetupShim)
    Building unix-2.7.2.1...
    Preprocessing library unix-2.7.2.1...
    [ 1 of 39] Compiling System.Posix.Terminal.Common ( .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/System/Posix/Terminal/Common.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/System/Posix/Terminal/Common.js_o )
    [ 2 of 39] Compiling System.Posix.IO.Common ( .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/System/Posix/IO/Common.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs/build/System/Posix/IO/Common.js_o )
    
    /tmp/stack20586/unix-2.7.2.1/System/Posix/IO/Common.hsc:284:3: error:
        • Couldn't match type ‘Int64’ with ‘COff’
          Expected type: IO FileOffset
            Actual type: IO Int64
        • In the expression:
            throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
          In an equation for ‘fdSeek’:
              fdSeek (Fd fd) mode off
                = throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
    
    /tmp/stack20586/unix-2.7.2.1/System/Posix/IO/Common.hsc:284:48: error:
        • Couldn't match type ‘COff’ with ‘Int64’
          Expected type: Int64
            Actual type: FileOffset
        • In the second argument of ‘Base.c_lseek’, namely ‘off’
          In the second argument of ‘throwErrnoIfMinus1’, namely
            ‘(Base.c_lseek fd off (mode2Int mode))’
          In the expression:
            throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))

@sigrlami
Copy link
Collaborator

sigrlami commented Jul 8, 2017

@dbaynard which ghcjs package you used to compile unix? Can you provide an excerpt from stack.yaml?

@dbaynard
Copy link

dbaynard commented Jul 8, 2017

I compiled from source but didn't get prepare-ghcjs working. Did you try my instructions, above?

@sigrlami
Copy link
Collaborator

sigrlami commented Jul 8, 2017

@dbaynard So, I nuke my old .stack-work, add new stuff to my fork https://github.com/sigrlami/prepare-ghcjs/commit/caa5f65363bd9d5f5348bbf7c689ecae326baa83 built it with prepare-ghcjs and lts-8.21 and now using in my repo along with reflex-frp like this:

resolver: lts-8.21
compiler: ghcjs-0.2.1.9008021_ghc-8.0.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9008021_ghc-8.0.2:
           url: https://sigrlami.eu/ghcjs/8.x/lts-8.21/ghc-8.0-2017-07-11-lts-8.21-9008021.tar.gz
           sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709

but still have small errors with ghcjs-boot, I think I need to manually patch repo

@mchaver
Copy link

mchaver commented Jul 21, 2017

@sigrlami

stack setup works with the following...

resolver: lts-8.21
compiler: ghcjs-0.2.1.9008021_ghc-8.0.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.1.9008021_ghc-8.0.2:
           url: https://sigrlami.eu/ghcjs/8.x/lts-8.21/ghc-8.0-2017-07-11-lts-8.21-9008021.tar.gz
           sha1: 3cebf161423da7016b07f9af9917ee004ec4dc92

but when I tried it on a project with stack build it crashed on bash-orphans

base-orphans-0.5.4: build
Progress: 4/24
--  While building package base-orphans-0.5.4 using:
      /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2 --builddir=.stack-work-ghcjs/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs build --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/james/work/json-api/.stack-work-ghcjs/logs/base-orphans-0.5.4.log

    uncaught exception in Haskell main thread: ReferenceError: h$opendir is not defined
    ReferenceError: h$opendir is not defined
        at h$$asK (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:81900:11)
        at h$runThreadSlice (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8221:11)
        at h$runThreadSliceCatch (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8177:12)
        at Immediate.h$mainLoop [as _callback] (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8172:9)
        at runCallback (timers.js:637:20)
        at tryOnImmediate (timers.js:610:5)
        at processImmediate [as _immediateCallback] (timers.js:582:5)
    /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721
                    h$handlErrnoC(err, -1, 0, c);
                    ^
    
    ReferenceError: h$handlErrnoC is not defined
        at /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721:17
        at FSReqWrap.oncomplete (fs.js:123:15)


--  While building package cabal-doctest-1.0.2 using:
      /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2 --builddir=.stack-work-ghcjs/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs build --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/james/work/json-api/.stack-work-ghcjs/logs/cabal-doctest-1.0.2.log

    uncaught exception in Haskell main thread: ReferenceError: h$opendir is not defined
    ReferenceError: h$opendir is not defined
        at h$$asK (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:81900:11)
        at h$runThreadSlice (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8223:11)
        at h$runThreadSliceCatch (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8177:12)
        at Immediate.h$mainLoop [as _callback] (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8172:9)
        at runCallback (timers.js:637:20)
        at tryOnImmediate (timers.js:610:5)
        at processImmediate [as _immediateCallback] (timers.js:582:5)
    /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721
                    h$handlErrnoC(err, -1, 0, c);
                    ^
    
    ReferenceError: h$handlErrnoC is not defined
        at /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721:17
        at FSReqWrap.oncomplete (fs.js:123:15)


--  While building package data-default-class-0.1.2.0 using:
      /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2 --builddir=.stack-work-ghcjs/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs build --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/james/work/json-api/.stack-work-ghcjs/logs/data-default-class-0.1.2.0.log

    uncaught exception in Haskell main thread: ReferenceError: h$opendir is not defined
    ReferenceError: h$opendir is not defined
        at h$$asK (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:81900:11)
        at h$runThreadSlice (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8225:11)
        at h$runThreadSliceCatch (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8177:12)
        at Immediate.h$mainLoop [as _callback] (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8172:9)
        at runCallback (timers.js:637:20)
        at tryOnImmediate (timers.js:610:5)
        at processImmediate [as _immediateCallback] (timers.js:582:5)
    /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721
                    h$handlErrnoC(err, -1, 0, c);
                    ^
    
    ReferenceError: h$handlErrnoC is not defined
        at /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721:17
        at FSReqWrap.oncomplete (fs.js:123:15)


--  While building package StateVar-1.1.0.4 using:
      /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2 --builddir=.stack-work-ghcjs/dist/x86_64-linux/Cabal-1.24.2.0_ghcjs build --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/james/work/json-api/.stack-work-ghcjs/logs/StateVar-1.1.0.4.log

    uncaught exception in Haskell main thread: ReferenceError: h$opendir is not defined
    ReferenceError: h$opendir is not defined
        at h$$asK (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:81900:11)
        at h$runThreadSlice (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8227:11)
        at h$runThreadSliceCatch (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8177:12)
        at Immediate.h$mainLoop [as _callback] (/home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:8172:9)
        at runCallback (timers.js:637:20)
        at tryOnImmediate (timers.js:610:5)
        at processImmediate [as _immediateCallback] (timers.js:582:5)
    /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721
                    h$handlErrnoC(err, -1, 0, c);
                    ^
    
    ReferenceError: h$handlErrnoC is not defined
        at /home/james/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008021_ghc-8.0.2:22721:17
        at FSReqWrap.oncomplete (fs.js:123:15)

@sigrlami
Copy link
Collaborator

@mchaver Interesting. I need to take a look, probably related to the aeson package. Do you have base-orphans explicitly defined?

@mchaver
Copy link

mchaver commented Jul 21, 2017

@sigrlami I don't have it explicitly defined. I would guess it is a dependency of one of my dependencies. I am using aeson.

@sigrlami
Copy link
Collaborator

sigrlami commented Jul 21, 2017 via email

@dbaynard
Copy link

Just a quick update: I've just booted with a modified lts-9.1 (specifically: updated aeson and attoparsec). The approach is as above; clone https://github.com/dbaynard/ghcjs/tree/lts-9.1 to GHCJS_DIRECTORY, stack install, install any missing boot dependencies (I was missing happy, alex, hscolour and hsc2hs but I don't know what else), then in a directory with the following stack.yaml

resolver:
  name: default-snapshot
  location: snapshot.yaml

compiler: ghcjs-0.2.1.9009001_ghc-8.0.2

ghc-options:
  "*": -dedupe -O0

run

> ghcjs-boot --with-ghc $(cd GHCJS_DIRECTORY && stack path --compiler-exe) --with-ghc-pkg $(cd GHCJS_DIRECTORY && stack path --compiler-bin)/ghc-pkg --dev --clean

(replace GHCJS_DIRECTORY with the actual directory.

@qrilka
Copy link

qrilka commented Oct 2, 2017

@sigrlami @tolysz what is the status of GHCJS under stack for LTSes after version 7? Any plans to publish new GHCJS URLs on https://docs.haskellstack.org or it's still not ready?

@tolysz
Copy link
Owner

tolysz commented Oct 2, 2017

For whatever reason LTS stuck with aeson-1.1.2.0 and we need aeson-1.2+.
I was hoping that it would move faster. If I lie about version it will break some packages from the LTS.
I think I will manually patch aeson...

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

6 participants