commercialhaskell / commercialhaskell/stack

Feature request: consider how to better support -split-sections

Open
#3,467 18 comments 1 reaction 0 assignees View on GitHub
type: discuss type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.