Skip to content

GHC should not load packages for TH if they are not used

https://github.com/nh2/ghc-bug-th-loading

When you call

ghc --make -package mypackage

on a module that uses TH, you will see

Loading package mypackage-1.2.3.4 ... linking ... done.

even if no code uses it. This slows down builds, especially cabal ones.

GHCI does this better and only loads what is needed.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mail@nh2.me
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information