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

Add --enable/disable-per-component to ease testing legacy code path.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 40318a77
......@@ -258,6 +258,7 @@ instance Semigroup SavedConfig where
installBuildReports = combine installBuildReports,
installReportPlanningFailure = combine installReportPlanningFailure,
installSymlinkBinDir = combine installSymlinkBinDir,
installPerComponent = combine installPerComponent,
installOneShot = combine installOneShot,
installNumJobs = combine installNumJobs,
installKeepGoing = combine installKeepGoing,
......
......@@ -305,6 +305,7 @@ convertLegacyAllPackageFlags globalFlags configFlags
--installUpgradeDeps = projectConfigUpgradeDeps,
installReorderGoals = projectConfigReorderGoals,
installCountConflicts = projectConfigCountConflicts,
installPerComponent = projectConfigPerComponent,
--installIndependentGoals = projectConfigIndependentGoals,
--installShadowPkgs = projectConfigShadowPkgs,
installStrongFlags = projectConfigStrongFlags,
......@@ -516,6 +517,7 @@ convertToLegacySharedConfig
installBuildReports = projectConfigBuildReports,
installReportPlanningFailure = projectConfigReportPlanningFailure,
installSymlinkBinDir = projectConfigSymlinkBinDir,
installPerComponent = projectConfigPerComponent,
installOneShot = projectConfigOneShot,
installNumJobs = projectConfigNumJobs,
installKeepGoing = projectConfigKeepGoing,
......
......@@ -183,6 +183,7 @@ data ProjectConfigShared
projectConfigMaxBackjumps :: Flag Int,
projectConfigReorderGoals :: Flag ReorderGoals,
projectConfigCountConflicts :: Flag CountConflicts,
projectConfigPerComponent :: Flag Bool,
projectConfigStrongFlags :: Flag StrongFlags,
projectConfigAllowBootLibInstalls :: Flag AllowBootLibInstalls
......
......@@ -1176,7 +1176,7 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
solverPlan localPackages
sourcePackageHashes
defaultInstallDirs
_sharedPackageConfig
sharedPackageConfig
localPackagesConfig
perPackageConfig = do
x <- elaboratedInstallPlan
......@@ -1252,6 +1252,9 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
-- 0 component graph nodes and effectively vanishes. We want to
-- keep it around at least for error reporting purposes.
&& length g > 0
-- For ease of testing, we let per-component builds be toggled
-- at the top level
&& fromFlagOrDefault True (projectConfigPerComponent sharedPackageConfig)
{-
-- Only non-Custom or sufficiently recent Custom
......
......@@ -1435,6 +1435,7 @@ data InstallFlags = InstallFlags {
installBuildReports :: Flag ReportLevel,
installReportPlanningFailure :: Flag Bool,
installSymlinkBinDir :: Flag FilePath,
installPerComponent :: Flag Bool,
installOneShot :: Flag Bool,
installNumJobs :: Flag (Maybe Int),
installKeepGoing :: Flag Bool,
......@@ -1478,6 +1479,7 @@ defaultInstallFlags = InstallFlags {
installBuildReports = Flag NoReports,
installReportPlanningFailure = Flag False,
installSymlinkBinDir = mempty,
installPerComponent = Flag True,
installOneShot = Flag False,
installNumJobs = mempty,
installKeepGoing = Flag False,
......@@ -1692,6 +1694,11 @@ installOptions showOrParseArgs =
installReportPlanningFailure (\v flags -> flags { installReportPlanningFailure = v })
trueArg
, option "" ["per-component"]
"Per-component builds when possible"
installPerComponent (\v flags -> flags { installPerComponent = v })
(boolOpt [] [])
, option [] ["one-shot"]
"Do not record the packages in the world file."
installOneShot (\v flags -> flags { installOneShot = v })
......
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