Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: phischu/cabal
...
head fork: phischu/cabal
  • 6 commits
  • 19 files changed
  • 0 commit comments
  • 1 contributor
Showing with 127 additions and 65 deletions.
  1. +53 −21 Cabal/Distribution/Simple/Configure.hs
  2. +2 −1  Cabal/Distribution/Simple/GHC/IPI641.hs
  3. +2 −1  Cabal/Distribution/Simple/GHC/IPI642.hs
  4. +12 −3 Cabal/Distribution/Simple/Setup.hs
  5. +1 −1  cabal-install/Distribution/Client/BuildReports/Anonymous.hs
  6. +2 −2 cabal-install/Distribution/Client/BuildReports/Storage.hs
  7. +4 −2 cabal-install/Distribution/Client/Configure.hs
  8. +2 −2 cabal-install/Distribution/Client/Dependency/Modular/Assignment.hs
  9. +7 −2 cabal-install/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs
  10. +4 −2 cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs
  11. +6 −6 cabal-install/Distribution/Client/Dependency/Modular/Package.hs
  12. +15 −7 cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
  13. +1 −1  cabal-install/Distribution/Client/Dependency/Modular/Solver.hs
  14. +1 −1  cabal-install/Distribution/Client/Dependency/TopDown.hs
  15. +1 −1  cabal-install/Distribution/Client/Fetch.hs
  16. +4 −3 cabal-install/Distribution/Client/Install.hs
  17. +2 −1  cabal-install/Distribution/Client/InstallPlan.hs
  18. +1 −1  cabal-install/Distribution/Client/InstallSymlink.hs
  19. +7 −7 cabal-install/Distribution/Client/Types.hs
