Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser fails when cabal runs configure in v2-repl #84

Closed
pranaysashank opened this issue Nov 1, 2019 · 0 comments
Closed

Parser fails when cabal runs configure in v2-repl #84

pranaysashank opened this issue Nov 1, 2019 · 0 comments

Comments

@pranaysashank
Copy link

In my project, hie-bios fails with

Failed to parse result of calling cabal\nChecking for gcc .. \n.....

cabal seems to be outputting the result of it's configure step before calling ghc --interactive

I got around this with modifying the shell script to

--- a/wrappers/cabal
+++ b/wrappers/cabal
@@ -1,5 +1,6 @@
 #!/usr/bin/env bash
 if [ "$1" == "--interactive" ]; then
+  echo -ne "Begin Args\n"
   pwd
   for arg in "$@"; do
     echo -ne "$arg\x00"

and filtering it out in processCabalWrapperArgs

--- a/src/HIE/Bios/Cradle.hs
+++ b/src/HIE/Bios/Cradle.hs
@@ -270,7 +270,7 @@ cabalWrapperHs = $(embedStringFile "wrappers/cabal.hs")
 
 processCabalWrapperArgs :: String -> Maybe [String]
 processCabalWrapperArgs args =
-    case lines args of
+    case drop 1 $ dropWhile ("Begin Args" /=) $ lines args of
         [dir, ghc_args] ->
             let final_args =
                     removeVerbosityOpts
@fendor fendor mentioned this issue Nov 14, 2019
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants