haskell / hie-bios

Set up a GHC API session for various Haskell Projects
https://hackage.haskell.org/package/hie-bios
BSD 3-Clause "New" or "Revised" License
181 stars 63 forks source link

Errors in windows with `hie-bios check file` #33

Closed jneira closed 5 years ago

jneira commented 5 years ago

Hi, i am trying the package in isolation in windows and i am not able to get a correct result in some cases:

(ExitSuccess,"","") CallStack (from HasCallStack): error, called at src\HIE\Bios\Cradle.hs:154:18 in hie-bios-0.1.0-a8e013fc044c2bff792c3b29dcd1fb02cfedc8f6:HIE.Bios.Cradle

* In a stack based project without `cabal.project` and `stack.yaml` (maybe related with #11):

D:\ws\haskell\stack-test>hie-bios check src\Lib.hs cradble Cradle {cradleRootDir = "D:\ws\haskell\stack-test", cradleOptsProg = Cradle Action: stack}

!/usr/bin/env bash

if [ "$1" == "--interactive" ]; then pwd echo "$@" else ghc "$@" fi

(ExitFailure 1,"\"stty\" no se reconoce como un comando interno o externo,\nprog rama o archivo por lotes ejecutable.\n","") CallStack (from HasCallStack): error, called at src\HIE\Bios\Cradle.hs:203:18 in hie-bios-0.1.0-a8e013fc044c2bff792c3b29dcd1fb02cfedc8f6:HIE.Bios.Cradle

* In a simple cabal based project it seems to work:

D:\ws\haskell\cabal-test>hie-bios check lib\CabalTestLib.hs cradble Cradle {cradleRootDir = "D:\ws\haskell\cabal-test", cradleOptsProg = Cradle Action: default} res (ExitSuccess,"",[],"lib\CabalTestLib.hs") [] 0 ([],0) ([],0) setTargets (lib\CabalTestLib.hs , lib\CabalTestLib.hs) [*lib\CabalTestLib.hs] ([],0) modGraph [ModSummary { ms_hs_date = date ms_mod = CabalTestLib, ms_textual_imps = [(Nothing, Prelude), (Nothing, Data.ByteString), (Nothing, Network.HTTP.Types.URI)] ms_srcimps = [] }] modGraph [ModLocation {ml_hs_file = Just "lib\CabalTestLib.hs", ml_hi_file = "C:\Users\user\AppData\Local\haskell-ide-engine\da39a3ee5e6b4b0d3255bfef95601890afd8 0709\CabalTestLib.hi", ml_obj_file = "lib\CabalTestLib.o"}] hidir Just [C, :, \, U, s, e, r, s, \, u, s, e, r, \, A, p, p, D, a, t, a, \, L, o, c, a, l, \, h, a, s, k, e, l, l, -, i, d, e, -, e, n, g, i, n, e, \, d, a, 3, 9, a, 3, e, e, 5, e, 6, b, 4, b, 0, d, 3, 2, 5, 5, b, f, e, f, 9, 5, 6, 0, 1, 8, 9, 0, a, f, d, 8, 0, 7, 0, 9] lib\CabalTestLib.hs:7:1:Warning: Top-level binding with no type signature: f :: Num p => [a] -> p lib\CabalTestLib.hs:7:1:Warning: Pattern match(es) are non-exhaustive In an equa tion for ‘f’: Patterns not matched: [] [] lib\CabalTestLib.hs:7:4:Warning: Defined but not used: ‘x’ �� lib\CabalTestLib.hs:7:6:Warning: Defined but not used: ‘xs’ ��

jneira commented 5 years ago

After #50 (and maybe some other changes in between), hie-bios check src\HIE\Bios\Cradle.hs works using stack and throws another error using cabal, so closing this.