Skip to content

Commit 7a8296d

Browse files
committed
Remove recently added '--no-profile' / '--no-trace' - unnecessary
1 parent 3f69d19 commit 7a8296d

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

src/Stack/Config/Build.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ buildOptsFromMonoid BuildOptsMonoid{..} = BuildOpts
6868
where
6969
-- These options are not directly used in bopts, instead they
7070
-- transform other options.
71-
tracing = fromFirst False buildMonoidTrace
72-
profiling = fromFirst False buildMonoidProfile
71+
tracing = getAny buildMonoidTrace
72+
profiling = getAny buildMonoidProfile
7373
noStripping = getAny buildMonoidNoStrip
7474
-- Additional args for tracing / profiling
7575
additionalArgs =

src/Stack/Options/BuildMonoidParser.hs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,28 @@ buildOptsMonoidParser hide0 =
2626
hideExceptGhci =
2727
hideMods (hide0 `notElem` [BuildCmdGlobalOpts, GhciCmdGlobalOpts])
2828

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)
4351
noStrip = Any <$>
4452
flag
4553
False
@@ -52,6 +60,7 @@ buildOptsMonoidParser hide0 =
5260
\debuggers/profiling tools/other utilities that use \
5361
\debugging symbols." <>
5462
hideExceptGhci)
63+
5564
libProfiling =
5665
firstBoolFlags
5766
"library-profiling"

src/Stack/Types/Config/Build.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ data BuildCommand
149149

150150
-- | Build options that may be specified in the stack.yaml or from the CLI
151151
data BuildOptsMonoid = BuildOptsMonoid
152-
{ buildMonoidTrace :: !(First Bool)
153-
, buildMonoidProfile :: !(First Bool)
152+
{ buildMonoidTrace :: !Any
153+
, buildMonoidProfile :: !Any
154154
, buildMonoidNoStrip :: !Any
155155
, buildMonoidLibProfile :: !(First Bool)
156156
, buildMonoidExeProfile :: !(First Bool)
@@ -176,8 +176,8 @@ data BuildOptsMonoid = BuildOptsMonoid
176176

177177
instance FromJSON (WithJSONWarnings BuildOptsMonoid) where
178178
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
181181
buildMonoidNoStrip = Any False
182182
buildMonoidLibProfile <- First <$> o ..:? buildMonoidLibProfileArgName
183183
buildMonoidExeProfile <-First <$> o ..:? buildMonoidExeProfileArgName

0 commit comments

Comments
 (0)