-
Notifications
You must be signed in to change notification settings - Fork 841
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
Automate setup of ghcjs #749
Comments
Just to point out, ghcjs doesn't install anything like normal GHC so I think instead what should happen is that once ghcjs is released to hackage (which should hopefully happen soon!), it should just be added into stackage. At that point, stack itself can compile ghcjs. Just to see that this actually works, I just built ghcjs today using stack and the following stack.yaml
This gives the ghcjs binary in That gets the ghcjs binary. Next, https://github.com/ghcjs/ghcjs-boot/tree/improved-base should be merged into stackage somehow. Indeed, ghcjs-boot is a mini-stackage, with fixed versions of dependencies and a few patches on top of those packages. That way, the given stackage snapshot versions of things like bytestring, aeson, etc. are used. Finally, the ghcjs-boot exe (source at https://github.com/ghcjs/ghcjs/blob/improved-base/src-bin/Boot.hs) must have parts of it re-implemented in stack. What it does now is clone the ghcjs-boot tree, apply patches, and build using ghcjs all these packages. But this is exactly what stack can do once ghcjs-boot is merged into stackage somehow. |
Hey, thanks for looking into this!
I've discussed it with Luite a little bit at ICFP, and it's certainly possible to have a binary build of GHCJS which installs the same way as GHC. This is better than having a source distribution because it takes lots of time to build everything, and things can go wrong along the way. The new GHCJS instructions seem quite promising (just It may indeed make sense to have stack install ghcjs from source in the meantime, I'll discuss this further with Luite.
Right, down the road we will need a separate set of stackage snapshots for GHCJS. Until then all dependencies will need to be explicit via the |
@wuzzeb , good news! We're going with pretty much the approach you describe. At some later date, it'll hopefully be switched over to binary distributions. @snoyberg Convinced me that we shouldn't "let perfect be the enemy of good" here, which makes sense to me. Here's how it's going to work:
I've discussed this with Luite a bit, and we've concluded that these pre-release versions of GHCJS should have version numbers which include the build date in them. For example,
Until this bit happens, I'll probably just have the implementation on the ghcjs-setup branch use the improved-base tarball |
I'd recommend using Github releases for hosting the tarballs, if possible. That should also save Luite some bandwidth ;). |
Here's how things currently work:
TODO:
Questions:
|
Isn't node required to build anything that uses Template Haskell? On Wed, 23 Sep 2015 4:04 am Michael Sloan notifications@github.com wrote:
|
I'll argue for not installing node. As you say, users will have a variety of management options and opinions around it. Tools like ndenv make it straightforward to install and manage multiple versions of node, and to automatically select between them on a per-project basis. OTOH, guarding against and failing vociferously if the provided version of node is known to be incompatible would be very useful. |
Yup, but it's even more essential than that - it's also used while building GHCJS projects, to run Setup.hs.
Yup, I think this is the responsibility of ghcjs-boot. One of the reasons I'm inclined towards not automatically installing node is that we'd need a good way to pick a version. One possibility would be to have each ghcjs version in stack-setup-2 also specify a node version, but this seems ugly. |
Recommended usage looks like:
This will install an old-base version of ghcjs. improved-base / master versions of ghcjs will have version 0.2.0. I can upload a source tarball for those if there's demand. |
Awesome; I tried it out and it seems to manage installing
Any idea what went wrong? |
I added:
to
|
@CRogers Thanks for trying it out! Do you happen to have |
@CRogers I've pushed a change that uses |
Cool, that seems to have let it continue (it's now booting ghcjs). Thanks! |
It works great! |
Preliminary test on Windows is a failure. stack.yaml contains:
Results:
A clean Windows installation lacks gzip and tar. The normal GHC stack environment now contains the MSYS2 suite, which provides gzip by default but, inexplicably, not tar. |
tar is included in MSYS2 as well, I'm not sure why it's not being found. Investigating. |
Now I see what @mgsloan meant in our call earlier. The MSYS2 environment is not being initialized at all for the GHCJS installation, which is why the executable isn't being found. I think I can fix that. |
I take it back, tar really isn't in MSYS2, strangely enough. @mgsloan what do you think about just using 7z to decompress the files on Windows, like we do for MSYS itself and GHC? |
@snoyberg Sounds like the right approach to me! |
@snoyberg I've pushed a change which should make it use 7zip for this on windows. Does it work? |
Discussed in private chat, repeating here: the current code ungzips the file, but doesn't untar. It needs to call 7z twice like we do for GHC bindists. |
I've fixed the unzip issue, but now it runs into the long paths issue - #1145 Since this is essentially done, tracking the remaining work for windows support in that issue. |
One of the latest changes broke GHCJS setup for me:
My flags: {}
packages: ...
resolver: ghcjs-0.2.0.20151001_ghc-7.10.2
compiler-check: match-exact
setup-info:
ghcjs:
source:
ghcjs-0.2.0.20151001_ghc-7.10.2:
url: "https://github.com/fizruk/ghcjs/releases/download/v0.2.0.20151001/ghcjs-0.2.0.20151001.tar.gz"
extra-deps: ... I am not sure if this deserves a separate issue. |
@fizruk Ah, I think that can happen if it was built with an earlier version of master, but not yet booted. I cleaned up the sdist unpack directory (was I've pushed a change which allows the boot process to use the old path. Does it work now? |
@mgsloan yeah, seems to work now! Thanks! |
@fizruk How did you make your release for the |
@CRogers |
You will also need to modify I know, this kindof sucks. It'd be nice to get all the boot / sdist stuff simplified and always doing the "right thing" without configuration. |
Yeah, I worked out to modify the stuff to checkout in |
Are there plans to support stack projects that have both GHC and GHCJS packages in them (e.g. server and front-end packages)? |
Rough outline of what needs to be done here:
Stack.Setup
to know how to install these binary distributions. If they work the same as the normal GHC ones, then this change should be pretty minimal:soptsUseGHCJS :: Bool
to SetupOptsghcjs
section ofstack-setup.yaml
instead of theghc
section.The text was updated successfully, but these errors were encountered: