Fix #16219: TemplateHaskell causes indefinite package build error
ClosedPublic

Authored by ezyang on Jan 28 2019, 10:21 PM.

Details

Summary

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ezyang created this revision.Jan 28 2019, 10:21 PM
simonpj added inline comments.Jan 30 2019, 7:34 AM
compiler/main/GhcMake.hs
2046

Point to the Trac ticket!

testsuite/tests/backpack/cabal/T16219/LICENSE
2

Is this file necessary or accidental?

Do note, @ezyang, that new patches should go through GitLab. We are currently in the process of winding down Phabricator.

testsuite/tests/backpack/cabal/T16219/LICENSE
2

I believe it may be necessary otherwise Cabal will complain.

bgamari accepted this revision.Jan 31 2019, 7:00 PM

Thanks, looks good!

compiler/main/GhcMake.hs
2046

I'll take care of this when I merge.

This revision is now accepted and ready to land.Jan 31 2019, 7:00 PM
This revision was automatically updated to reflect the committed changes.