Skip to content

Commit 22508d2

Browse files
committed
Remove old cruft
1 parent e7c9b44 commit 22508d2

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

cabal-install/src/Distribution/Client/CmdShowBuildInfo.hs

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ import Distribution.Simple.Setup
2121
import Distribution.Simple.Command
2222
( CommandUI(..), option, reqArg', usageAlternatives )
2323
import Distribution.Verbosity
24-
(Verbosity, silent )
24+
( Verbosity, silent )
2525
import Distribution.Simple.Utils
26-
(wrapText, die' )
27-
import Distribution.Types.UnitId
28-
( mkUnitId )
29-
import Distribution.Pretty
30-
( prettyShow )
26+
( wrapText )
3127

3228
import qualified Data.Map as Map
3329
import qualified Distribution.Simple.Setup as Cabal
@@ -41,7 +37,6 @@ import Distribution.Client.DistDirLayout
4137
import Distribution.Simple.ShowBuildInfo
4238
import Distribution.Utils.Json
4339

44-
import Control.Monad (forM_, unless)
4540
import Data.Either
4641
import qualified Data.Text as T
4742
import qualified Data.Text.IO as T
@@ -93,36 +88,23 @@ showBuildInfoAction :: NixStyleFlags ShowBuildInfoFlags -> [String] -> GlobalFla
9388
showBuildInfoAction flags@NixStyleFlags { extraFlags = (ShowBuildInfoFlags fileOutput unitIdStrs), ..}
9489
targetStrings globalFlags = do
9590
baseCtx <- establishProjectBaseContext verbosity cliConfig OtherCommand
96-
let baseCtx' = baseCtx
97-
{ buildSettings = (buildSettings baseCtx) { buildSettingDryRun = True }
98-
}
9991

10092
targetSelectors <- either (reportTargetSelectorProblems verbosity) return
101-
=<< readTargetSelectors (localPackages baseCtx') Nothing targetStrings
93+
=<< readTargetSelectors (localPackages baseCtx) Nothing targetStrings
10294

10395
buildCtx <-
104-
runProjectPreBuildPhase verbosity baseCtx' $ \elaboratedPlan -> do
96+
runProjectPreBuildPhase verbosity baseCtx $ \elaboratedPlan -> do
10597
-- Interpret the targets on the command line as build targets
10698
-- (as opposed to say repl or haddock targets).
107-
108-
targets' <- either (reportShowBuildInfoTargetProblems verbosity) return
99+
targets <- either (reportShowBuildInfoTargetProblems verbosity) return
109100
$ resolveTargets
110101
selectPackageTargets
111102
selectComponentTarget
112103
elaboratedPlan
113104
Nothing
114105
targetSelectors
115106

116-
let unitIds = map mkUnitId <$> unitIdStrs
117-
118-
-- Check that all the unit ids exist
119-
forM_ (fromMaybe [] unitIds) $ \ui ->
120-
unless (Map.member ui targets') $
121-
die' verbosity ("No unit " ++ prettyShow ui)
122-
123-
-- Filter out targets that aren't in the specified unit ids
124-
let targets = Map.filterWithKey (\k _ -> maybe True (elem k) unitIds) targets'
125-
elaboratedPlan' = pruneInstallPlanToTargets
107+
let elaboratedPlan' = pruneInstallPlanToTargets
126108
TargetActionBuildInfo
127109
targets
128110
elaboratedPlan

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,7 @@ nubComponentTargets =
25952595
-> [(ComponentTarget, NonEmpty a)]
25962596
wholeComponentOverrides ts =
25972597
case [ ta | ta@(ComponentTarget _ WholeComponent, _) <- ts ] of
2598-
((t, x):_) ->
2598+
((t, x):_) ->
25992599
let
26002600
-- Delete tuple (t, x) from original list to avoid duplicates.
26012601
-- Use 'deleteBy', to avoid additional Class constraint on 'nubComponentTargets'.

0 commit comments

Comments
 (0)