Stack To Elm Them All

Ever wondered - or forgot - how to build the Elm Compiler?

2018-09-07

Ever wondered - or forgot - how to build the Elm Compiler with tracing using Haskell Stack? Here’s how you do it

Init with stack

stack init --resolver lts-11.20

Add options in elm.cabal:

Executable elm
  if flag(dev)
    ghc-options: -O0 -Wall -Werror -rtsopts -eventlog

Build with stack:

stack build --flag elm:dev --profile

Run with RTS options:

elm make ./src/Main.elm \
  --output=./dist/app.js +RTS -xc -lu -RTC \
  2>eventlog_readable.log

This is essentially just a reminder for me on how to do it that I wanted to preserve from death-by-slack-history.

Might also be useful

lsb_release -a
uname -a
stack --version

Comments

The comments for this post are available on this issue on GitHub. Feel free to engage in conversation over there.

If you decide to enable JavaScript the GitHub API will be used to display the conversation here for the viewer's convenience.