HackEso/Haskell

From Esolang
Jump to navigation Jump to search

Notes on compiling Haskell programs for HackEso

These notes use Burlesque as an example, but should generalize to other Haskell programs (possibly with different versions of GHC).

  • match the distribution: Debian 10 (soon: 11). debootstrap --arch=amd64 oldstable /<some chroot>
  • install GHC + Burlesque dependencies (apt-get install make ghc alex happy g++ cabal-install git wget curl xz-utils)
  • compile correct GHC version (8.8.4 for Burlesque).

    crucially, use ./configure --disable-large-address-space to disable the GHC runtime's default of reserving 1TiB of address space on startup, which does not work in UML

  • enable split-objs in ~/.cabal/config (cabal update first creates this file)
  • install Burlesque dependencies cabal install split haskeline mtl regex-compat parsec digits statistics monadlist utf8-string
  • compile Burlesque with ghc -static (which causes ghc to link all Haskell libraries into the executable... but not libc)
  • maybe adjust paths to /hackenv/tmp. there's no convention for this yet but watch HackEso for future developments.
  • strip the binaries