GithubHelp home page GithubHelp logo

ryantrinkle / ghcjs-setup Goto Github PK

View Code? Open in Web Editor NEW
33.0 6.0 5.0 345 KB

GHCJS installer and build tool based on Nix package manager

License: BSD 3-Clause "New" or "Revised" License

Shell 82.98% Nix 17.02%

ghcjs-setup's Introduction

IMPORTANT

This package is now obsolete. It has been superceded by try-reflex.

ghcjs-setup

NixOS users, please read the important note below before continuing

To install, do this:

git clone https://github.com/ryantrinkle/ghcjs-setup
cd ghcjs-setup
./ghcjs-setup

This will install the Nix package manager, grab the ghcjs package information, build everything, then give you access to a sandbox with ghcjs and node.js available. The first time you run it, the build process will take a long time - up to several hours. After that, it should only take a few moments.

You will need sudo access in order to install Nix (unless you are on NixOS). However, you should run the script as yourself, not root - it will prompt for your password when necessary.

Note: Enabling the binary cache on NixOS

When using Nix on NixOS, only root can add binary caches to the system. This will force ghcjs-setup to rebuild GHCJS from scratch, which takes hours. To enable the binary cache, you can add the following line to your /etc/nixos/configuration.nix:

  nix.trustedBinaryCaches = [ "https://ryantrinkle.com:5443" ];

If you already have a trustedBinaryCaches option set up, just add https://ryantrinkle.com:5443/ to the existing list.

Once it's been added, run sudo -i nixos-rebuild switch to make the change take effect, then run ghcjs-setup as normal.

ghcjs-setup's People

Contributors

aaronlevin avatar k0001 avatar sheganinans avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ghcjs-setup's Issues

Problem running it on OSX Yosemite.

