Git Product home page Git Product logo

ghcjs-boot's Introduction

Introduction

GHCJS is a Haskell to JavaScript compiler that uses the GHC API.

Quick Start - Developing GHCJS

GHCJS contains a library, ghcjs, which contains the JavaScript code generator and a slightly customized variant of the ghc library, and several executable programs.

The repository has several submodules and some files must be generated before the package can be installed.

prerequisites

GHC

You need the same major version of GHC as the version of the GHCJS branch you're building.

cabal-install

cabal-install 3.0 is supported

emscripten emsdk

GHCJS uses a C toolchain, mostly for build system related tasks like the C preprocessor, Autoconf scripts and tools like hsc2hs. Direct support for using compiled foreign libraries from Haskell code may follow at a later date.

Please follow the installation instructions at https://emscripten.org/docs/getting_started/index.html

GHCJS requires the "upstream" emscripten backend, which is the default now. The earlier "fastcomp" backend will not work.

getting and preparing the source tree

$ git clone https://github.com/ghcjs/ghcjs.git
$ cd ghcjs
$ git submodule update --init --recursive

building the compiler

GHCJS depends on a few "local" packages in the source tree. You can use cabal-install and stack to set up a build environment that contains these packages.

Cabal new-install

After the source tree has been prepared, the package can be installed. You may want ensure that binaries of earlier versions are overwritten:

cabal v2-install --overwrite-policy=always --install-method=copy --installdir=inplace/bin

At the time of writing, cabal-install does not support creating symbolic links on Windows, even though this is the default installation method. A workaround is telling it to copy the executables instead:

cabal v1-install --prefix=inplace

v1 style Cabal sandbox

v1 style cabal sandboxes are also supported

if you want to build with a Cabal sandbox, use the makeSandbox.sh script to add the local packages.

$ cabal v1-sandbox init
$ cabal v1-install

stack

or you can use stack:

$ stack --system-ghc --skip-ghc-check install --local-bin-dir=inplace/bin

Booting GHCJS

The ghcjs-boot program builds the "boot" libraries, like ghc-prim, base and template-haskell with GHCJS. After booting, GHCJS can compile regular Haskell programs and packages.

ghcjs-boot needs to be able to find the emscripten toolchain, a nodejs executable. The easiest way to do this is by running the emsdk_env.sh script. After that, you can run ghcjs-boot by pointing it to the boot libraries (the directory containing the boot.yaml file)

$ source ~/emsdk/emsdk_env.sh
$ ./inplace/bin/ghcjs-boot -s ./lib/boot

GHCJS executables and library paths

After booting, you can add the directory containing the GHCJS binaries to your executable PATH. The ghcjs-boot program prints the location after finishing building the libraries.

You can also create a symbolic link for the ghcjs and ghcjs-pkg programs, or use the --with-compiler and --with-hc-pkg flags when using cabal-install

Generating a source distribution

if you work on boot packages that need some for an upstream library, make sure to update the patches in /lib/patches first

$ ./utils/updatePatches.sh

then regenerate the packages

$ ./utils/makePackages.sh

ghcjs-boot's People

Contributors

bergey avatar hamishmack avatar luite avatar mgsloan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghcjs-boot's Issues

ghc-prim creates a single file package.conf.inplace file which GHC 7.10 rejects

Not sure why it does this. Is it using an older version of Cabal somewhere?

I can locate that package.conf.inplace file at ~/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/ghcjs-boot/boot/ghc-prim/dist/package.conf.inplace.

In order, the following would be installed:
ghc-prim-0.4.0.0 (new package)
/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/ghcjs-boot$ [cabal]: /Users/tel/.cabal/bin/cabal "--config-file" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig" "install" "./boot/ghc-prim" "--solver=topdown" "--global" "--ghcjs" "--one-shot" "--avoid-reinstalls" "--builddir" "dist" "--with-compiler" "/Users/tel/bin/ghcjs" "--with-hc-pkg" "/Users/tel/bin/ghcjs-pkg" "--prefix" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs" "--enable-documentation" "--haddock-html" "--haddock-hyperlink-source" "--enable-library-profiling" "--root-cmd" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh"
/Users/tel/.cabal/bin/cabal --config-file /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/tel/bin/ghcjs --with-hc-pkg /Users/tel/bin/ghcjs-pkg --prefix /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-library-profiling --root-cmd /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
[1 of 1] Compiling Main             ( boot/ghc-prim/dist/setup/setup.hs, boot/ghc-prim/dist/setup/Main.o )

