Building and booting the Haste compiler
This document briefly describes how to build Haste from scratch. This is fairly easy on Linux-based systems, and a bit less easy on Windows.
Build dependencies all non-Haskell dependencies necessary to build as well as bootstrap Haste.
For all platforms
- GHC 7.10
- pandoc (to build man pages)
Additional Windows dependencies
- Cygwin, including GCC
Additional OSX dependencies
- Apple's XCode developer kit
As Haste support is not yet merged into vanilla Cabal, for now we have to use
haste-cabal wrapper. An appropriate pre-built version of this binary
is downloaded as part of Haste's bootstrap process, so building it yourself
is not strictly necessary to build Haste from scratch.
However, if you experience problems with the pre-built binaries, building from
source is always a good idea.
Start by checking out the source and switching to the appropriate branch:
$ git clone https://github.com/valderman/cabal && cd cabal $ git checkout haste-cabal
Then we build and install the Cabal library:
$ cd Cabal && cabal install
Finally, install the modified cabal binary itself:
$ cd ../cabal-install && cabal install
haste-cabal has a runtime dependency on the versions of
libffi it was linked against. If you intend to run your binary on
another machine than the one you built it on, you may want to bundle those
libraries with your binary and use a wrapper script to execute it with the
appropriate library environment.
If you are building a released version, simply use cabal and you're done:
$ cabal update && cabal install haste-compiler
If you are building a development branch, or if you want to build a portable binary package, you should start by checking out the source from GitHub:
$ git clone https://github.com/valderman/haste-compiler && cd haste-compiler
If you simply want to install the current development version, just install it with cabal as usual:
$ cabal install
If you want to build a portable binary package, the process is slightly different:
$ cabal configure -fportable -fstatic $ cabal build
All binaries will be build and copied into the
in the repository root.
portable flag tells Haste to look for libraries and settings in the
directory where the
hastec binary resides, while the
static flag enables
building the Haste binaries statically. On OSX, the latter flag doesn't do
anything as OSX is rather hostile towards static linking.
Be aware that a portable installation is statically linked (except on OSX),
and thus includes
libgmp. This comes with a small legal gotcha:
- you will need the static
.afiles) to build, and
- if you are distributing portable Haste binaries with proprietary modifications, you are violating the LGPL license of libgmp unless you also provide your application in source or object format. If this is a problem for you, consider contributing your changes back to mainline Haste under the BSD3 license.
Booting Haste is now a matter of running the appropriate
If you installed the Haste binaries onto your system (as opposed to building
the portable binaries), you just add Cabal's local binary directory to your
search path, and then run
haste-boot --local from the root of your source
repository, indicating that you want to use the libraries already present
in that directory instead of downloading some other version.
If you built and installed your own
haste-cabal binary, you will want to
haste-boot to avoid downloading a pre-built
haste-cabal binary and
instead use your pre-built binary using the
haste-boot --help for more bootstrapping options.
If you built the portable binaries, you instead need to run the
binary that got copied into
haste-compiler (which is highly unlikely to be
on your search path):
$ haste-compiler/bin/haste-boot --local
Haste will be bootstrapped into said directory rather than into
If you built your own
haste-cabal binary, you will want to use the
--with-haste-cabal=$YOUR_BINARY flag to ensure
$YOUR_BINARY is used instead
of the one
haste-boot would otherwise download.
Building a complete portable package
The process of checking out a clean copy of Haste, building, booting and
packing up the result into a redistributable binary package is automated using
In order to build a portable Debian package, for instance, simply run
runghc build-release deb and a Debian package will appear in the
ghc-7.10 directory in the root of Haste's source tree.
The build-release script can build multiple file formats in one go; simple pass all formats you wish to build as command line arguments. To see which formats are currently supported by build-release, run it without arguments.