Skip to content

Commit 8735064

Browse files
committed
Fix single test
1 parent 328ef56 commit 8735064

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/Stack/Types/Build.hs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,36 @@ configureOptsNoDir econfig bco deps isLocal package = concat
629629
flagNameString name)
630630
(Map.toList flags)
631631
, map T.unpack $ packageCabalConfigOpts package
632-
, concatMap (\x -> [compilerOptionsCabalFlag wc, T.unpack x]) (packageGhcOptions package)
632+
, processGhcOptions (packageGhcOptions package)
633633
, map ("--extra-include-dirs=" ++) (configExtraIncludeDirs config)
634634
, map ("--extra-lib-dirs=" ++) (configExtraLibDirs config)
635635
, maybe [] (\customGcc -> ["--with-gcc=" ++ toFilePath customGcc]) (configOverrideGccPath config)
636636
, ["--exact-configuration"]
637637
, ["--ghc-option=-fhide-source-paths" | hideSourcePaths cv]
638638
]
639639
where
640+
processGhcOptions :: [Text] -> [String]
641+
processGhcOptions ("+RTS" : xs) =
642+
let
643+
(rtsArgs, rest) =
644+
takeRtsArgs xs
645+
in
646+
("--ghc-options=+RTS " ++ rtsArgs) : processGhcOptions rest
647+
processGhcOptions (x : xs) =
648+
[compilerOptionsCabalFlag wc, T.unpack x] ++ processGhcOptions xs
649+
processGhcOptions [] =
650+
[]
651+
takeRtsArgs :: [Text] -> (String, [Text])
652+
takeRtsArgs ("-RTS" : xs) =
653+
("-RTS", xs)
654+
takeRtsArgs (x : xs) =
655+
let
656+
(other, rest) =
657+
takeRtsArgs xs
658+
in
659+
(T.unpack x ++ " " ++ other, rest)
660+
takeRtsArgs [] =
661+
([], [])
640662
wc = view (actualCompilerVersionL.to whichCompiler) econfig
641663
cv = view (actualCompilerVersionL.to getGhcVersion) econfig
642664

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import StackTest
22

33
main :: IO ()
4-
main = stack ["build"]
4+
main = do
5+
stack ["clean"]
6+
stack ["build"]

0 commit comments

Comments
 (0)