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

Package IHaskell [$25 awarded] #205

Closed
gibiansky opened this issue Mar 2, 2014 · 22 comments
Closed

Package IHaskell [$25 awarded] #205

gibiansky opened this issue Mar 2, 2014 · 22 comments
Labels

Comments

@gibiansky
Copy link
Member

This is a while out, but it might be nice to package IHaskell nicely for end-users that aren't as experienced with Haskell.

Other ideas:

  • Make a Docker build (Dockerfile build #136) so that it is easy to install on any Linux distribution
  • Package as Mac app (that can hang around in the task bar and have it's own window instead of using a browser, by having our own webview or something.)
  • Package for windows like Sage does (see here)
  • Package for package managers?
    • Homebrew?
    • Debian's apt-get?

Not sure which of these are worthwhile, but might be a good effort to get IHaskell and Haskell out to a wider audience.

The $25 bounty on this issue has been claimed at Bountysource.

@houshuang
Copy link
Contributor

Not just for Haskell end-users, it's apparently even hard for people who have used Haskell a bit to get it to install :)

@gibiansky
Copy link
Member Author

The packaging will be intended for intro users, and might not support things such as using the system-installed cabal. But installation and compilation issues will be addressed ASAP as well :)

I'm currently thinking of handling the packaging by bundling a Vagrant machine with everything. We'll see how it goes.

@etrepum
Copy link
Contributor

etrepum commented May 19, 2014

I'll start looking into what it would take to make a self-contained relocatable GHC on Mac, which could then be leveraged for IHaskell. I dug around a bit in the GHC 7.8.2 binary distribution and the only non-relocatable stuff I found were the package.conf.d files which might be able to be rewritten to use ${pkgroot} instead. This article that you posted in haskell-cafe also looks relevant http://www.edsko.net/2013/02/10/comprehensive-haskell-sandboxes/

@gibiansky
Copy link
Member Author

Great! IHaskell isn't currently upgraded to GHC 7.8, but should be soonish.

@etrepum
Copy link
Contributor

etrepum commented May 22, 2014

Here's a proof of concept that wraps up GHC in a relocatable way https://github.com/etrepum/ghc-dot-app

@etrepum
Copy link
Contributor

etrepum commented May 23, 2014

http://ghcformacosx.github.io/ – ping me when 7.8.2 support happens and I'll take a stab at doing something similar for IHaskell

@gibiansky
Copy link
Member Author

This is awesome. I'll try to get IHaskell on GHC 7.8 ASAP, I really want to
see this working with IHaskell :D

@gibiansky
Copy link
Member Author

@etrepum 7.8.2 support is here! On branch ghc7.8. How do we get this nicely packaged? :D

I have a pretty Obj-C/Cocoa app that I'd like to stick IHaskell in. This app simply relies on IHaskell already running on a given port. How might I package this app with IHaskell so that everything works locally without sticking stuff in other filesystem places?

@etrepum
Copy link
Contributor

etrepum commented Jun 12, 2014

I'm out of town this week but will try and take a look mid next week when I'm done catching up with other things. It really depends on how amenable the dependencies are to relocation.

Is that app open source somewhere? I can poke at it and see what it would take to integrate the two. The current ghc-dot-app is in two very distinct pieces, a simple Haskell build script that forces GHC into a relocatable state, and then a Cocoa app that assumes that all of the GHC files are in the right place in the application bundle (which is handled by calling out to the build script and rsync from the xcode project).

@gibiansky
Copy link
Member Author

It's a pretty simple app: https://github.com/gibiansky/ihaskell-app

I'm not sure it's really all that relevant. Would be nice to package IPython with it, too. Any suggestions on how to do that? Or just let IHaskell install it itself on first run?

@etrepum
Copy link
Contributor

etrepum commented Jun 15, 2014

Cool, I'll take a look at making this happen this week.

The app I built for the helper tool is actually kinda similar, I use Xcode to build it (mostly to get all of the Info.plist and icons generated properly) but I didn't use nibs and it's just a webkit shell: https://github.com/ghcformacosx/ghc-dot-app/blob/master/GHC/GHC/GHCAppDelegate.m

@etrepum
Copy link
Contributor

etrepum commented Jul 2, 2014

Haven't had a chance to make much progress yet, but just wanted to make some notes in here. It seems the "state of the art" for embedding IPython into an app is these two projects:

@etrepum
Copy link
Contributor

etrepum commented Jul 5, 2014

So far I've just managed to get IHaskell to build properly, haven't worked on the relocatable app part just yet. Here's all of the steps from fresh homebrew + GHC install to working build (given my relocatable branch which makes a few smallish changes) https://github.com/etrepum/IHaskell/tree/relocatable

brew tap homebrew/versions
brew install gcc48
brew install cairo --without-x11
brew install pango --without-x11
brew install zeromq
brew install libmagic
brew install python
cabal sandbox init
cabal install --only-dependencies --package-db=clear --package-db=global
cabal install magic --package-db=clear --package-db=global --extra-lib-dirs=/usr/local/lib --extra-include-dirs=/usr/local/include
cabal install gtk2hs-buildtools --package-db=clear --package-db=global
cabal install cairo glib pango --package-db=clear --package-db=global --with-gcc=gcc-4.8
./build.sh all display

here=$PWD
(cd $TMPDIR; bash $here/installation/virtualenv.sh --always-copy $here/env)
bash installation/ipython.sh env
python $TMPDIR/virtualenv-1.11.6/virtualenv.py --relocatable $here/env

./.cabal-sandbox/bin/IHaskell -i $PWD/env/bin/ipython notebook

I'm not 100% sure the package-db flags are necessary but I wanted to do my best to avoid picking up things I have installed in my ~/.ghc.

@gibiansky
Copy link
Member Author

That looks good. Let me know if I can help or add any features to make it easier :)

