Commit 5b378e48 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Update GhcOptions to use IndefUnitId for -package-id

We will use this when building indefinite libraries.
parent fdf30f80
......@@ -37,6 +37,7 @@ import Distribution.Compat.Prelude
import Distribution.Simple.GHC.ImplInfo
import Distribution.Package
import Distribution.Backpack
import Distribution.InstalledPackageInfo
import qualified Distribution.InstalledPackageInfo as InstalledPackageInfo
import Distribution.PackageDescription as PD hiding (Flag)
......@@ -374,8 +375,9 @@ getHaskellObjects _implInfo lib lbi clbi pref wanted_obj_ext allow_split_objs
| x <- allLibModules lib clbi ]
mkGhcOptPackages :: ComponentLocalBuildInfo
-> [(UnitId, ModuleRenaming)]
mkGhcOptPackages = componentIncludes
-> [(IndefUnitId, ModuleRenaming)]
mkGhcOptPackages = map (\(uid, mr) -> (IndefUnitId uid, mr))
. componentIncludes
substTopDir :: FilePath -> InstalledPackageInfo -> InstalledPackageInfo
substTopDir topDir ipo
......
......@@ -19,8 +19,8 @@ module Distribution.Simple.Program.GHC (
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Backpack
import Distribution.Simple.GHC.ImplInfo
import Distribution.Package
import Distribution.PackageDescription hiding (Flag)
import Distribution.ModuleName
import Distribution.Simple.Compiler hiding (Flag)
......@@ -89,7 +89,7 @@ data GhcOptions = GhcOptions {
-- | The GHC packages to bring into scope when compiling,
-- the @ghc -package-id@ flags.
ghcOptPackages ::
NubListR (UnitId, ModuleRenaming),
NubListR (IndefUnitId, ModuleRenaming),
-- | Start with a clean package set; the @ghc -hide-all-packages@ flag
ghcOptHideAllPackages :: Flag Bool,
......
......@@ -30,6 +30,7 @@ import Distribution.Version
( Version, mkVersion, versionNumbers, VersionRange, anyVersion
, intersectVersionRanges, orLaterVersion
, withinRange )
import qualified Distribution.Backpack as Backpack
import Distribution.Package
( newSimpleUnitId, ComponentId, PackageId, mkPackageName
, PackageIdentifier(..), packageVersion, packageName, Dependency(..) )
......@@ -817,7 +818,8 @@ getExternalSetupMethod verbosity options pkg bt = do
if any (isCabalPkgId . snd) (useDependencies options')
then []
else cabalDep
addRenaming (ipid, _) = (newSimpleUnitId ipid, defaultRenaming)
addRenaming (ipid, _) =
(Backpack.IndefUnitId (newSimpleUnitId ipid), defaultRenaming)
cppMacrosFile = setupDir </> "setup_macros.h"
ghcOptions = mempty {
-- Respect -v0, but don't crank up verbosity on GHC if
......
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