From 7e060ebb68ff268a78377b368ff22c14013037ff Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Sat, 18 Mar 2017 19:30:25 -0700 Subject: [PATCH] Add profile and trace RTS args to beginning not end #2399 --- ChangeLog.md | 4 ++++ src/Stack/Options/BuildMonoidParser.hs | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index ee299dfbab..337670dcc4 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,10 @@ Major changes: Behavior changes: +* `stack profile` and `stack trace` now add their extra RTS arguments for + benchmarks and tests to the beginning of the args, instead of the end. + See [#2399](https://github.com/commercialhaskell/stack/issues/2399) + Other enhancements: * `stack setup` allow to control options passed to ghcjs-boot with diff --git a/src/Stack/Options/BuildMonoidParser.hs b/src/Stack/Options/BuildMonoidParser.hs index 9b180d895c..67abc86379 100644 --- a/src/Stack/Options/BuildMonoidParser.hs +++ b/src/Stack/Options/BuildMonoidParser.hs @@ -29,15 +29,14 @@ buildOptsMonoidParser hide0 = { buildMonoidLibProfile = First (Just True) , buildMonoidExeProfile = First (Just True) , buildMonoidBenchmarkOpts = bopts - { beoMonoidAdditionalArgs = First (getFirst (beoMonoidAdditionalArgs bopts) <> - Just (" " <> unwords additionalArgs)) + { beoMonoidAdditionalArgs = First (Just (" " <> unwords additionalArgs) <> + getFirst (beoMonoidAdditionalArgs bopts)) } , buildMonoidTestOpts = topts - { toMonoidAdditionalArgs = toMonoidAdditionalArgs topts <> - additionalArgs + { toMonoidAdditionalArgs = additionalArgs <> toMonoidAdditionalArgs topts } } - | noStripping = + | noStripping = opts { buildMonoidLibStrip = First (Just False) , buildMonoidExeStrip = First (Just False) @@ -96,7 +95,7 @@ buildOptsMonoidParser hide0 = options = BuildOptsMonoid <$> libProfiling <*> exeProfiling <*> libStripping <*> - exeStripping <*> haddock <*> haddockOptsParser hideBool <*> + exeStripping <*> haddock <*> haddockOptsParser hideBool <*> openHaddocks <*> haddockDeps <*> haddockInternal <*> copyBins <*> preFetch <*> keepGoing <*> forceDirty <*> tests <*> testOptsParser hideBool <*> benches <*> benchOptsParser hideBool <*>