@gibiansky gibiansky changed the title Package IHaskell Package IHaskell [$25] Oct 21, 2014
@houshuang
Copy link
Contributor

Having again run into issues with installing IHaskell, I'm very interested in this. However, I'm curious about how closely the Haskell-environment required to build IHaskell is tied to the environment that you are actually evaluating code in. If it was not possible to install any new libraries etc, it would be quite useless to me. Currently I am struggling to install IHaskell because I tried using Stackage, which has worked great for other libraries, but which only supplies for example haskell-src-exts 0.16, which does not work with IHaskell... It would be great to just get the IHaskell binary, and then be able to use that with whatever other libraries I want (I limitation in GHC version could be acceptable). So I'm not so concerned with having everything in a GUI executable (although that would be neat for some people), but more to be able to quickly get the latest version of IHaskell without having to worry about all the dependencies...

(Adding IHaskell to Stackage would be another way of getting this, but it would mean aligning with the versions of libraries that are current there).

@mietek
Copy link
Contributor

mietek commented Dec 16, 2014

Using Halcyon, I have repackaged IHaskell as Instant IHaskell.

Instant IHaskell can be installed with a single command, complete with all of its display modules. The same command can build IHaskell from scratch, or restore IHaskell using previously-built archives — in seconds.

halcyon install https://github.com/mietek/instant-ihaskell

A couple caveats — this is freshly made, and while I have verified all display modules appear to work, I have not done any serious testing. Additionally:

  1. I have only prepared IHaskell to build and run on Ubuntu 14.04 LTS (x86_64). This can be easily remedied given more time, as Halcyon already supports declaring dependencies on OS packages in a cross-platform fashion.
  2. I have pulled out the main IHaskell executable into a separate package, and declared all other IHaskell packages as build-time dependencies of this package. IHaskell wants all of its modules to be registered in a GHC package database, and the easiest way to achieve that with Halcyon is to have them automatically registered in the same sandbox.

The Halcyon-specific magic files are contained in a single directory. The purpose of each magic file is explained in the Halcyon user’s reference. Please also see the section on declaring dependencies in the Halcyon user’s guide.

@gibiansky
Copy link
Member Author

Very cool! With regards to "I have pulled out the main IHaskell executable into a separate package", is that something that you think should be changed about the main repo? Also, I do not have access to a Ubuntu box to test his at the moment (though I may spin up an AWS server for it) – is it possible to do this all on a Mac? (The Halcyon documentation is a little unclear on this point. I find it a little strange that it writes into a nonexistent /app directory, and it's not explicitly stated what OSes it works on at the moment?)

@gibiansky
Copy link
Member Author

Ah, nevermind, just saw the 'supported platforms' bit.

@mietek
Copy link
Contributor

mietek commented Dec 16, 2014

The documentation is still a work in progress, and definitely needs to be improved. Comments are welcome.

Initially, Halcyon started out as supporting Ubuntu only, and support for other distros is a recent addition. Halcyon does work on OS X, but automatic installation of native OS packages is not yet supported there.

Getting an Ubuntu test box is easiest on DigitalOcean — they spin up in under 60 seconds, and can be set up for Halcyon in about the same time.

The /app directory is just a default, which can be changed in two ways. To install an app somewhere else, specify a custom --prefix. Halcyon will still use /app for GHC and Cabal sandboxes, unless you force it to rebuild everything from scratch, by specifying a custom --base.

@gibiansky
Copy link
Member Author

@houshuang Check out Kronos Haskell.

@gibiansky
Copy link
Member Author

@mietek I'm closing this issue as I meant it mostly for Kronos Haskell but I experimented a bit with BountySource so there's a $25 bounty on it. If you want to claim it please do so – your work on Halcyon is pretty awesome! (I came to the conclusion that I am not a big fan of BountySource... I do not like their model very much.)

Other issues with more specific requests can be opened – things like packaging for Windows via virtual machine, packaging for homebrew or apt-get, etc, are still valid and potentially desirable.

@mietek
Copy link
Contributor

mietek commented Jan 5, 2015

Thanks. As an update — Instant IHaskell now supports one-click deployment to DigitalOcean instances running Ubuntu 14.04. CentOS 7 is not fully supported yet, as a problem with pango prevents two IHaskell display modules from building.

My packaging should also allow IHaskell to be deployed to Heroku. Unfortunately, the 1.6GB installation directory chokes Heroku’s internal distribution systems. Hopefully, this will be fixed in the future, and everyone will be able to spin up their own IHaskell instances, for free, on Heroku.

@gibiansky gibiansky changed the title Package IHaskell [$25] Package IHaskell Jan 5, 2015
@gibiansky gibiansky changed the title Package IHaskell Package IHaskell [$25 awarded] Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants