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

Revert "Add support for register --assume-deps-up-to-date. (#3287)"

This reverts commit 2fac2ec6.
parent 5a2b2360
...@@ -55,6 +55,7 @@ import Distribution.Types.ComponentLocalBuildInfo ...@@ -55,6 +55,7 @@ import Distribution.Types.ComponentLocalBuildInfo
import Distribution.Simple.LocalBuildInfo import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.BuildPaths import Distribution.Simple.BuildPaths
import Distribution.Simple.BuildTarget
import qualified Distribution.Simple.GHC as GHC import qualified Distribution.Simple.GHC as GHC
import qualified Distribution.Simple.GHCJS as GHCJS import qualified Distribution.Simple.GHCJS as GHCJS
...@@ -62,7 +63,6 @@ import qualified Distribution.Simple.LHC as LHC ...@@ -62,7 +63,6 @@ import qualified Distribution.Simple.LHC as LHC
import qualified Distribution.Simple.UHC as UHC import qualified Distribution.Simple.UHC as UHC
import qualified Distribution.Simple.HaskellSuite as HaskellSuite import qualified Distribution.Simple.HaskellSuite as HaskellSuite
import Distribution.Simple.BuildTarget
import Distribution.Simple.Compiler import Distribution.Simple.Compiler
import Distribution.Simple.Program import Distribution.Simple.Program
import Distribution.Simple.Program.Script import Distribution.Simple.Program.Script
...@@ -109,20 +109,9 @@ register pkg_descr lbi flags = ...@@ -109,20 +109,9 @@ register pkg_descr lbi flags =
| otherwise = return Nothing | otherwise = return Nothing
where clbi = targetCLBI target where clbi = targetCLBI target
ipis <- ipis <- fmap catMaybes
if fromFlag (regAssumeDepsUpToDate flags) . traverse maybeGenerateOne
then $ neededTargetsInBuildOrder' pkg_descr lbi (map nodeKey targets)
case targets of
[target] -> do
mb_ipi <- maybeGenerateOne target
case mb_ipi of
Nothing -> die "Cannot --assume-deps-up-to-date register non-library target"
Just ipi -> return [ipi]
[] -> die "In --assume-deps-up-to-date mode you must specify a target"
_ -> die "In --assume-deps-up-to-date mode you can only register a single target"
else fmap catMaybes
. traverse maybeGenerateOne
$ neededTargetsInBuildOrder' pkg_descr lbi (map nodeKey targets)
registerAll pkg_descr lbi flags ipis registerAll pkg_descr lbi flags ipis
return () return ()
where where
......
...@@ -1179,9 +1179,6 @@ data RegisterFlags = RegisterFlags { ...@@ -1179,9 +1179,6 @@ data RegisterFlags = RegisterFlags {
regDistPref :: Flag FilePath, regDistPref :: Flag FilePath,
regPrintId :: Flag Bool, regPrintId :: Flag Bool,
regVerbosity :: Flag Verbosity, regVerbosity :: Flag Verbosity,
-- | If this is true, we don't register all libraries,
-- only directly referenced library in 'regArgs'.
regAssumeDepsUpToDate :: Flag Bool,
-- Same as in 'buildArgs' and 'copyArgs' -- Same as in 'buildArgs' and 'copyArgs'
regArgs :: [String] regArgs :: [String]
} }
...@@ -1195,9 +1192,8 @@ defaultRegisterFlags = RegisterFlags { ...@@ -1195,9 +1192,8 @@ defaultRegisterFlags = RegisterFlags {
regInPlace = Flag False, regInPlace = Flag False,
regDistPref = NoFlag, regDistPref = NoFlag,
regPrintId = Flag False, regPrintId = Flag False,
regVerbosity = Flag normal, regArgs = [],
regAssumeDepsUpToDate = Flag False, regVerbosity = Flag normal
regArgs = []
} }
registerCommand :: CommandUI RegisterFlags registerCommand :: CommandUI RegisterFlags
...@@ -1228,11 +1224,6 @@ registerCommand = CommandUI ...@@ -1228,11 +1224,6 @@ registerCommand = CommandUI
regInPlace (\v flags -> flags { regInPlace = v }) regInPlace (\v flags -> flags { regInPlace = v })
trueArg trueArg
,option "" ["assume-deps-up-to-date"]
"One-shot registration"
regAssumeDepsUpToDate (\c flags -> flags { regAssumeDepsUpToDate = c })
trueArg
,option "" ["gen-script"] ,option "" ["gen-script"]
"instead of registering, generate a script to register later" "instead of registering, generate a script to register later"
regGenScript (\v flags -> flags { regGenScript = v }) regGenScript (\v flags -> flags { regGenScript = v })
......
...@@ -2731,10 +2731,8 @@ setupHsRegisterFlags ElaboratedConfiguredPackage{..} _ ...@@ -2731,10 +2731,8 @@ setupHsRegisterFlags ElaboratedConfiguredPackage{..} _
_ -> toFlag False, _ -> toFlag False,
regPrintId = mempty, -- never use regPrintId = mempty, -- never use
regDistPref = toFlag builddir, regDistPref = toFlag builddir,
regVerbosity = toFlag verbosity, regArgs = [],
-- Currently not used, because this is per-package. regVerbosity = toFlag verbosity
regAssumeDepsUpToDate = toFlag False,
regArgs = []
} }
setupHsHaddockFlags :: ElaboratedConfiguredPackage setupHsHaddockFlags :: ElaboratedConfiguredPackage
......
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