Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get GHC Core output via stack?

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'
like image 625
dbanas Avatar asked Jan 09 '18 01:01

dbanas


People also ask

Where does stack install GHC?

You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory. If you would like Stack to use your system GHC installation, use the --system-ghc flag or run stack config set system-ghc --global true to make Stack check your PATH for a suitable GHC by default.

How does Stack-work in Haskell?

stack-work directories local to each project. The Stack root directory holds packages belonging to snapshots and any Stack-installed versions of GHC. Stack will not tamper with any system version of GHC or interfere with packages installed by other build tools (such as Cabal (the tool)).

What does stack build do?

stack build --skip <component> skips building the specified components of a local package. It allows you to skip test suites and benchmark without specifying other components (e.g. stack test --skip long-test-suite will run the tests without the long-test-suite test suite).

Where does stack install packages?

Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.


1 Answers

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/.

like image 179
Li-yao Xia Avatar answered Oct 19 '22 02:10

Li-yao Xia