diff options
| -rw-r--r-- | compiler/main/Packages.hs | 4 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/Makefile | 36 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/Setup.hs | 2 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/T14304.stderr | 6 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/all.T | 9 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/indef/Indef.hs | 3 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig | 2 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/indef/indef.cabal | 9 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/p/P.hs | 3 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/p/p.cabal | 8 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/th/TH.hs | 3 | ||||
| -rw-r--r-- | testsuite/tests/backpack/cabal/T14304/th/th.cabal | 9 |
12 files changed, 93 insertions, 1 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 172e1818fc..949cc0f231 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -1878,8 +1878,10 @@ listVisibleModuleNames dflags = -- | Find all the 'PackageConfig' in both the preload packages from 'DynFlags' and corresponding to the list of -- 'PackageConfig's getPreloadPackagesAnd :: DynFlags -> [PreloadUnitId] -> IO [PackageConfig] -getPreloadPackagesAnd dflags pkgids = +getPreloadPackagesAnd dflags pkgids0 = let + pkgids = pkgids0 ++ map (toInstalledUnitId . moduleUnitId . snd) + (thisUnitIdInsts dflags) state = pkgState dflags pkg_map = pkgIdMap state preload = preloadPackages state diff --git a/testsuite/tests/backpack/cabal/T14304/Makefile b/testsuite/tests/backpack/cabal/T14304/Makefile new file mode 100644 index 0000000000..1f58184198 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/Makefile @@ -0,0 +1,36 @@ +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' --enable-shared + +T14304: clean + $(MAKE) -s --no-print-directory clean + '$(GHC_PKG)' init tmp.d + '$(TEST_HC)' -v0 --make Setup + # typecheck indef + rm -rf indef/dist + (cd indef; $(CONFIGURE) --ipid "indef-0.1") + (cd indef; $(SETUP) build) + (cd indef; $(SETUP) copy) + (cd indef; $(SETUP) register) + # build p + rm -rf p/dist + (cd p; $(CONFIGURE) --ipid "p-0.1") + (cd p; $(SETUP) build) + (cd p; $(SETUP) copy) + (cd p; $(SETUP) register) + # build indef instantiated with p + rm -rf indef/dist + (cd indef; $(CONFIGURE) --ipid "indef-0.1" --instantiate-with "Sig=p-0.1:P") + (cd indef; $(SETUP) build) + (cd indef; $(SETUP) copy) + (cd indef; $(SETUP) register) + # build th (which tests if we have correct linkage) + rm -rf th/dist + (cd th; $(CONFIGURE)) + (cd th; $(SETUP) build) + +clean : + $(RM) -r tmp.d inst dist Setup$(exeext) diff --git a/testsuite/tests/backpack/cabal/T14304/Setup.hs b/testsuite/tests/backpack/cabal/T14304/Setup.hs new file mode 100644 index 0000000000..9a994af677 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/testsuite/tests/backpack/cabal/T14304/T14304.stderr b/testsuite/tests/backpack/cabal/T14304/T14304.stderr new file mode 100644 index 0000000000..89a07b9193 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/T14304.stderr @@ -0,0 +1,6 @@ +Warning: -rtsopts and -with-rtsopts have no effect with -shared. + Call hs_init_ghc() from your main() function to set these options. +Warning: -rtsopts and -with-rtsopts have no effect with -shared. + Call hs_init_ghc() from your main() function to set these options. +Warning: -rtsopts and -with-rtsopts have no effect with -shared. + Call hs_init_ghc() from your main() function to set these options. diff --git a/testsuite/tests/backpack/cabal/T14304/all.T b/testsuite/tests/backpack/cabal/T14304/all.T new file mode 100644 index 0000000000..f25285d0d0 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/all.T @@ -0,0 +1,9 @@ +if config.cleanup: + cleanup = 'CLEANUP=1' +else: + cleanup = 'CLEANUP=0' + +test('T14304', + extra_files(['p', 'indef', 'th', 'Setup.hs']), + run_command, + ['$MAKE -s --no-print-directory T14304 ' + cleanup]) diff --git a/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs b/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs new file mode 100644 index 0000000000..0bd438e6de --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs @@ -0,0 +1,3 @@ +module Indef where +import Sig +data T = MkT B diff --git a/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig b/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig new file mode 100644 index 0000000000..a37b1908bc --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig @@ -0,0 +1,2 @@ +signature Sig where +data B diff --git a/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal b/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal new file mode 100644 index 0000000000..d89f055959 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal @@ -0,0 +1,9 @@ +name: indef +version: 1.0 +build-type: Simple +cabal-version: >= 2.0 + +library + build-depends: base + signatures: Sig + exposed-modules: Indef diff --git a/testsuite/tests/backpack/cabal/T14304/p/P.hs b/testsuite/tests/backpack/cabal/T14304/p/P.hs new file mode 100644 index 0000000000..f570e0bb7f --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/p/P.hs @@ -0,0 +1,3 @@ +module P where +type B = Foo +newtype Foo = Foo Double diff --git a/testsuite/tests/backpack/cabal/T14304/p/p.cabal b/testsuite/tests/backpack/cabal/T14304/p/p.cabal new file mode 100644 index 0000000000..f49ce4273f --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/p/p.cabal @@ -0,0 +1,8 @@ +name: p +version: 1.0 +build-type: Simple +cabal-version: >= 2.0 + +library + build-depends: base + exposed-modules: P diff --git a/testsuite/tests/backpack/cabal/T14304/th/TH.hs b/testsuite/tests/backpack/cabal/T14304/th/TH.hs new file mode 100644 index 0000000000..5d921cf931 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/th/TH.hs @@ -0,0 +1,3 @@ +{-# LANGUAGE TemplateHaskell #-} +module TH where +$( return [] ) diff --git a/testsuite/tests/backpack/cabal/T14304/th/th.cabal b/testsuite/tests/backpack/cabal/T14304/th/th.cabal new file mode 100644 index 0000000000..2b17f09493 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T14304/th/th.cabal @@ -0,0 +1,9 @@ +name: th +version: 1.0 +build-type: Simple +cabal-version: >= 2.0 + +library + build-depends: p, indef, base + mixins: p (P as Sig) + exposed-modules: TH |
