Fix #16219: TemplateHaskell causes indefinite package build error
AcceptedPublic

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

Details

Reviewers
simonpj
bgamari
Trac Issues
#16219
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

ezyang created this revision.Mon, Jan 28, 10:21 PM
simonpj added inline comments.Wed, Jan 30, 7:34 AM
compiler/main/GhcMake.hs
2046

Point to the Trac ticket!

testsuite/tests/backpack/cabal/T16219/LICENSE
1

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
1

I believe it may be necessary otherwise Cabal will complain.

bgamari accepted this revision.Thu, Jan 31, 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.Thu, Jan 31, 7:00 PM