vh:ghcjs-setup apple1$ ./ghcjs-setup.sh
If you have any trouble with this script, please submit an issue at https://github.com/ryantrinkle/ghcjs-setup/issues
/Users/apple1/.nix-profile/bin/nix-shell
Entering the ghcjs/nodejs sandbox; this may take several hours the first time you run it
/Users/apple1/.nix-profile/bin/nix-shell: line 3: use: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 4: use: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 5: use: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 6: use: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 7: use: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 9: binmode: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 11: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 12: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 13: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 14: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 15: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 16: my: command not found
/Users/apple1/.nix-profile/bin/nix-shell: line 18: syntax error near unexpected token (' /Users/apple1/.nix-profile/bin/nix-shell: line 18:my @instArgs = ();'
It looks like a problem occurred. Please submit an issue at https://github.com/ryantrinkle/ghcjs-setup/issues

bootstrap-glibc.drv requested impure path '/bin/sh', but it was not in allowed-impure-host-deps

I have encountered this error message when I ./ghcjs-setup.

patching /nix/store/ysmyi3fafm9ngnq7hpzg6pkag4k8bi3h-bootstrap-tools/lib/libpcrecpp.so.0.0.1
patching /nix/store/ysmyi3fafm9ngnq7hpzg6pkag4k8bi3h-bootstrap-tools/lib/libpcreposix.so.0.0.3
building '/nix/store/2y6c0xhdxh0g2m6j4czyxxjq3blz97j7-stdenv-linux-boot.drv'...
error: derivation '/nix/store/bzc72d3bc8y7pgpjqplbxxnjgyrbzhmf-bootstrap-glibc.drv' requested impure path '/bin/sh', but it was not in allowed-impure-host-deps
It looks like a problem occurred. Please submit an issue at https://github.com/ryantrinkle/ghcjs-setup/issues and we'll look into it right away

nixos-version
18.09.2574.a7e559a5504 (Jellyfish)

touch /bin/sh
touch: cannot touch '/bin/sh': Text file busy

Packages added in shell.nix require rebuilding ghc and ghcjs

I'm not sure whether this is a documentation issue or a "bug" per se; I'm not yet familiar enough with Nix. (I am running NixOS in a VM.)

shell.nix has a comment: # Add Haskell packages to your environment here. After successfully running ghcjs-setup unmodified, I tried adding, e.g. lens on the next line. This seems to require rebuilding both ghc and ghcjs from source, which is beyond the capability of my VM:

[christian@nixos:~/ghcjs-setup]$ nix-shell
these derivations will be built:
  /nix/store/h8gbz8hfpvc86gsndkpr8166v86wrv5y-ghc-7.10.0.20150123.drv
  /nix/store/y711v3jbxkr21ny9snmmak5ysvk8d1rq-ghcjs-0.1.0.drv
these paths will be fetched (0.00 MiB download, 39.39 MiB unpacked):
  /nix/store/07azljpiya0h4jcw6nvxb9vbjdnp4vcw-haskell-lens-4.7
  [other dependencies]

(And it starts downloading cached binaries from https://ryantrinkle.com:5443/.)

Is this the expected behavior, i.e. not using the same ghc/ghcjs builds in non-ghcjs-setup usage?

(By the way, what I actually want to do is build the derivation for ocharles's virtual-dom with a command ala NIX_PATH=nixpkgs=/home/$USER/ghcjs-setup/nixpkgs/ nix-shell, which gives the same sort of result.)

Use upstream nixpkgs

I've been having problems with compiling some packages because the shipped version of GHC 7.10 had a bug. When I pulled the latest nixpkgs from https://github.com/NixOS/nixpkgs and re-run the script I've got a nice working GHC 7.10.1 install with the needed bugfixes.

Why not use upstream nixpkgs?

Network Issues with ryantrinkle.com

I'm not completely sure this should be reported as a problem, but I'm going to do it for posterity at least. The interesting line seems to be curl: (6) Couldn't resolve host 'ryantrinkle.com'. When I retry, then it works for a little while longer, until it eventually hits the same error again, but for a different "derivation". There's a chance it's my local connection, but that seems somewhat unlikely.

I'm going to just keep trying until everything downloads, but there might be an issue with one of the servers.

This script is amazing by the way. Thanks so much.

*** Downloading ‘https://ryantrinkle.com:5443/nar/4blb0h4jgc1naw0vfgykbq2q9y2pk84s.nar.bz2’ to ‘/nix/store/4blb0h4jgc1naw0vfgykbq2q9y2pk84s-perl-5.20.1’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  159k    0  159k    0     0  67556      0 --:--:--  0:00:02 --:--:--  117k  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 50339    0 50339    0     0  13106      0 --:--:--  0:00:03 --:--:-- 64953

100  543k    0  543k    0     0  72517      0 --:--:--  0:00:07 --:--:-- 74808  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  639k    0  639k    0     0  70051      0 --:--:--  0:00:09 --:--:-- 27727curl: (6) Couldn't resolve host 'ryantrinkle.com'

bzip2: Compressed file ends unexpectedly;
    perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
    Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

error: unexpected end-of-file
download of ‘https://ryantrinkle.com:5443/nar/718rcfkxmimrzbxsl29bl7s20f5sdl0q.nar.bz2’ failed: No such file or directory
100  806k    0  806k    0     0  80149      0 --:--:--  0:00:10 --:--:-- 61072

fetching path ‘/nix/store/8fjq1k9wga3s6fm6qrdb8dx17m732cyw-gnugrep-2.20’...
100  335k    0  335k    0     0  33136      0 --:--:--  0:00:10 --:--:--  144k
*** Downloading ‘https://ryantrinkle.com:5443/nar/8fjq1k9wga3s6fm6qrdb8dx17m732cyw.nar.bz2’ to ‘/nix/store/8fjq1k9wga3s6fm6qrdb8dx17m732cyw-gnugrep-2.20’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:11 --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  627k    0  627k    0     0  53975      0 --:--:--  0:00:11 --:--:--  162k

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48943    0 48943    0     0   5311      0 --:--:--  0:00:09 --:--:-- 10041still waiting for ‘https://cache.nixos.org/718rcfkxmimrzbxsl29bl7s20f5sdl0q.narinfo’ after 5 seconds...
100  207k    0  207k    0     0  10298      0 --:--:--  0:00:20 --:--:--  6651could not download ‘/nix/store/718rcfkxmimrzbxsl29bl7s20f5sdl0q-http-parser-2.3’ from any binary cache
fetching path ‘/nix/store/718rcfkxmimrzbxsl29bl7s20f5sdl0q-http-parser-2.3’ failed with exit code 1
killing process 17925
killing process 17887
killing process 17882
error: some substitutes for the outputs of derivation ‘/nix/store/cxap2fn0cdqxs6awqm6gq299nf7wk8nr-nodejs-0.10.36.drv’ failed (usually happens due to networking issues); try ‘--fallback’ to build derivation from source 
/home/beardy/.nix-profile/bin/nix-shell: failed to build all dependencies
It looks like a problem occurred.  Please submit an issue at https://github.com/ryantrinkle/ghcjs-setup/issues and we'll look into it right away

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.