File tree Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ buildOptsFromMonoid BuildOptsMonoid{..} = BuildOpts
68
68
where
69
69
-- These options are not directly used in bopts, instead they
70
70
-- transform other options.
71
- tracing = fromFirst False buildMonoidTrace
72
- profiling = fromFirst False buildMonoidProfile
71
+ tracing = getAny buildMonoidTrace
72
+ profiling = getAny buildMonoidProfile
73
73
noStripping = getAny buildMonoidNoStrip
74
74
-- Additional args for tracing / profiling
75
75
additionalArgs =
Original file line number Diff line number Diff line change @@ -26,20 +26,28 @@ buildOptsMonoidParser hide0 =
26
26
hideExceptGhci =
27
27
hideMods (hide0 `notElem` [BuildCmdGlobalOpts , GhciCmdGlobalOpts ])
28
28
29
- trace =
30
- firstBoolFlags
31
- " trace"
32
- " Enable profiling in libraries, executables, etc. \
33
- \for all expressions and generate a backtrace on \
34
- \exception"
35
- hideExceptGhci
36
- profile =
37
- firstBoolFlags
38
- " profile"
39
- " profiling in libraries, executables, etc. \
40
- \for all expressions and generate a profiling report\
41
- \ in tests or benchmarks"
42
- hideExceptGhci
29
+ -- These use 'Any' because they are not settable in stack.yaml, so
30
+ -- there is no need for options like --no-profile.
31
+ trace = Any <$>
32
+ flag
33
+ False
34
+ True
35
+ (long " trace" <>
36
+ help
37
+ " Enable profiling in libraries, executables, etc. \
38
+ \for all expressions and generate a backtrace on \
39
+ \exception" <>
40
+ hideExceptGhci)
41
+ profile = Any <$>
42
+ flag
43
+ False
44
+ True
45
+ (long " profile" <>
46
+ help
47
+ " profiling in libraries, executables, etc. \
48
+ \for all expressions and generate a profiling report\
49
+ \ in tests or benchmarks" <>
50
+ hideExceptGhci)
43
51
noStrip = Any <$>
44
52
flag
45
53
False
@@ -52,6 +60,7 @@ buildOptsMonoidParser hide0 =
52
60
\debuggers/profiling tools/other utilities that use \
53
61
\debugging symbols." <>
54
62
hideExceptGhci)
63
+
55
64
libProfiling =
56
65
firstBoolFlags
57
66
" library-profiling"
Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ data BuildCommand
149
149
150
150
-- | Build options that may be specified in the stack.yaml or from the CLI
151
151
data BuildOptsMonoid = BuildOptsMonoid
152
- { buildMonoidTrace :: ! ( First Bool )
153
- , buildMonoidProfile :: ! ( First Bool )
152
+ { buildMonoidTrace :: ! Any
153
+ , buildMonoidProfile :: ! Any
154
154
, buildMonoidNoStrip :: ! Any
155
155
, buildMonoidLibProfile :: ! (First Bool )
156
156
, buildMonoidExeProfile :: ! (First Bool )
@@ -176,8 +176,8 @@ data BuildOptsMonoid = BuildOptsMonoid
176
176
177
177
instance FromJSON (WithJSONWarnings BuildOptsMonoid ) where
178
178
parseJSON = withObjectWarnings " BuildOptsMonoid"
179
- (\ o -> do let buildMonoidTrace = First Nothing
180
- buildMonoidProfile = First Nothing
179
+ (\ o -> do let buildMonoidTrace = Any False
180
+ buildMonoidProfile = Any False
181
181
buildMonoidNoStrip = Any False
182
182
buildMonoidLibProfile <- First <$> o ..:? buildMonoidLibProfileArgName
183
183
buildMonoidExeProfile <- First <$> o ..:? buildMonoidExeProfileArgName
You can’t perform that action at this time.
0 commit comments