boot/ghc-prim/dist/setup/setup.hs:19:1: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead
Linking ./boot/ghc-prim/dist/setup/setup ...
Configuring ghc-prim-0.4.0.0...
Building ghc-prim-0.4.0.0...
Preprocessing library ghc-prim-0.4.0.0...
ghcjs-0.1.0-7.10.1.bin: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install ghc-prim-0.4.0.0
cabal: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1
ghcjs-boot: error running: /Users/tel/.cabal/bin/cabal --config-file /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/tel/bin/ghcjs --with-hc-pkg /Users/tel/bin/ghcjs-pkg --prefix /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-library-profiling --root-cmd /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh
exit status: 1
stderr: Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.

boot/ghc-prim/dist/setup/setup.hs:19:1: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead
ghcjs-0.1.0-7.10.1.bin: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
cabal: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1

filepath: exporting `isWindows` breaks hlint

Using GHCJS with Stack like so:

resolver: lts-3.9
compiler: ghcjs-0.2.0.20151230.3_ghc-7.10.2
compiler-check: match-exact
setup-info:
  ghcjs:
    source:
      ghcjs-0.2.0.20151230.3_ghc-7.10.2:
        url: "https://github.com/nrolland/ghcjs/releases/download/v.0.2.0.20151230.3/ghcjs-0.2.0.20151230.3.tar.gz"

