diff options
author | Edward Z. Yang <ezyang@fb.com> | 2019-02-01 01:00:50 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-04-01 02:56:10 -0400 |
commit | 9ba0a4bd6eacaa8aeb5513658a10a17d52c32e8f (patch) | |
tree | 455d2fb6392981f871cfc7ff226ae728d2080a12 /compiler/main/GhcMake.hs | |
parent | 6c27fd3517e17813baef2cb0130ec50798ff6543 (diff) | |
download | haskell-cherry-pick-d6d735c1.tar.gz |
Fix #16219: TemplateHaskell causes indefinite package build errorcherry-pick-d6d735c1
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: #16219
Differential Revision: https://phabricator.haskell.org/D5475
(cherry picked from commit d6d735c1114082b9e9cc1ba7da87c49f52891320)
Diffstat (limited to 'compiler/main/GhcMake.hs')
-rw-r--r-- | compiler/main/GhcMake.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index ae27d4e7fe..d5f58f8f9b 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -2045,6 +2045,9 @@ enableCodeGenForTH target nodemap = , ms_hspp_opts = dflags@DynFlags {hscTarget = HscNothing} } <- ms + -- Don't enable codegen for TH on indefinite packages; we + -- can't compile anything anyway! See #16219. + , not (isIndefinite dflags) , ms_mod `Set.member` needs_codegen_set = do let new_temp_file suf dynsuf = do |