From cb20a6bf278acfbd1c1237e7396d8de4cafb3b96 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 23 Aug 2021 23:10:38 +0200 Subject: [PATCH] Fix how cpp-options are passed to ghci wrt #5532 -DFOO options can be passed directly to ghc, but cpp-options may include flags for the preprocessor, so we need to pass it via -optP. --- src/Stack/Package.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Stack/Package.hs b/src/Stack/Package.hs index 4db50d2a4b..3654039b3f 100644 --- a/src/Stack/Package.hs +++ b/src/Stack/Package.hs @@ -358,7 +358,7 @@ data BioInput = BioInput generateBuildInfoOpts :: BioInput -> BuildInfoOpts generateBuildInfoOpts BioInput {..} = BuildInfoOpts - { bioOpts = ghcOpts ++ cppOptions biBuildInfo + { bioOpts = ghcOpts ++ fmap ("-optP" <>) (cppOptions biBuildInfo) -- NOTE for future changes: Due to this use of nubOrd (and other uses -- downstream), these generated options must not rely on multiple -- argument sequences. For example, ["--main-is", "Foo.hs", "--main-