[commit: ghc] master: Make bkpcabal01 test compatible with new ordering requirements. (6e3e537)

git at git.haskell.org git at git.haskell.org
Sun Mar 10 14:31:45 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6e3e537e419ba8d02dac306d596fba3c1029f123/ghc

>---------------------------------------------------------------

commit 6e3e537e419ba8d02dac306d596fba3c1029f123
Author: Edward Z. Yang <ezyang at fb.com>
Date:   Thu Mar 7 23:47:07 2019 -0500

    Make bkpcabal01 test compatible with new ordering requirements.
    
    Previously, our test did something like this:
    
    1. Typecheck p
    2. Typecheck q (which made use of an instantiated p)
    3. Build instantiated p
    4. Build instantiated q
    
    Cabal previously permitted this, under the reasoning that during
    typechecking there's no harm in using the instantiated p even if we
    haven't build it yet; we'll just instantiate it on the fly with p.
    
    However, this is not true!  If q makes use of a Template Haskell
    splice from p, we absolutely must have built the instantiated p
    before we typecheck q, since this typechecking will need to
    run some splices.  Cabal now complains that you haven't done
    it correctly, which we indeed have not!
    
    Reordering so that we do this:
    
    1. Typecheck p
    3. Build instantiated p
    2. Typecheck q (which made use of an instantiated p)
    4. Build instantiated q
    
    Fixes the problem.  If Cabal had managed the ordering itself, it would
    have gotten it right.
    
    Signed-off-by: Edward Z. Yang <ezyang at fb.com>


>---------------------------------------------------------------

6e3e537e419ba8d02dac306d596fba3c1029f123
 testsuite/tests/backpack/cabal/bkpcabal01/Makefile | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/Makefile b/testsuite/tests/backpack/cabal/bkpcabal01/Makefile
index 01744da..4aaa814 100644
--- a/testsuite/tests/backpack/cabal/bkpcabal01/Makefile
+++ b/testsuite/tests/backpack/cabal/bkpcabal01/Makefile
@@ -21,13 +21,13 @@ bkpcabal01: clean
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register
-	# typecheck q
-	$(CONFIGURE) --cid "q-0.1" q
+	# build p
+	$(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register
-	# build p
-	$(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
+	# typecheck q
+	$(CONFIGURE) --cid "q-0.1" q
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register
@@ -44,13 +44,13 @@ bkpcabal01: clean
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register
-	# re-typecheck q (if buggy, this is what would fail)
-	$(CONFIGURE) --cid "q-0.1" q
+	# re-build p
+	$(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register
-	# re-build p
-	$(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
+	# re-typecheck q (if buggy, this is what would fail)
+	$(CONFIGURE) --cid "q-0.1" q
 	$(SETUP) build
 	$(SETUP) copy
 	$(SETUP) register



More information about the ghc-commits mailing list