I cannot install hlint. It looks like the filepath patch is additionally exporting isWindows, which causes the following error:

    Configuring hlint-1.9.21...
    Building hlint-1.9.21...
    Preprocessing library hlint-1.9.21...
    [ 1 of 45] Compiling Test.Util        ( src/Test/Util.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/Test/Util.js_o )
    [ 2 of 45] Compiling Test.InputOutput ( src/Test/InputOutput.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/Test/InputOutput.js_o )
    [ 3 of 45] Compiling HSE.Type         ( src/HSE/Type.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HSE/Type.js_o )
    [ 4 of 45] Compiling HSE.FreeVars     ( src/HSE/FreeVars.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HSE/FreeVars.js_o )
    [ 5 of 45] Compiling HSE.Util         ( src/HSE/Util.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HSE/Util.js_o )
    [ 6 of 45] Compiling HSE.Match        ( src/HSE/Match.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HSE/Match.js_o )
    [ 7 of 45] Compiling HSE.Scope        ( src/HSE/Scope.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HSE/Scope.js_o )
    [ 8 of 45] Compiling HsColour         ( src/HsColour.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/HsColour.js_o )
    [ 9 of 45] Compiling Parallel         ( src/Parallel.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/Parallel.js_o )
    [10 of 45] Compiling Paths_hlint      ( .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/autogen/Paths_hlint.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/Paths_hlint.js_o )
    [11 of 45] Compiling Util             ( src/Util.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/Util.js_o )
    [12 of 45] Compiling CmdLine          ( src/CmdLine.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0_ghcjs/build/CmdLine.js_o )

    /tmp/stack24478/hlint-1.9.21/src/CmdLine.hs:67:12:
        Ambiguous occurrence ‘isWindows’
        It could refer to either ‘System.FilePath.isWindows’,
                                 imported from ‘System.FilePath’ at src/CmdLine.hs:13:1-22
                                 (and originally defined in ‘System.FilePath.Current’)
                              or ‘System.Info.Extra.isWindows’,
                                 imported from ‘System.Info.Extra’ at src/CmdLine.hs:18:1-24```

ghcjs-boot install error on GHC 8.0.1

When trying to download the ghcjs-boot version from your website (with the command listed in the README of ghcjs), cabal-solver seems to choke:

Downloading http://ghcjs.luite.com/master.tar.gz
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: ghcjs-0.2.0 (user goal)
next goal: ghc-boot (dependency of haddock-api-2.17.3)
rejecting: ghc-boot-8.0.1/installed-8.0... (conflict: ghc-boot =>
binary==0.8.3.0/installed-0.8..., ghcjs => binary>=0.7 && <0.8)
trying: ghc-boot-8.0.1
next goal: binary (dependency of ghcjs-0.2.0)
rejecting: binary-0.8.3.0/installed-0.8..., binary-0.8.4.0, binary-0.8.3.0,
binary-0.8.2.1, binary-0.8.2.0, binary-0.8.1.0, binary-0.8.0.1, binary-0.8.0.0
(conflict: ghcjs => binary>=0.7 && <0.8)
rejecting: binary-0.7.6.1, binary-0.7.6.0, binary-0.7.5.0, binary-0.7.4.0,
binary-0.7.3.0, binary-0.7.2.3, binary-0.7.2.2, binary-0.7.2.1,
binary-0.7.2.0, binary-0.7.1.0, binary-0.7.0.1, binary-0.7.0.0 (conflict:
ghc-boot => binary==0.8.*)
rejecting: binary-0.6.4.0, binary-0.6.3.0, binary-0.6.2.0, binary-0.6.1.0,
binary-0.6.0.0, binary-0.5.1.1, binary-0.5.1.0, binary-0.5.0.2,
binary-0.5.0.1, binary-0.5, binary-0.4.5, binary-0.4.4, binary-0.4.3.1,
binary-0.4.3, binary-0.4.2, binary-0.4.1, binary-0.4, binary-0.3, binary-0.2
(conflict: ghcjs => binary>=0.7 && <0.8)
Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

I did this in a fresh sandbox and in my global environment.
Is ghcjs-boot GHC-8 compatible yet or could this be the error?

Compiling individual packages when developing ghcjs-boot

I am currently trying to get ghcjs to work with stack lts-8.0. As part of this process I have had to update various packages in ghcjs-boot (eg base, directory) and then fix patches for them.

Is there a way to test whether these packages compile as I am developing? At the moment I am running ghcjs-boot --dev every time I make a change, but this is very slow. I was hoping I could replicate the boot script by copying the command /..path/cabal --config-file install ./boot/directory ./boot/filepath ... --with-compiler ../ghcjs but this fails with cannot find .../ghcjs_boot.completed - naturally enough because the compiler has not booted yet!

I haven't been able to find the magic in the boot script yet that allows the command to work when run from ghcjs-boot.

cloning fails in aeson submodule

$ git clone --recursive https://github.com/ghcjs/ghcjs-boot.git
...
Checking connectivity... done.
Submodule path 'ghcjs/ghcjs-base': checked out 'ed1f69ee3d485d6659bb6fc4a395f66c9d8a0a7e'
Cloning into 'ghcjs/ghcjs-prim'...
remote: Counting objects: 129, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 129 (delta 0), reused 0 (delta 0), pack-reused 124
Receiving objects: 100% (129/129), 23.73 KiB | 0 bytes/s, done.
Resolving deltas: 100% (47/47), done.
Checking connectivity... done.
Submodule path 'ghcjs/ghcjs-prim': checked out '8e003e1a1df10233bc3f03d7bbd7d37de13d2a84'
Unable to checkout '67ea6491600cae9a6bf8a87a558badadffcac791' in submodule path 'boot/aeson'

...basically, the commit doesn't exist anymore in the upstream repo

ghcjs-boot fails to init

ghcjs-boot --init fails with error:

Data/Hashable/Class.hs:239:13:
    Not in scope: data constructor ‛J#’
    Perhaps you meant one of these:
      ‛S#’ (imported from GHC.Integer.GMP.Internals),
      ‛I#’ (imported from GHC.Exts)

Data/Hashable/Class.hs:249:26:
    Not in scope: data constructor ‛J#’
    Perhaps you meant one of these:
      ‛S#’ (imported from GHC.Integer.GMP.Internals),
      ‛I#’ (imported from GHC.Exts)
cabal: Error: some packages failed to install:
hashable-1.2.1.0 failed during the building phase. The exception was:
ExitFailure 1

Installing on Mac OS X Mavericks 10.9.1,
GHC version 7.8.20140130
GHCJS version 0.1.0

I've been following this manual. After successful installation of GHCJS I've tried to check versions of GHCJS and GHCJS-boot. But ghcjs-boot --version didn't shown version number, but suggested to run ghcjs-boot --init first because of absence of ghcjs base libraries.

performMinorGC not implemented

When I run a program that executes performMinorGC, the following is printed to the console:

index.html uncaught exception in Haskell main thread: ReferenceError: h$performGC is not defined rts.js:8792:7

packages-pretty ref in ghcjs-boot is broken

The ref in boot/pretty doesn't seem to actually be in the packages-pretty master branch.

When running ghcjs-boot --dev, it fails with

Cloning into 'boot/pretty'...
fatal: reference is not a tree: a2e79daa67b831a2b61233ca908fa14da5f5f7ad

...

Unable to checkout 'a2e79daa67b831a2b61233ca908fa14da5f5f7ad' in submodule path 'boot/pretty'
ghcjs-boot: error running: /usr/bin/git submodule update --init --recursive
exit status: 1

I chose another commit that is in the master branch and put it in boot/pretty, and ghcjs-boot worked using that. I compiled a small project with it (successfully), but haven't done any other testing of the built ghcjs.

Working fork: https://github.com/RoboNickBot/ghcjs-boot

base fails to compile when building with GHC 7.10.1-rc3

[ 55 of 192] Compiling Data.Typeable.Internal ( Data/Typeable/Internal.hs, dist/build/Data/Typeable/Internal.js_o )

Data/Typeable/Internal.hs:260:10:
    Class `Typeable` does not support user-specified instances.

Data/Typeable/Internal.hs:459:29:
    Class `Typeable` does not support user-specified instances.

Data/Typeable/Internal.hs:477:29:
    Class `Typeable` does not support user-specified instances.
Failed to install base-4.8.0.0
cabal: Error: some packages failed to install:
array-0.5.0.1 depends on base-4.8.0.0 which failed to install.
base-4.8.0.0 failed during the building phase. The exception was:
ExitFailure 1
binary-0.7.2.3 depends on base-4.8.0.0 which failed to install.
bytestring-0.10.6.0 depends on base-4.8.0.0 which failed to install.
containers-0.5.6.2 depends on base-4.8.0.0 which failed to install.
deepseq-1.4.0.0 depends on base-4.8.0.0 which failed to install.
pretty-1.1.1.3 depends on base-4.8.0.0 which failed to install.
primitive-0.5.4.0 depends on base-4.8.0.0 which failed to install.
template-haskell-2.10.0.0 depends on base-4.8.0.0 which failed to install.
ghcjs-boot: error running: /nix/store/mnc97g73n320dqncydrllha1p6q5c3in-cabal-install-1.22.0.1/bin/cabal --config-file /nix/store/cmkkk0bn4jy0dw9bfmqcvsay0k9kg4kb-ghcjs-0.1.0/share/ghcjs/x86_64-linux-0.1.0-7.10.0.20150316/ghcjs/cabalBootConfig install ./boot/array ./boot/base ./boot/binary ./boot/bytestring ./boot/containers ./boot/deepseq ./boot/integer-gmp ./boot/pretty ./boot/primitive ./boot/template-haskell --solver=topdown --configure-option=--with-gmp-includes=/nix/store/pbzgy470imzf1lyjqz70j744n98f8j47-gmp-5.1.3/include '--configure-option=--with-gmp-libraries=  /nix/store/pbzgy470imzf1lyjqz70j744n98f8j47-gmp-5.1.3/lib' --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /nix/store/cmkkk0bn4jy0dw9bfmqcvsay0k9kg4kb-ghcjs-0.1.0/bin/ghcjs --with-gcc /nix/store/qsl51gm9qcwngdsl6myg9gx8sq51skdm-gcc-wrapper-4.8.4/bin/cc --with-hc-pkg /nix/store/cmkkk0bn4jy0dw9bfmqcvsay0k9kg4kb-ghcjs-0.1.0/bin/ghcjs-pkg --prefix /nix/store/cmkkk0bn4jy0dw9bfmqcvsay0k9kg4kb-ghcjs-0.1.0 --libdir $prefix/lib/$compiler --libsubdir $pkgid --enable-documentation --haddock-html --haddock-hyperlink-source --enable-library-profiling --root-cmd /nix/store/cmkkk0bn4jy0dw9bfmqcvsay0k9kg4kb-ghcjs-0.1.0/share/ghcjs/x86_64-linux-0.1.0-7.10.0.20150316/ghcjs/run.sh

ghc-prim fails to boot on 7.10

Looks like it's having trouble finding a shim?

/bin/sh: ../../data/primops-js.txt: No such file or directory

Full log:

Resolving dependencies...
In order, the following would be installed:
ghc-prim-0.4.0.0 (new package)
/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/ghcjs-boot$ [cabal]: /Users/tel/.cabal/bin/cabal "--config-file" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig" "install" "./boot/ghc-prim" "--solver=topdown" "--global" "--ghcjs" "--one-shot" "--avoid-reinstalls" "--builddir" "dist" "--with-compiler" "/Users/tel/bin/ghcjs" "--with-hc-pkg" "/Users/tel/bin/ghcjs-pkg" "--prefix" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs" "--enable-documentation" "--haddock-html" "--haddock-hyperlink-source" "--enable-library-profiling" "--root-cmd" "/Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh"
/Users/tel/.cabal/bin/cabal --config-file /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/tel/bin/ghcjs --with-hc-pkg /Users/tel/bin/ghcjs-pkg --prefix /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-library-profiling --root-cmd /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
[1 of 1] Compiling Main             ( boot/ghc-prim/dist/setup/setup.hs, boot/ghc-prim/dist/setup/Main.o )

boot/ghc-prim/dist/setup/setup.hs:19:1: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead
Linking ./boot/ghc-prim/dist/setup/setup ...
Configuring ghc-prim-0.4.0.0...
/bin/sh: ../../data/primops-js.txt: No such file or directory
Failed to install ghc-prim-0.4.0.0
cabal: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1
ghcjs-boot: error running: /Users/tel/.cabal/bin/cabal --config-file /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/cabalBootConfig install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/tel/bin/ghcjs --with-hc-pkg /Users/tel/bin/ghcjs-pkg --prefix /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-library-profiling --root-cmd /Users/tel/.ghcjs/x86_64-darwin-0.1.0-7.10.1/ghcjs/run.sh
exit status: 1
stderr: Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.

boot/ghc-prim/dist/setup/setup.hs:19:1: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead
/bin/sh: ../../data/primops-js.txt: No such file or directory
cabal: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1

boot failure during cloning ghcjs/ghcjs-boot: error 443

Hey, @luite
I'm not certain is it a bug or my fault. I've installed GHCJS within Vagrant box, but when I run boot commang it fails with following output:

[git]: /usr/bin/git "clone" "https://github.com/ghcjs/ghcjs-boot"
/usr/bin/git clone https://github.com/ghcjs/ghcjs-boot
Cloning into 'ghcjs-boot'...
error: Failed connect to github.com:443; Connection timed out while accessing https://github.com/ghcjs/ghcjs-boot/info/refs
fatal: HTTP request failed

When I try to visit this https://github.com/ghcjs/ghcjs-boot/info/refs it gives me 404 error page.

utils/genprimopcode/ParserM.hs fails to compile on GHC 7.10

utils/genprimopcode/ParserM.hs fails to compile on GHC 7.10:

/nix/store/132fqqki4ak5dxi79zzyx63b4vnqwwsm-ghc-7.10.0.20150123/bin/ghc -o genprimopcode -O Main.hs +RTS -K128M
[1 of 5] Compiling ParserM          ( ParserM.hs, ParserM.o )

ParserM.hs:26:10:
    No instance for (Applicative ParserM)
      arising from the superclasses of an instance declaration
    In the instance declaration for ‘Monad ParserM’
ghcjs-boot: error running: /nix/store/132fqqki4ak5dxi79zzyx63b4vnqwwsm-ghc-7.10.0.20150123/bin/ghc -o genprimopcode -O Main.hs +RTS -K128M
exit status: 1
stderr:
ParserM.hs:26:10:
    No instance for (Applicative ParserM)
      arising from the superclasses of an instance declaration
    In the instance declaration for ‘Monad ParserM’

Fail to ghcjs-boot for ghc-7.10 due to cabal-solver failure

This seems to have been caused by 19620b6

$ ghcjs-boot --clean --dev --no-prof --no-haddock --ghcjs-boot-dev-branch ghc-7.10
...
Choosing modular solver.
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: aeson-0.8.1.0 (user goal)
next goal: attoparsec (user goal)
rejecting: attoparsec-0.12.1.3 (conflict: aeson => attoparsec>=0.13.0.0)
Dependency tree exhaustively searched.
ghcjs-boot: error running: /home/hvr/.cabal/bin/cabal --config-file /home/hvr/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs/cabalBootConfig install ./boot/async ./boot/aeson ./boot/attoparsec ./boot/case-insensitive ./boot/dlist ./boot/extensible-exceptions ./boot/hashable ./boot/mtl ./boot/old-time ./boot/parallel ./boot/scientific ./boot/stm ./boot/syb ./boot/text ./boot/unordered-containers ./boot/vector ./ghcjs/ghcjs-base --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /home/hvr/.cabal/bin/ghcjs --with-hc-pkg /home/hvr/.cabal/bin/ghcjs-pkg --prefix /home/hvr/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs --disable-documentation --haddock-html --haddock-hyperlink-source --disable-library-profiling --root-cmd /home/hvr/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs/run.sh -v2 --dry-run
exit status: 1
stderr: Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: Could not resolve dependencies:
trying: aeson-0.8.1.0 (user goal)
next goal: attoparsec (user goal)
rejecting: attoparsec-0.12.1.3 (conflict: aeson => attoparsec>=0.13.0.0)
Dependency tree exhaustively searched.

Permission denied, maybe due to wrong file access mode

While running the boot i get the following error:

/nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/lib/ghc-7.10.1/include$ cp_r ./ -> /home/francesco/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs/include_native
ghcjs-boot: 
during copy from: /nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/lib/ghc-7.10.1/include/./HsFFI.h to: /home/francesco/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs/include_native/./HsFFI.h
Exception: /home/francesco/.ghcjs/x86_64-linux-0.1.0-7.10.1/ghcjs/include_native/./HsFFI.h: openBinaryFile: permission denied (Permission denied)

I can correctly read the file, from another shell:

 ~ $ head -n2 /nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/lib/ghc-7.10.1/include/./HsFFI.h
/* -----------------------------------------------------------------------------
 *
 ~ $ 

It seems that the command is trying to open the header file as a binary file. I am running the command as in the doc:

ghcjs-boot --dev --ghcjs-boot-dev-branch ghc-7.10

My clone of ghcjs is at c1b6239b0289371dc6b8d17dfd845c14bd4dc490, and my clone of ghcjs-prim at bd83ce26f7e32fa9dc6c762d05ca595589d7b1a3

performEvent and performEventAsync

performEvent and performEventAsync give me the following:
JavaScript exception: process_commandToProcess: unsupported

I am simply trying to run an IO action (userRepos from the github package) whenever an event occurs.

Transformers

In the ghc-7.10 branch, your transformers submodule is @724ec58b (April 24, 2015), recent.

In transformers commit @2877c00 (March 25, 2015), several typeclass methods were removed (eq1 from Eq1 typeclass, ord1 from Ord1 typeclass) - a breaking change - but there was no change made to transformers version number.

This breaks ekmett's linear package, which uses these dropped methods. Is it possible to set ghcjs-boot's version to perhaps the commit just before this breaking commit? Maybe transformers@08f025b (also March 25, 2015)?

Patch for unix-2.7.2.1 causes boot failure with ghc-8.0.2

I've been getting this error preventing ghcjs from booting, corresponding to the following patch. I've been using stack with lts-8.16 (in a clean docker environment).

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
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index a838352..8e7e317 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -281,7 +281,7 @@ mode2Int SeekFromEnd  = (#const SEEK_END)
 -- | May throw an exception if this is an invalid descriptor.
 fdSeek :: Fd -> SeekMode -> FileOffset -> IO FileOffset
 fdSeek (Fd fd) mode off =
-  throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
+  throwErrnoIfMinus1 "fdSeek" (fmap fromIntegral $ Base.c_lseek fd (fromIntegral off) (mode2Int mode))
 
 -- -----------------------------------------------------------------------------
 -- Locking

Going to have a play and see whether I can get it to compile, but I don't really get what's going on here.

build release tarballs

ghcjs-boot really shouldn't depend on git and automake (most haskell programmers might have them installed, but it's more things that can go wrong, in particular on windows), so it'd be better to prepare the source using some script, and let ghcjs-boot download a tarball instead.

package script:

  • apply patches
  • run automake

ghcjs-boot:

  • integer-gmp configuration (platform specific)
  • cabal build

custom library paths (integer-gmp)

users might want to build integer-gmp with a custom library location, support should be added for a few options:

  • build supplied integer-gmp (should be the default, at least on windows?)
  • use system gmp
  • use custom gmp (make sure the mkGmpDerivedConstants uses the same lib)

Missing GHC.PrimopWrappers?

Hi,

I'm trying to run ghcjs-boot --dev but keep getting Configuring ghc-prim-0.4.0.0... setup: Error: Could not find module: GHC.PrimopWrappers with any suffix: ["gc","chs","hsc","x","y","ly","cpphs","hs","lhs"]

I noticed that ghc-prim.cabal includes GHC.PrimopWrappers in exposed-modules, but I can't find that module in the GHC directory. This would explain the error I'm getting, but these files haven't changed for a long time so it seems unlikely I'm the first running into this?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.