Fix #16219: TemplateHaskell causes indefinite package build error

Authored by ezyang on Jan 31 2019, 7:00 PM.

Description

Fix Trac #16219: TemplateHaskell causes indefinite package build error

It should work to write an indefinite package using TemplateHaskell,
so long as all of the actual TH code lives outside of the package.
However, cleverness we had to build TH code even when building
with -fno-code meant that we attempted to build object code for
modules in an indefinite package, even when the signatures were
not instantiated. This patch disables said logic in the event
that an indefinite package is being typechecked.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Test Plan: validate

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: Trac #16219

Differential Revision: https://phabricator.haskell.org/D5475

(cherry picked from commit d6d735c1114082b9e9cc1ba7da87c49f52891320)

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Apr 1 2019, 1:56 AM
Reviewer
bgamari
Differential Revision
D5475: Fix #16219: TemplateHaskell causes indefinite package build error
Parents
rGHC6c27fd3517e1: Only build vanilla way in devel2 flavour
Branches
Unknown
Tags
Unknown
References
cherry-pick-d6d735c1