Commit 4ee0df39 authored by kristenk's avatar kristenk

Uncomment --independent-goals flag.

--independent-goals could be useful for using local packages as setup or
build-tool dependencies in new-build.  See #4295 for an example of a dependency
problem that requires --independent-goals.  The flag is off by default.
parent 365f4872
......@@ -211,7 +211,7 @@ resolveSolverSettings ProjectConfig{
solverSettingStrongFlags = fromFlag projectConfigStrongFlags
solverSettingAllowBootLibInstalls = fromFlag projectConfigAllowBootLibInstalls
solverSettingIndexState = flagToMaybe projectConfigIndexState
--solverSettingIndependentGoals = fromFlag projectConfigIndependentGoals
solverSettingIndependentGoals = fromFlag projectConfigIndependentGoals
--solverSettingShadowPkgs = fromFlag projectConfigShadowPkgs
--solverSettingReinstall = fromFlag projectConfigReinstall
--solverSettingAvoidReinstalls = fromFlag projectConfigAvoidReinstalls
......@@ -228,8 +228,8 @@ resolveSolverSettings ProjectConfig{
projectConfigReorderGoals = Flag (ReorderGoals False),
projectConfigCountConflicts = Flag (CountConflicts True),
projectConfigStrongFlags = Flag (StrongFlags False),
projectConfigAllowBootLibInstalls = Flag (AllowBootLibInstalls False)
--projectConfigIndependentGoals = Flag (IndependentGoals False),
projectConfigAllowBootLibInstalls = Flag (AllowBootLibInstalls False),
projectConfigIndependentGoals = Flag (IndependentGoals False)
--projectConfigShadowPkgs = Flag False,
--projectConfigReinstall = Flag False,
--projectConfigAvoidReinstalls = Flag False,
......
......@@ -305,7 +305,7 @@ convertLegacyAllPackageFlags globalFlags configFlags
installReorderGoals = projectConfigReorderGoals,
installCountConflicts = projectConfigCountConflicts,
installPerComponent = projectConfigPerComponent,
--installIndependentGoals = projectConfigIndependentGoals,
installIndependentGoals = projectConfigIndependentGoals,
--installShadowPkgs = projectConfigShadowPkgs,
installStrongFlags = projectConfigStrongFlags,
installAllowBootLibInstalls = projectConfigAllowBootLibInstalls
......@@ -503,7 +503,7 @@ convertToLegacySharedConfig
installUpgradeDeps = mempty, --projectConfigUpgradeDeps,
installReorderGoals = projectConfigReorderGoals,
installCountConflicts = projectConfigCountConflicts,
installIndependentGoals = mempty, --projectConfigIndependentGoals,
installIndependentGoals = projectConfigIndependentGoals,
installShadowPkgs = mempty, --projectConfigShadowPkgs,
installStrongFlags = projectConfigStrongFlags,
installAllowBootLibInstalls = projectConfigAllowBootLibInstalls,
......@@ -859,8 +859,8 @@ legacySharedConfigFieldDescrs =
, "remote-build-reporting", "report-planning-failure"
, "one-shot", "jobs", "keep-going", "offline", "per-component"
-- solver flags:
, "max-backjumps", "reorder-goals", "count-conflicts", "strong-flags"
, "allow-boot-library-installs", "index-state"
, "max-backjumps", "reorder-goals", "count-conflicts", "independent-goals"
, "strong-flags" , "allow-boot-library-installs", "index-state"
]
. commandOptionsToFields
) (installOptions ParseArgs)
......
......@@ -185,11 +185,11 @@ data ProjectConfigShared
projectConfigCountConflicts :: Flag CountConflicts,
projectConfigStrongFlags :: Flag StrongFlags,
projectConfigAllowBootLibInstalls :: Flag AllowBootLibInstalls,
projectConfigPerComponent :: Flag Bool
projectConfigPerComponent :: Flag Bool,
projectConfigIndependentGoals :: Flag IndependentGoals
-- More things that only make sense for manual mode, not --local mode
-- too much control!
--projectConfigIndependentGoals :: Flag IndependentGoals,
--projectConfigShadowPkgs :: Flag Bool,
--projectConfigReinstall :: Flag Bool,
--projectConfigAvoidReinstalls :: Flag Bool,
......@@ -360,10 +360,10 @@ data SolverSettings
solverSettingCountConflicts :: CountConflicts,
solverSettingStrongFlags :: StrongFlags,
solverSettingAllowBootLibInstalls :: AllowBootLibInstalls,
solverSettingIndexState :: Maybe IndexState
solverSettingIndexState :: Maybe IndexState,
solverSettingIndependentGoals :: IndependentGoals
-- Things that only make sense for manual mode, not --local mode
-- too much control!
--solverSettingIndependentGoals :: IndependentGoals,
--solverSettingShadowPkgs :: Bool,
--solverSettingReinstall :: Bool,
--solverSettingAvoidReinstalls :: Bool,
......
......@@ -898,8 +898,7 @@ planPackages verbosity comp platform solver SolverSettings{..}
setMaxBackjumps solverSettingMaxBackjumps
--TODO: [required eventually] should only be configurable for custom installs
-- . setIndependentGoals solverSettingIndependentGoals
. setIndependentGoals solverSettingIndependentGoals
. setReorderGoals solverSettingReorderGoals
......
......@@ -2413,7 +2413,7 @@ optionSolverFlags :: ShowOrParseArgs
-> (flags -> Flag StrongFlags) -> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls) -> (Flag AllowBootLibInstalls -> flags -> flags)
-> [OptionField flags]
optionSolverFlags showOrParseArgs getmbj setmbj getrg setrg getcc setcc _getig _setig
optionSolverFlags showOrParseArgs getmbj setmbj getrg setrg getcc setcc getig setig
getsip setsip getstrfl setstrfl getib setib =
[ option [] ["max-backjumps"]
("Maximum number of backjumps allowed while solving (default: " ++ show defaultMaxBackjumps ++ "). Use a negative number to enable unlimited backtracking. Use 0 to disable backtracking completely.")
......@@ -2430,14 +2430,11 @@ optionSolverFlags showOrParseArgs getmbj setmbj getrg setrg getcc setcc _getig _
(fmap asBool . getcc)
(setcc . fmap CountConflicts)
(yesNoOpt showOrParseArgs)
-- TODO: Disabled for now because it may not be necessary
{-
, option [] ["independent-goals"]
"Treat several goals on the command line as independent. If several goals depend on the same package, different versions can be chosen."
(fmap asBool . getig)
(setig . fmap IndependentGoals)
(yesNoOpt showOrParseArgs)
-}
, option [] ["shadow-installed-packages"]
"If multiple package instances of the same version are installed, treat all but one as shadowed."
(fmap asBool . getsip)
......
......@@ -357,6 +357,7 @@ instance Arbitrary ProjectConfigShared where
<*> arbitrary <*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
where
arbitraryConstraints :: Gen [(UserConstraint, ConstraintSource)]
arbitraryConstraints =
......@@ -367,22 +368,22 @@ instance Arbitrary ProjectConfigShared where
x05 x06 x07 x08 x09
x10 x11 x12 x13 x14
x15 x16 x17 x18 x19
x20) =
x20 x21) =
[ ProjectConfigShared
x00' x01' x02' (fmap getNonEmpty x03') (fmap getNonEmpty x04')
x05' x06' x07' x08' (postShrink_Constraints x09')
x10' x11' x12' x13' x14' x15' x16' x17' x18' x19' x20'
x10' x11' x12' x13' x14' x15' x16' x17' x18' x19' x20' x21'
| ((x00', x01', x02', x03', x04'),
(x05', x06', x07', x08', x09'),
(x10', x11', x12', x13', x14'),
(x15', x16', x17', x18', x19'),
x20')
x20', x21')
<- shrink
((x00, x01, x02, fmap NonEmpty x03, fmap NonEmpty x04),
(x05, x06, x07, x08, preShrink_Constraints x09),
(x10, x11, x12, x13, x14),
(x15, x16, x17, x18, x19),
x20)
x20, x21)
]
where
preShrink_Constraints = map fst
......@@ -615,6 +616,9 @@ instance Arbitrary ReorderGoals where
instance Arbitrary CountConflicts where
arbitrary = CountConflicts <$> arbitrary
instance Arbitrary IndependentGoals where
arbitrary = IndependentGoals <$> arbitrary
instance Arbitrary StrongFlags where
arbitrary = StrongFlags <$> arbitrary
......
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