on master help sign in
Merge pull request #635 from obsidiansystems/ls-fix-commit
0bc0374Elliot Cameron
lib/command/src/Obelisk/Command/Preprocessor.hs+4−1
@@ -86,7 +86,10 @@ generateHeader origPath packageInfo =
86 <> mconcat (intersperse (TL.fromText " ") optList)
86 <> mconcat (intersperse (TL.fromText " ") optList)
87 <> TL.fromText " #-}\n"
87 <> TL.fromText " #-}\n"
88 else mempty
88 else mempty
89+ optList = map TL.fromString
90+ $ filter (\x -> not (isPrefixOf "-O" x))
91+ $ fromMaybe []
89− optList = map TL.fromString $ fromMaybe [] $ lookup GHC (_cabalPackageInfo_compilerOptions packageInfo)
92+ $ lookup GHC (_cabalPackageInfo_compilerOptions packageInfo)
90
93
91lineNumberPragma :: FilePath -> TL.Builder
94lineNumberPragma :: FilePath -> TL.Builder
92lineNumberPragma origPath =
95lineNumberPragma origPath =
lib/command/src/Obelisk/Command/Run.hs+2−3
@@ -272,7 +272,7 @@ withGhciScript packageInfos pathBase f = do
272 ]
272 ]
273 dotGhci = unlines
273 dotGhci = unlines
274 -- TODO: Shell escape
274 -- TODO: Shell escape
275− [ ":set -pgmF " <> selfExe <> " -optF " <> preprocessorIdentifier <> " " <> unwords (map (("-optF " <>) . _cabalPackageInfo_packageRoot) packageInfos)
275+ [ ":set -F -pgmF " <> selfExe <> " -optF " <> preprocessorIdentifier <> " " <> unwords (map (("-optF " <>) . makeRelative pathBase . _cabalPackageInfo_packageFile) packageInfos)
276 , ":set -i" <> intercalate ":" (packageInfos >>= rootedSourceDirs)
276 , ":set -i" <> intercalate ":" (packageInfos >>= rootedSourceDirs)
277 , if null modulesToLoad then "" else ":load " <> unwords modulesToLoad
277 , if null modulesToLoad then "" else ":load " <> unwords modulesToLoad
278 , "import qualified Obelisk.Run"
278 , "import qualified Obelisk.Run"
@@ -314,8 +314,7 @@ runGhcid root chdirToRoot dotGhci packages mcmd =
314 where
314 where
315 opts =
315 opts =
316 [ "-W"
316 [ "-W"
317− --TODO: The decision of whether to use -fwarn-redundant-constraints should probably be made by the user
318− , "--command='ghci -Wall -ignore-dot-ghci -fwarn-redundant-constraints " <> makeBaseGhciOptions dotGhci <> "' "
317+ , "--command='ghci -ignore-dot-ghci " <> makeBaseGhciOptions dotGhci <> "' "
319 , "--reload=config"
318 , "--reload=config"
320 , "--outputfile=ghcid-output.txt"
319 , "--outputfile=ghcid-output.txt"
321 ] <> testCmd
320 ] <> testCmd