Go through the following from within the project root.
This will:
- Move
~/.ghc
to avoid a known bug - Create a user-writable
/app
for building - Clone the halcyon build tool into
/app
- Remove any current build artifacts
#!/bin/sh
set -e
if [ -d ~/.ghc ]; then
mv ~/.ghc ~/ghc.bak
fi
if [ ! -w /app ]; then
sudo mkdir -p /app
sudo chown $USER /app
fi
if [ ! -d /app/halcyon ]; then
git clone https://github.com/mietek/halcyon.git /app/halcyon
fi
cabal clean
cabal sandbox delete
Update the private storage variables and run the following:
#!/bin/sh
set -e
# TODO:
export HALCYON_AWS_ACCESS_KEY_ID=
export HALCYON_AWS_SECRET_ACCESS_KEY=
export HALCYON_S3_BUCKET=
/app/halcyon/halcyon build --no-clean-private-storage
ln -sf /app/sandbox/.halcyon-sandbox.config cabal.sandbox.config
Prepare your shell environment:
% source <(/app/halcyon/halcyon paths)
# POSIX version
% /app/halcyon/halcyon paths > halcyon-env && . halcyon-env
You can either do the above every time, or add it to your shell startup file.
Do work:
% ghci foo.hs
% cabal test
% yesod devel