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

Revert to Cabal assuming signatures have object files.



GHC has been changed to guarantee producing valid object files for
signatures (they will usually be empty).
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent ba7697e4
......@@ -45,7 +45,6 @@ module Distribution.PackageDescription (
withLib,
hasLibs,
libModules,
objectModules,
-- ** Executables
Executable(..),
......@@ -418,12 +417,6 @@ libModules lib = exposedModules lib
++ exposedSignatures lib
++ requiredSignatures lib
-- | Get all the module names from the library which have OBJECT code.
-- This excludes signatures, which have interface files but no object code.
objectModules :: Library -> [ModuleName]
objectModules lib = exposedModules lib
++ otherModules (libBuildInfo lib)
-- -----------------------------------------------------------------------------
-- Module re-exports
......
......@@ -51,7 +51,7 @@ import qualified Distribution.Simple.GHC.IPI641 as IPI641
import qualified Distribution.Simple.GHC.IPI642 as IPI642
import Distribution.PackageDescription as PD
( PackageDescription(..), BuildInfo(..), Executable(..)
, Library(..), libModules, objectModules, exeModules, hcOptions
, Library(..), libModules, exeModules, hcOptions
, usedExtensions, allExtensions, ModuleRenaming, lookupRenaming )
import Distribution.InstalledPackageInfo
( InstalledPackageInfo )
......@@ -1136,7 +1136,7 @@ getHaskellObjects lib lbi pref wanted_obj_ext allow_split_objs
then "_split"
else "_" ++ wanted_obj_ext ++ "_split"
dirs = [ pref </> (ModuleName.toFilePath x ++ splitSuffix)
| x <- objectModules lib ]
| x <- libModules lib ]
objss <- mapM getDirectoryContents dirs
let objs = [ dir </> obj
| (objs',dir) <- zip objss dirs, obj <- objs',
......@@ -1145,7 +1145,7 @@ getHaskellObjects lib lbi pref wanted_obj_ext allow_split_objs
return objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- objectModules lib ]
| x <- libModules lib ]
-- | Extracts a String representing a hash of the ABI of a built
-- library. It can fail if the library has not yet been built.
......
......@@ -60,7 +60,7 @@ import Distribution.Simple.Setup
( RegisterFlags(..), CopyDest(..)
, fromFlag, fromFlagOrDefault, flagToMaybe )
import Distribution.PackageDescription
( PackageDescription(..), Library(..), BuildInfo(..) )
( PackageDescription(..), Library(..), BuildInfo(..), libModules )
import Distribution.Package
( Package(..), packageName, InstalledPackageId(..) )
import Distribution.InstalledPackageInfo
......@@ -305,8 +305,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg ipid lib lbi clbi installDirs =
where
bi = libBuildInfo lib
(absinc, relinc) = partition isAbsolute (includeDirs bi)
hasModules = not $ null (exposedModules lib)
&& null (otherModules bi)
hasModules = not $ null (libModules lib)
hasLibrary = hasModules || not (null (cSources bi))
-- Since we currently don't decide the InstalledPackageId of our package
-- until just before we register, we didn't have one for the re-exports
......
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