View
74 Cabal/Distribution/Simple/Configure.hs
@@ -153,6 +153,8 @@ import Distribution.Compat.Exception
( catchExit, catchIO )
import Data.Ord
( comparing )
+import Data.Either
+ ( lefts, rights )
tryGetConfigStateFile :: (Read a) => FilePath -> IO (Either String a)
tryGetConfigStateFile filename = do
@@ -363,14 +365,35 @@ configure (pkg_descr0, pbi) cfg
checkPackageProblems verbosity pkg_descr0
(updatePackageDescription pbi pkg_descr)
- let selectDependencies =
- (\xs -> ([ x | Left x <- xs ], [ x | Right x <- xs ]))
- . map (selectDependency internalPackageSet installedPackageSet)
+ -- we first select the package instances that are specified
+ -- on the command line via --dependency
+ -- we then resolve the remaining not yet satisfied constraints
+ -- packages with higher version have primary priority
+ -- packages that were installed later have secondary priority
- (failedDeps, allPkgDeps) = selectDependencies (buildDepends pkg_descr)
+ let maybeDependencies = map
+ (PackageIndex.lookupInstalledPackageId installedPackageSet)
+ (configDependencies cfg)
+ selectedDependencies = catMaybes maybeDependencies
+ failedDependencies = [ ipid |
+ (ipid,Nothing) <- zip (configDependencies cfg) maybeDependencies ]
- internalPkgDeps = [ pkgid | InternalDependency _ pkgid <- allPkgDeps ]
- externalPkgDeps = [ pkg | ExternalDependency _ pkg <- allPkgDeps ]
+ alreadySatisfied :: Dependency -> Bool
+ alreadySatisfied (Dependency name versionRange) = or [
+ name == packageName selectedPackage &&
+ withinRange (packageVersion selectedPackage) versionRange |
+ selectedPackage <- selectedDependencies ]
+ remainingConstraints = filter (not . alreadySatisfied) (buildDepends pkg_descr)
+
+ perhapsResolvedConstraints = map (selectDependency internalPackageSet installedPackageSet) remainingConstraints
+ failedConstraints = lefts perhapsResolvedConstraints
+ resolvedPackages = rights perhapsResolvedConstraints
+
+ resolvedInternalPackages = [ pkgid | InternalDependency _ pkgid <- resolvedPackages]
+ resolvedExternalPackages = [ pkg | ExternalDependency _ pkg <- resolvedPackages]
+
+ internalPkgDeps = resolvedInternalPackages
+ externalPkgDeps = resolvedExternalPackages ++ selectedDependencies
when (not (null internalPkgDeps) && not (newPackageDepsBehaviour pkg_descr)) $
die $ "The field 'build-depends: "
@@ -379,8 +402,10 @@ configure (pkg_descr0, pbi) cfg
++ "package. To use this feature the package must specify at "
++ "least 'cabal-version: >= 1.8'."
- reportFailedDependencies failedDeps
- reportSelectedDependencies verbosity allPkgDeps
+ reportFailedDependencies
+ (map Left failedDependencies ++ map Right failedConstraints)
+ reportSelectedDependencies verbosity
+ (map Left selectedDependencies ++ map Right resolvedPackages)
packageDependsIndex <-
case PackageIndex.dependencyClosure installedPackageSet
@@ -466,7 +491,7 @@ configure (pkg_descr0, pbi) cfg
"--enable-split-objs; ignoring")
return False
- -- The allPkgDeps contains all the package deps for the whole package
+ -- The externalPkgDeps contains all the package deps for the whole package
-- but we need to select the subset for this specific component.
-- we just take the subset for the package names this component
-- needs. Note, this only works because we cannot yet depend on two
@@ -677,30 +702,37 @@ priorityByTimestamp = comparing timeStamp
--
reportSelectedDependencies :: Verbosity
- -> [ResolvedDependency] -> IO ()
+ -> [Either InstalledPackageInfo ResolvedDependency]
+ -> IO ()
reportSelectedDependencies verbosity deps =
- info verbosity $ unlines
- [ "Dependency " ++ display (simplifyDependency dep)
- ++ ": using " ++ display pkgid
- | resolved <- deps
- , let (dep, pkgid) = case resolved of
- ExternalDependency dep' pkg' -> (dep', packageId pkg')
- InternalDependency dep' pkgid' -> (dep', pkgid') ]
-
-reportFailedDependencies :: [FailedDependency] -> IO ()
+ info verbosity $ unlines $ map reportSelectedDependency deps where
+ reportSelectedDependency (Right (ExternalDependency dep pkg)) =
+ "Dependency " ++ display (simplifyDependency dep) ++
+ ": using " ++ display (packageId pkg)
+ reportSelectedDependency (Right (InternalDependency dep pkgid)) =
+ "Dependency " ++ display (simplifyDependency dep) ++
+ ": using " ++ display pkgid
+ reportSelectedDependency (Left installedPackageInfo) =
+ "Required " ++ display (installedPackageId installedPackageInfo) ++
+ ": satisfied"
+
+reportFailedDependencies :: [Either InstalledPackageId FailedDependency] -> IO ()
reportFailedDependencies [] = return ()
reportFailedDependencies failed =
die (intercalate "\n\n" (map reportFailedDependency failed))
where
- reportFailedDependency (DependencyNotExists pkgname) =
+ reportFailedDependency (Right (DependencyNotExists pkgname)) =
"there is no version of " ++ display pkgname ++ " installed.\n"
++ "Perhaps you need to download and install it from\n"
++ hackageUrl ++ display pkgname ++ "?"
- reportFailedDependency (DependencyNoVersion dep) =
+ reportFailedDependency (Right (DependencyNoVersion dep)) =
"cannot satisfy dependency " ++ display (simplifyDependency dep) ++ "\n"
+ reportFailedDependency (Left failedDependency) =
+ "cannot find InstalledPackageId " ++ display failedDependency ++ "\n"
+
getInstalledPackages :: Verbosity -> Compiler
-> PackageDBStack -> ProgramConfiguration
-> IO PackageIndex
View
3  Cabal/Distribution/Simple/GHC/IPI641.hs
@@ -125,5 +125,6 @@ toCurrent ipi@InstalledPackageInfo{} = Current.InstalledPackageInfo {
Current.frameworkDirs = frameworkDirs ipi,
Current.frameworks = frameworks ipi,
Current.haddockInterfaces = haddockInterfaces ipi,
- Current.haddockHTMLs = haddockHTMLs ipi
+ Current.haddockHTMLs = haddockHTMLs ipi,
+ Current.timeStamp = 0
}
View
3  Cabal/Distribution/Simple/GHC/IPI642.hs
@@ -160,5 +160,6 @@ toCurrent ipi@InstalledPackageInfo{} = Current.InstalledPackageInfo {
Current.frameworkDirs = frameworkDirs ipi,
Current.frameworks = frameworks ipi,
Current.haddockInterfaces = haddockInterfaces ipi,
- Current.haddockHTMLs = haddockHTMLs ipi
+ Current.haddockHTMLs = haddockHTMLs ipi,
+ Current.timeStamp = 0
}
View
15 Cabal/Distribution/Simple/Setup.hs
@@ -93,7 +93,7 @@ import Distribution.Text
( Text(..), display )
import qualified Distribution.Compat.ReadP as Parse
import qualified Text.PrettyPrint as Disp
-import Distribution.Package ( Dependency(..) )
+import Distribution.Package ( Dependency(..), InstalledPackageId )
import Distribution.PackageDescription
( FlagName(..), FlagAssignment )
import Distribution.Simple.Command hiding (boolOpt, boolOpt')
@@ -293,6 +293,8 @@ data ConfigFlags = ConfigFlags {
configStripExes :: Flag Bool, -- ^Enable executable stripping
configConstraints :: [Dependency], -- ^Additional constraints for
-- dependencies
+ configDependencies :: [InstalledPackageId], -- ^Required dependencies
+
configConfigurationsFlags :: FlagAssignment,
configTests :: Flag Bool, -- ^Enable test suite compilation
configBenchmarks :: Flag Bool, -- ^Enable benchmark compilation
@@ -320,8 +322,7 @@ defaultConfigFlags progConf = emptyConfigFlags {
configStripExes = Flag True,
configTests = Flag False,
configBenchmarks = Flag False,
- configLibCoverage = Flag False,
- configInstalledPackageIdSuffix = NoFlag
+ configLibCoverage = Flag False
}
configureCommand :: ProgramConfiguration -> CommandUI ConfigFlags
@@ -473,6 +474,12 @@ configureOptions showOrParseArgs =
(reqArg "DEPENDENCY"
(readP_to_E (const "dependency expected") ((\x -> [x]) `fmap` parse))
(map (\x -> display x)))
+ ,option "" ["dependency"]
+ "A list of installed packages to depend upon."
+ configDependencies (\v flags -> flags { configDependencies = v})
+ (reqArg "INSTALLEDPACKAGEID"
+ (readP_to_E (const "InstalledPackageId expected") ((\x -> [x]) `fmap` parse))
+ (map (\x -> display x)))
,option "" ["tests"]
"dependency checking and compilation for test suites listed in the package description file."
configTests (\v flags -> flags { configTests = v })
@@ -609,6 +616,7 @@ instance Monoid ConfigFlags where
configStripExes = mempty,
configExtraLibDirs = mempty,
configConstraints = mempty,
+ configDependencies = mempty,
configExtraIncludeDirs = mempty,
configConfigurationsFlags = mempty,
configTests = mempty,
@@ -643,6 +651,7 @@ instance Monoid ConfigFlags where
configStripExes = combine configStripExes,
configExtraLibDirs = combine configExtraLibDirs,
configConstraints = combine configConstraints,
+ configDependencies = combine configDependencies,
configExtraIncludeDirs = combine configExtraIncludeDirs,
configConfigurationsFlags = combine configConfigurationsFlags,
configTests = combine configTests,
View
2  cabal-install/Distribution/Client/BuildReports/Anonymous.hs
@@ -123,7 +123,7 @@ data Outcome = NotTried | Failed | Ok
new :: OS -> Arch -> CompilerId -- -> Version
-> ConfiguredPackage -> BR.BuildResult
-> BuildReport
-new os' arch' comp (ConfiguredPackage pkg flags _ deps) result =
+new os' arch' comp (ConfiguredPackage pkg flags _ deps _) result =
BuildReport {
package = packageId pkg,
os = os',
View
4 cabal-install/Distribution/Client/BuildReports/Storage.hs
@@ -117,11 +117,11 @@ fromPlanPackage :: Platform -> CompilerId
fromPlanPackage (Platform arch os) comp planPackage = case planPackage of
InstallPlan.Installed pkg@(ConfiguredPackage (SourcePackage {
- packageSource = RepoTarballPackage repo _ _ }) _ _ _) result
+ packageSource = RepoTarballPackage repo _ _ }) _ _ _ _) result
-> Just $ (BuildReport.new os arch comp pkg (Right result), repo)
InstallPlan.Failed pkg@(ConfiguredPackage (SourcePackage {
- packageSource = RepoTarballPackage repo _ _ }) _ _ _) result
+ packageSource = RepoTarballPackage repo _ _ }) _ _ _ _) result
-> Just $ (BuildReport.new os arch comp pkg (Left result), repo)
_ -> Nothing
View
6 cabal-install/Distribution/Client/Configure.hs
@@ -83,7 +83,7 @@ configure verbosity packageDBs repos comp conf
configureCommand (const configFlags) extraArgs
Right installPlan -> case InstallPlan.ready installPlan of
- [pkg@(ConfiguredPackage (SourcePackage _ _ (LocalUnpackedPackage _)) _ _ _)] ->
+ [pkg@(ConfiguredPackage (SourcePackage _ _ (LocalUnpackedPackage _)) _ _ _ _)] ->
configurePackage verbosity
(InstallPlan.planPlatform installPlan)
(InstallPlan.planCompiler installPlan)
@@ -194,7 +194,8 @@ configurePackage :: Verbosity
-> [String]
-> IO ()
configurePackage verbosity platform comp scriptOptions configFlags
- (ConfiguredPackage (SourcePackage _ gpkg _) flags stanzas deps) extraArgs = do
+ (ConfiguredPackage (SourcePackage _ gpkg _) flags stanzas deps installedDeps)
+ extraArgs = do
unique <- getUnique
let configureFlags' = (setInstalledPackageIdSuffix (show unique)
@@ -206,6 +207,7 @@ configurePackage verbosity platform comp scriptOptions configFlags
configureFlags = filterConfigureFlags configFlags {
configConfigurationsFlags = flags,
configConstraints = map thisPackageVersion deps,
+ configDependencies = installedDeps,
configVerbosity = toFlag verbosity,
configBenchmarks = toFlag (BenchStanzas `elem` stanzas),
configTests = toFlag (TestStanzas `elem` stanzas)
View
4 cabal-install/Distribution/Client/Dependency/Modular/Assignment.hs
@@ -145,8 +145,8 @@ finalize idx (A pa fa _) rdm =
vs -> " (" ++ intercalate ", " (L.map showVer vs) ++ ")"
where insts = L.map (\ (I v _) -> v) $ L.filter isInstalled $
M.keys (M.findWithDefault M.empty pn idx)
- isInstalled (I _ (Inst _ )) = True
- isInstalled _ = False
+ isInstalled (I _ (Inst _ _)) = True
+ isInstalled _ = False
-- print flag assignment
pflags = unwords . L.map (uncurry showFBool)
in
View
9 cabal-install/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs
@@ -31,10 +31,15 @@ convCP iidx sidx (CP qpi fa es ds) =
fa
es
(map convPI' ds)
+ (catMaybes (map convPI'' ds))
convPI :: PI QPN -> Either InstalledPackageId PackageId
-convPI (PI _ (I _ (Inst pi))) = Left pi
-convPI qpi = Right $ convPI' qpi
+convPI (PI _ (I _ (Inst pi _))) = Left pi
+convPI qpi = Right $ convPI' qpi
convPI' :: PI QPN -> PackageId
convPI' (PI (Q _ pn) (I v _)) = PackageIdentifier pn v
+
+convPI'' :: PI QPN -> Maybe InstalledPackageId
+convPI'' (PI _ (I _ (Inst ipid _))) = Just ipid
+convPI'' _ = Nothing
View
6 cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs
@@ -59,8 +59,9 @@ convIPI sip = mkIndex . convIPI' sip
convIP :: SI.PackageIndex -> InstalledPackageInfo -> (PN, I, PInfo)
convIP idx ipi =
let ipid = installedPackageId ipi
- i = I (pkgVersion (sourcePackageId ipi)) (Inst ipid)
+ i = I (pkgVersion (sourcePackageId ipi)) (Inst ipid ts)
pn = pkgName (sourcePackageId ipi)
+ ts = timeStamp ipi
in case mapM (convIPId pn idx) (IPI.depends ipi) of
Nothing -> (pn, i, PInfo [] M.empty [] (Just Broken))
Just fds -> (pn, i, PInfo fds M.empty [] Nothing)
@@ -76,8 +77,9 @@ convIPId :: PN -> SI.PackageIndex -> InstalledPackageId -> Maybe (FlaggedDep PN)
convIPId pn' idx ipid =
case SI.lookupInstalledPackageId idx ipid of
Nothing -> Nothing
- Just ipi -> let i = I (pkgVersion (sourcePackageId ipi)) (Inst ipid)
+ Just ipi -> let i = I (pkgVersion (sourcePackageId ipi)) (Inst ipid ts)
pn = pkgName (sourcePackageId ipi)
+ ts = timeStamp ipi
in Just (D.Simple (Dep pn (Fixed i (Goal (P pn') []))))
-- | Convert a cabal-install source package index to the simpler,
View
12 cabal-install/Distribution/Client/Dependency/Modular/Package.hs
@@ -31,7 +31,7 @@ type PId = InstalledPackageId
-- package instance via its 'PId'.
--
-- TODO: More information is needed about the repo.
-data Loc = Inst PId | InRepo
+data Loc = Inst PId Integer | InRepo
deriving (Eq, Ord, Show)
-- | Instance. A version number and a location.
@@ -41,7 +41,7 @@ data I = I Ver Loc
-- | String representation of an instance.
showI :: I -> String
showI (I v InRepo) = showVer v
-showI (I v (Inst (InstalledPackageId i))) = showVer v ++ "/installed" ++ shortId i
+showI (I v (Inst (InstalledPackageId i) _)) = showVer v ++ "/installed" ++ shortId i
where
-- A hack to extract the beginning of the package ABI hash
shortId = snip (splitAt 4) (++ "...") .
@@ -59,12 +59,12 @@ showPI (PI qpn i) = showQPN qpn ++ "-" ++ showI i
-- | Checks if a package instance corresponds to an installed package.
instPI :: PI qpn -> Bool
-instPI (PI _ (I _ (Inst _))) = True
-instPI _ = False
+instPI (PI _ (I _ (Inst _ _))) = True
+instPI _ = False
instI :: I -> Bool
-instI (I _ (Inst _)) = True
-instI _ = False
+instI (I _ (Inst _ _)) = True
+instI _ = False
instance Functor PI where
fmap f (PI x y) = PI (f x) y
View
22 cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
@@ -55,15 +55,23 @@ preferPackagePreferences pcs = packageOrderFor (const True) preference
-- | Ordering that treats installed instances as greater than uninstalled ones.
preferInstalledOrdering :: I -> I -> Ordering
-preferInstalledOrdering (I _ (Inst _)) (I _ (Inst _)) = EQ
-preferInstalledOrdering (I _ (Inst _)) _ = GT
-preferInstalledOrdering _ (I _ (Inst _)) = LT
-preferInstalledOrdering _ _ = EQ
+preferInstalledOrdering (I _ (Inst _ _)) (I _ (Inst _ _)) = EQ
+preferInstalledOrdering (I _ (Inst _ _)) _ = GT
+preferInstalledOrdering _ (I _ (Inst _ _)) = LT
+preferInstalledOrdering _ _ = EQ
-- | Compare instances by their version numbers.
preferLatestOrdering :: I -> I -> Ordering
preferLatestOrdering (I v1 _) (I v2 _) = compare v1 v2
+-- | Reorder the Tree preferring packages with a later timestamp.
+-- Accidentally also prefer installed packages. Should be run
+-- first.
+preferLatestTimestamps :: Tree a -> Tree a
+preferLatestTimestamps = packageOrderFor (const True) (const (comparing timestamp)) where
+ timestamp (I _ (Inst _ ts)) = ts
+ timestamp _ = 0
+
-- | Helper function that tries to enforce a single package constraint on a
-- given instance for a P-node. Translates the constraint into a
-- tree-transformer that either leaves the subtree untouched, or replaces it
@@ -169,8 +177,8 @@ requireInstalled p = trav go
| p pn = PChoiceF v i (P.mapWithKey installed cs)
| otherwise = PChoiceF v i cs
where
- installed (I _ (Inst _)) x = x
- installed _ _ = Fail (toConflictSet (Goal (P v) gr)) CannotInstall
+ installed (I _ (Inst _ _)) x = x
+ installed _ _ = Fail (toConflictSet (Goal (P v) gr)) CannotInstall
go x = x
-- | Avoid reinstalls.
@@ -194,7 +202,7 @@ avoidReinstalls p = trav go
| otherwise = PChoiceF qpn i cs
where
disableReinstalls =
- let installed = [ v | (I v (Inst _), _) <- toList cs ]
+ let installed = [ v | (I v (Inst _ _), _) <- toList cs ]
in P.mapWithKey (notReinstall installed) cs
notReinstall vs (I v InRepo) _
View
2  cabal-install/Distribution/Client/Dependency/Modular/Solver.hs
@@ -43,7 +43,7 @@ solve sc idx userPrefs userConstraints userGoals =
if preferEasyGoalChoices sc
then P.preferBaseGoalChoice . P.deferDefaultFlagChoices . P.lpreferEasyGoalChoices
else P.preferBaseGoalChoice
- preferencesPhase = P.preferPackagePreferences userPrefs
+ preferencesPhase = P.preferPackagePreferences userPrefs . P.preferLatestTimestamps
validationPhase = P.enforceManualFlags . -- can only be done after user constraints
P.enforcePackageConstraints userConstraints .
validateTree idx
View
2  cabal-install/Distribution/Client/Dependency/TopDown.hs
@@ -555,7 +555,7 @@ finaliseSelectedPackages pref selected constraints =
finaliseInstalled (InstalledPackageEx pkg _ _) = InstallPlan.PreExisting pkg
finaliseSource mipkg (SemiConfiguredPackage pkg flags stanzas deps) =
- InstallPlan.Configured (ConfiguredPackage pkg flags stanzas deps')
+ InstallPlan.Configured (ConfiguredPackage pkg flags stanzas deps' [])
where
deps' = map (packageId . pickRemaining mipkg) deps
View
2  cabal-install/Distribution/Client/Fetch.hs
@@ -132,7 +132,7 @@ planPackages verbosity comp fetchFlags
-- that are in the 'InstallPlan.Configured' state.
return
[ pkg
- | (InstallPlan.Configured (InstallPlan.ConfiguredPackage pkg _ _ _))
+ | (InstallPlan.Configured (InstallPlan.ConfiguredPackage pkg _ _ _ _))
<- InstallPlan.toList installPlan ]
| otherwise =
View
7 cabal-install/Distribution/Client/Install.hs
@@ -502,14 +502,14 @@ printPlan dryRun verbosity plan = case plan of
toFlagAssignment = map (\ f -> (flagName f, flagDefault f))
nonDefaultFlags :: ConfiguredPackage -> FlagAssignment
- nonDefaultFlags (ConfiguredPackage spkg fa _ _) =
+ nonDefaultFlags (ConfiguredPackage spkg fa _ _ _) =
let defaultAssignment =
toFlagAssignment
(genPackageFlags (Source.packageDescription spkg))
in fa \\ defaultAssignment
stanzas :: ConfiguredPackage -> [OptionalStanza]
- stanzas (ConfiguredPackage _ _ sts _) = sts
+ stanzas (ConfiguredPackage _ _ sts _ _) = sts
showStanzas :: [OptionalStanza] -> String
showStanzas = concatMap ((' ' :) . showStanza)
@@ -875,10 +875,11 @@ installConfiguredPackage :: Platform -> CompilerId
-> PackageDescription -> a)
-> a
installConfiguredPackage platform comp configFlags
- (ConfiguredPackage (SourcePackage _ gpkg source) flags stanzas deps)
+ (ConfiguredPackage (SourcePackage _ gpkg source) flags stanzas deps installedDeps)
installPkg = installPkg configFlags {
configConfigurationsFlags = flags,
configConstraints = map thisPackageVersion deps,
+ configDependencies = installedDeps,
configBenchmarks = toFlag False,
configTests = toFlag (TestStanzas `elem` stanzas)
} source pkg
View
3  cabal-install/Distribution/Client/InstallPlan.hs
@@ -494,10 +494,11 @@ showPackageProblem (InvalidDep dep pkgid) =
++ " but the configuration specifies " ++ display pkgid
++ " which does not satisfy the dependency."
+-- TODO: do some checks for consistency with the installed dependencies
configuredPackageProblems :: Platform -> CompilerId
-> ConfiguredPackage -> [PackageProblem]
configuredPackageProblems platform comp
- (ConfiguredPackage pkg specifiedFlags stanzas specifiedDeps) =
+ (ConfiguredPackage pkg specifiedFlags stanzas specifiedDeps _) =
[ DuplicateFlag flag | ((flag,_):_) <- duplicates specifiedFlags ]
++ [ MissingFlag flag | OnlyInLeft flag <- mergedFlags ]
++ [ ExtraFlag flag | OnlyInRight flag <- mergedFlags ]
View
2  cabal-install/Distribution/Client/InstallSymlink.hs
@@ -133,7 +133,7 @@ symlinkBinaries configFlags installFlags plan =
, PackageDescription.buildable (PackageDescription.buildInfo exe) ]
pkgDescription :: ConfiguredPackage -> PackageDescription
- pkgDescription (ConfiguredPackage (SourcePackage _ pkg _) flags stanzas _) =
+ pkgDescription (ConfiguredPackage (SourcePackage _ pkg _) flags stanzas _ _) =
case finalizePackageDescription flags
(const True)
platform compilerId [] (enableStanzas stanzas pkg) of
View
14 cabal-install/Distribution/Client/Types.hs
@@ -14,7 +14,8 @@
module Distribution.Client.Types where
import Distribution.Package
- ( PackageName, PackageId, Package(..), PackageFixedDeps(..) )
+ ( PackageName, PackageId, Package(..), PackageFixedDeps(..),
+ InstalledPackageId )
import Distribution.InstalledPackageInfo
( InstalledPackageInfo )
import Distribution.PackageDescription
@@ -78,17 +79,16 @@ data ConfiguredPackage = ConfiguredPackage
SourcePackage -- package info, including repo
FlagAssignment -- complete flag assignment for the package
[OptionalStanza] -- list of enabled optional stanzas for the package
- [PackageId] -- set of exact dependencies. These must be
- -- consistent with the 'buildDepends' in the
- -- 'PackageDescription' that you'd get by applying
- -- the flag assignment and optional stanzas.
+ [PackageId] -- set of all package versions this package depends on
+ [InstalledPackageId]-- subset of those packages already installed
+
deriving Show
instance Package ConfiguredPackage where
- packageId (ConfiguredPackage pkg _ _ _) = packageId pkg
+ packageId (ConfiguredPackage pkg _ _ _ _) = packageId pkg
instance PackageFixedDeps ConfiguredPackage where
- depends (ConfiguredPackage _ _ _ deps) = deps
+ depends (ConfiguredPackage _ _ _ deps _) = deps
-- | A package description along with the location of the package sources.

No commit comments for this range

Something went wrong with that request. Please try again.