From ca543154bbf0ec36ee2654050ee67a467420449f Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 12 Feb 2017 02:44:01 -0800 Subject: Fix a Backpack recompilation avoidance bug when signatures change. Summary: Recompilation avoidance checks if -this-unit-id has changed by relying on the "wanted module" check in readIface ("Something is amiss..."). Unfortunately, this check didn't check if the instantiation made sense, which meant that if you changed the signatures of a Backpack package, we'd still treat the old signatures as up-to-date. The way I fixed this was by having findAndReadIface take in a 'Module' representing the /actual/ module we were intending to lookup. We convert this into the 'Module' we expect to see in 'mi_module' and now do a more elaborate check that will also verify that instantiations make sense. Along the way, I robustified the logging infrastructure for recompilation checking, and folded wrongIfaceModErr (which was dead code) into the error message. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3130 --- testsuite/tests/backpack/cabal/bkpcabal04/Makefile | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 testsuite/tests/backpack/cabal/bkpcabal04/Makefile (limited to 'testsuite/tests/backpack/cabal/bkpcabal04/Makefile') diff --git a/testsuite/tests/backpack/cabal/bkpcabal04/Makefile b/testsuite/tests/backpack/cabal/bkpcabal04/Makefile new file mode 100644 index 0000000000..0e81107d9e --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal04/Makefile @@ -0,0 +1,29 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +SETUP='$(PWD)/Setup' -v0 +CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst' + +bkpcabal04: clean + $(MAKE) -s --no-print-directory clean + '$(GHC_PKG)' init tmp.d + '$(TEST_HC)' -v0 --make Setup + cp bkpcabal04.cabal.in1 bkpcabal04.cabal + cp q/B.hsig.in q/B.hsig + # typecheck + $(CONFIGURE) + $(SETUP) build + # new version + cp bkpcabal04.cabal.in2 bkpcabal04.cabal + rm q/B.hsig + cp q/A/B.hsig.in q/A/B.hsig + # typecheck + $(CONFIGURE) + $(SETUP) build +ifneq "$(CLEANUP)" "" + $(MAKE) -s --no-print-directory clean +endif + +clean : + $(RM) -rf tmp.d inst dist Setup$(exeext) q/A/B.hsig q/B.hsig bkpcabal04.cabal -- cgit v1.2.1