[Git][ghc/ghc][wip/sjakobi/T2057] 2 commits: Shorten README
Simon Jakobi pushed to branch wip/sjakobi/T2057 at Glasgow Haskell Compiler / GHC Commits: a2a79272 by Simon Jakobi at 2026-03-09T01:48:39+01:00 Shorten README - - - - - 359dd071 by Simon Jakobi at 2026-03-09T01:51:06+01:00 Wibbles - - - - - 2 changed files: - testsuite/tests/driver/T2057/Makefile - testsuite/tests/driver/T2057/README.md Changes: ===================================== testsuite/tests/driver/T2057/Makefile ===================================== @@ -19,29 +19,41 @@ clean: # Dependency graph: # pkgB is built against pkgA1, where A exports f1. # We then rebuild the same installed unit id (pkgA-1) from the pkgA2 sources, -# where A instead exports f2. -# Reading B.hi therefore finds an unfolding for g that still refers to f1, -# and compiling Main against pkgB should stop at the interface error. +# where A instead exports f2. Reading B.hi therefore finds an unfolding for g +# that still refers to f1, and compiling Main against pkgB should stop at the +# interface error. T2057: clean + # Create an isolated package DB and output directories for the repro. mkdir -p '$(PKGA1)' '$(PKGA2)' '$(PKGB)' '$(APP)' '$(GHC_PKG)' init '$(PKGDB)' + # Build and register pkgA1, the original version of A. - '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -this-unit-id pkgA-1 -O -c pkgA1/A.hs -outputdir '$(PKGA1)' + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \ + -this-unit-id pkgA-1 -O -c pkgA1/A.hs -outputdir '$(PKGA1)' ar q '$(PKGA1)/libHSpkgA-1.a' '$(PKGA1)/A.o' >/dev/null 2>&1 sed "s|@BASE_ID@|$(BASE_ID)|g" pkgA1.conf.in >'$(WORK)/pkgA1.conf' '$(GHC_PKG)' --package-db '$(PKGDB)' register '$(WORK)/pkgA1.conf' >/dev/null + # Build and register pkgB against pkgA1 so B.hi records the unfolding of g = f1. - '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -package pkgA1 -this-unit-id pkgB-1 -O -c pkgB/B.hs -outputdir '$(PKGB)' + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \ + -package pkgA1 -this-unit-id pkgB-1 -O -c pkgB/B.hs \ + -outputdir '$(PKGB)' ar q '$(PKGB)/libHSpkgB-1.a' '$(PKGB)/B.o' >/dev/null 2>&1 sed "s|@BASE_ID@|$(BASE_ID)|g" pkgB.conf.in >'$(WORK)/pkgB.conf' '$(GHC_PKG)' --package-db '$(PKGDB)' register '$(WORK)/pkgB.conf' >/dev/null + # Rebuild the same installed unit id from pkgA2, replacing f1 with f2. - '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' -this-unit-id pkgA-1 -O -c pkgA2/A.hs -outputdir '$(PKGA2)' + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -package-db '$(PKGDB)' \ + -this-unit-id pkgA-1 -O -c pkgA2/A.hs -outputdir '$(PKGA2)' ar q '$(PKGA2)/libHSpkgA-1.a' '$(PKGA2)/A.o' >/dev/null 2>&1 sed "s|@BASE_ID@|$(BASE_ID)|g" pkgA2.conf.in >'$(WORK)/pkgA2.conf' '$(GHC_PKG)' --package-db '$(PKGDB)' update '$(WORK)/pkgA2.conf' >/dev/null + # Compiling Main against pkgB should now fail while loading the stale B.hi. - ! '$(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; } + ! '$(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; } + # Strip the absolute test directory prefix before comparing against T2057.stderr. sed "s#$(CURDIR)/##g" '$(OUT)' >&2 ===================================== testsuite/tests/driver/T2057/README.md ===================================== @@ -6,8 +6,3 @@ against one version of package `A`, then the same unit id is replaced by an incompatible build of `A`. When `Main` imports `B`, GHC has to read `B.hi`, finds an unfolding that still mentions the old `A`, and should fail while loading interfaces. - -The golden [`T2057.stderr`](T2057.stderr) captures the expected behaviour on a -fixed compiler: report the missing declaration from the stale interface and -then abort with `Cannot continue after interface file error`. Any linker output -would be a regression. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/89ed54d65e87dda1c86b01659881156... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/89ed54d65e87dda1c86b01659881156... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Jakobi (@sjakobi2)