Commit e1fb2838 authored by Edward Z. Yang's avatar Edward Z. Yang

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: default avatarEdward 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
parent 69987720
......@@ -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
......
{-# LANGUAGE CPP #-}
module P where
import H
y = x
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment