@@ -42,8 +42,7 @@ import Stack.Package
42
42
import Stack.PackageFile ( getPackageFile )
43
43
import Stack.Prelude
44
44
import Stack.Types.BuildOpts ( BuildOpts (.. ) )
45
- import Stack.Types.BuildOptsCLI
46
- ( ApplyCLIFlag (.. ), BuildOptsCLI (.. ) )
45
+ import Stack.Types.BuildOptsCLI ( ApplyCLIFlag (.. ) )
47
46
import Stack.Types.Config ( Config (.. ), HasConfig (.. ), buildOptsL )
48
47
import Stack.Types.EnvConfig
49
48
( EnvConfig (.. ), HasEnvConfig (.. ), actualCompilerVersionL )
@@ -74,7 +73,11 @@ findFileTargets ::
74
73
-- ^ All project packages
75
74
-> [Path Abs File ]
76
75
-- ^ File targets to find
77
- -> RIO env (Map PackageName Target , Map PackageName [Path Abs File ], [Path Abs File ])
76
+ -> RIO
77
+ env
78
+ ( Map PackageName Target
79
+ , Maybe (Map PackageName [Path Abs File ], [Path Abs File ])
80
+ )
78
81
findFileTargets locals fileTargets = do
79
82
filePackages <- forM locals $ \ lp -> do
80
83
PackageComponentFile _ compFiles _ _ <- getPackageFile lp. package lp. cabalFP
@@ -126,7 +129,7 @@ findFileTargets locals fileTargets = do
126
129
foldl' (M. unionWith (<>) ) M. empty $
127
130
map (\ (fp, (name, _)) -> M. singleton name [fp])
128
131
associatedFiles
129
- pure (targetMap, infoMap, extraFiles)
132
+ pure (targetMap, Just ( infoMap, extraFiles) )
130
133
131
134
-- | Yields all of the targets that are local, those that are directly wanted
132
135
-- and those that are extra dependencies to load.
@@ -175,23 +178,25 @@ getAllNonLocalTargets targets = do
175
178
-- v'GhciPkgDesc'.
176
179
loadGhciPkgDescs ::
177
180
HasEnvConfig env
178
- => BuildOptsCLI
181
+ => Map ApplyCLIFlag (Map FlagName Bool )
182
+ -- ^ Flags specified on the command line.
179
183
-> [(PackageName , (Path Abs File , Target ))]
180
184
-- ^ Local targets.
181
185
-> RIO env [GhciPkgDesc ]
182
- loadGhciPkgDescs buildOptsCLI localTargets =
186
+ loadGhciPkgDescs cliFlags localTargets =
183
187
forM localTargets $ \ (name, (cabalFP, target)) ->
184
- loadGhciPkgDesc buildOptsCLI name cabalFP target
188
+ loadGhciPkgDesc cliFlags name cabalFP target
185
189
186
190
-- | Load package description information for a ghci target.
187
191
loadGhciPkgDesc ::
188
192
HasEnvConfig env
189
- => BuildOptsCLI
193
+ => Map ApplyCLIFlag (Map FlagName Bool )
194
+ -- ^ Flags specified on the command line.
190
195
-> PackageName
191
196
-> Path Abs File
192
197
-> Target
193
198
-> RIO env GhciPkgDesc
194
- loadGhciPkgDesc buildOptsCLI name cabalFP target = do
199
+ loadGhciPkgDesc cliFlags name cabalFP target = do
195
200
econfig <- view envConfigL
196
201
compilerVersion <- view actualCompilerVersionL
197
202
let sm = econfig. sourceMap
@@ -242,7 +247,6 @@ loadGhciPkgDesc buildOptsCLI name cabalFP target = do
242
247
, target
243
248
}
244
249
where
245
- cliFlags = buildOptsCLI. flags
246
250
-- | All CLI Cabal flags for a package.
247
251
getCliFlags :: Map FlagName Bool
248
252
getCliFlags = Map. unions
0 commit comments