8

How do I get a stack build command to dump the GHC Core? I've tried this, to no avail:

stack build :hello_world --ghc-options '-ddump-simpl'
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
dbanas
  • 1,707
  • 14
  • 24

1 Answers1

7

Make sure to clean before, or force recompilation via the stack option --force-dirty and ghc option -fforce-recomp.

The files are dumped somewhere around .stack-work/dist/.../build/hello_world/hello_world-tmp/.

Li-yao Xia
  • 31,896
  • 2
  • 33
  • 56
  • 2
    That "where did my dump files go?" thing is super-annoying. Do you know if it works to add `-dumpdir=mydumps` to the GHC options, or does stack override that? – dfeuer Jan 09 '18 at 02:42
  • 1
    Yeah, sorry about that, stack parses ddump-hi to get info for recompilation detection. Ideally, it could only redirect that particular ddump – mgsloan Jan 09 '18 at 23:21