-
Notifications
You must be signed in to change notification settings - Fork 849
Description
-split-sections is a ghc flag new in 8.2.1:
https://downloads.haskell.org/~ghc/8.2.1/docs/html/users_guide/phases.html?highlight=split-sections#ghc-flag--split-sections
Unfortunately it is a bit of a pain to use this with stack because it requires one to compile all of one's dependencies with -split-sections.
I have created a stack.yaml and build script for stack itself here:
https://github.com/duog/stack/tree/split-sections
which builds stack from an empty stack root both with and without -split-sections. If one examines the build.out file in that repository one observes that there is very little difference in build time, but the resulting executable is about half the size with -split-sections. It's not demonstrated here, but the .a library files are much bigger.
As I'm sure you're aware, it is a bit difficult to ensure all the libraries in one's snapshot have certain ghc-options, is there anything that can be done to make this easier?