| ... |
... |
@@ -19,29 +19,41 @@ clean: |
|
19
|
19
|
# Dependency graph:
|
|
20
|
20
|
# pkgB is built against pkgA1, where A exports f1.
|
|
21
|
21
|
# We then rebuild the same installed unit id (pkgA-1) from the pkgA2 sources,
|
|
22
|
|
-# where A instead exports f2.
|
|
23
|
|
-# Reading B.hi therefore finds an unfolding for g that still refers to f1,
|
|
24
|
|
-# and compiling Main against pkgB should stop at the interface error.
|
|
|
22
|
+# where A instead exports f2. Reading B.hi therefore finds an unfolding for g
|
|
|
23
|
+# that still refers to f1, and compiling Main against pkgB should stop at the
|
|
|
24
|
+# interface error.
|
|
25
|
25
|
T2057: clean
|
|
|
26
|
+
|
|
26
|
27
|
# Create an isolated package DB and output directories for the repro.
|
|
27
|
28
|
mkdir -p '$(PKGA1)' '$(PKGA2)' '$(PKGB)' '$(APP)'
|
|
28
|
29
|
'$(GHC_PKG)' init '$(PKGDB)'
|
|
|
30
|
+
|
|
29
|
31
|
# Build and register pkgA1, the original version of A.
|
|
30
|
|
- '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -this-unit-id pkgA-1 -O -c pkgA1/A.hs -outputdir '$(PKGA1)'
|
|
|
32
|
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \
|
|
|
33
|
+ -this-unit-id pkgA-1 -O -c pkgA1/A.hs -outputdir '$(PKGA1)'
|
|
31
|
34
|
ar q '$(PKGA1)/libHSpkgA-1.a' '$(PKGA1)/A.o' >/dev/null 2>&1
|
|
32
|
35
|
sed "s|@BASE_ID@|$(BASE_ID)|g" pkgA1.conf.in >'$(WORK)/pkgA1.conf'
|
|
33
|
36
|
'$(GHC_PKG)' --package-db '$(PKGDB)' register '$(WORK)/pkgA1.conf' >/dev/null
|
|
|
37
|
+
|
|
34
|
38
|
# Build and register pkgB against pkgA1 so B.hi records the unfolding of g = f1.
|
|
35
|
|
- '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -package pkgA1 -this-unit-id pkgB-1 -O -c pkgB/B.hs -outputdir '$(PKGB)'
|
|
|
39
|
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \
|
|
|
40
|
+ -package pkgA1 -this-unit-id pkgB-1 -O -c pkgB/B.hs \
|
|
|
41
|
+ -outputdir '$(PKGB)'
|
|
36
|
42
|
ar q '$(PKGB)/libHSpkgB-1.a' '$(PKGB)/B.o' >/dev/null 2>&1
|
|
37
|
43
|
sed "s|@BASE_ID@|$(BASE_ID)|g" pkgB.conf.in >'$(WORK)/pkgB.conf'
|
|
38
|
44
|
'$(GHC_PKG)' --package-db '$(PKGDB)' register '$(WORK)/pkgB.conf' >/dev/null
|
|
|
45
|
+
|
|
39
|
46
|
# Rebuild the same installed unit id from pkgA2, replacing f1 with f2.
|
|
40
|
|
- '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -this-unit-id pkgA-1 -O -c pkgA2/A.hs -outputdir '$(PKGA2)'
|
|
|
47
|
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \
|
|
|
48
|
+ -this-unit-id pkgA-1 -O -c pkgA2/A.hs -outputdir '$(PKGA2)'
|
|
41
|
49
|
ar q '$(PKGA2)/libHSpkgA-1.a' '$(PKGA2)/A.o' >/dev/null 2>&1
|
|
42
|
50
|
sed "s|@BASE_ID@|$(BASE_ID)|g" pkgA2.conf.in >'$(WORK)/pkgA2.conf'
|
|
43
|
51
|
'$(GHC_PKG)' --package-db '$(PKGDB)' update '$(WORK)/pkgA2.conf' >/dev/null
|
|
|
52
|
+
|
|
44
|
53
|
# Compiling Main against pkgB should now fail while loading the stale B.hi.
|
|
45
|
|
- ! '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make app/Main.hs -O -fforce-recomp -package-db '$(PKGDB)' -package pkgB >'$(OUT)' 2>&1 || { echo "expected compilation failure" >&2; exit 1; }
|
|
|
54
|
+ ! '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make app/Main.hs \
|
|
|
55
|
+ -O -fforce-recomp -package-db '$(PKGDB)' -package pkgB \
|
|
|
56
|
+ >'$(OUT)' 2>&1 || { echo "expected compilation failure" >&2; exit 1; }
|
|
|
57
|
+
|
|
46
|
58
|
# Strip the absolute test directory prefix before comparing against T2057.stderr.
|
|
47
|
59
|
sed "s#$(CURDIR)/##g" '$(OUT)' >&2 |