diff options
author | Edward Z. Yang <ezyang@fb.com> | 2017-11-25 10:12:05 +0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@fb.com> | 2017-11-30 19:25:29 -0500 |
commit | e1fb28384c44fcd29b0e60b9fd44767be22646af (patch) | |
tree | 7c25a031d26a6e3a53294f16d135e91d589c37e0 /compiler/main/Packages.hs | |
parent | 6998772043a7f0b0360116eb5ffcbaa5630b21fb (diff) | |
download | haskell-e1fb28384c44fcd29b0e60b9fd44767be22646af.tar.gz |
Handle CPP properly in Backpack
Summary:
Previously, we attempted to lookup 'hole' packages for
include directories; this obviously is not going to work.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate
Reviewers: ekmett, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #14525
Differential Revision: https://phabricator.haskell.org/D4234
Diffstat (limited to 'compiler/main/Packages.hs')
-rw-r--r-- | compiler/main/Packages.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index c49581b0d9..14407be418 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -1892,8 +1892,14 @@ listVisibleModuleNames dflags = getPreloadPackagesAnd :: DynFlags -> [PreloadUnitId] -> IO [PackageConfig] getPreloadPackagesAnd dflags pkgids0 = let - pkgids = pkgids0 ++ map (toInstalledUnitId . moduleUnitId . snd) - (thisUnitIdInsts dflags) + pkgids = pkgids0 ++ + -- An indefinite package will have insts to HOLE, + -- which is not a real package. Don't look it up. + -- Fixes #14525 + if isIndefinite dflags + then [] + else map (toInstalledUnitId . moduleUnitId . snd) + (thisUnitIdInsts dflags) state = pkgState dflags pkg_map = pkgIdMap state preload = preloadPackages state |