-
Notifications
You must be signed in to change notification settings - Fork 61
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
Don't use stdout to communicate arguments #90
Conversation
Can someone please test on windows? Also need to test the stack cradle. It should be sufficient to run I locally tested both wrappers ( |
@jinwoo I have changed the bios cradle in this PR so you have to output the options to a file given on the |
Hi i've tested this version with a stack gradle in windows 10 and i am getting an error: PS D:\dev\ws\haskell\stack-test> hie-bios check .\src\MyLib.hs
cradle
Cradle {cradleRootDir = "D:\\dev\\ws\\haskell\\stack-test", cradleOptsProg = CradleAction: stack}
[1 of 1] Compiling Main ( C:\TEMP\wra1104.hs, C:\TEMP\wra1104.o )
Linking C:\TEMP\wra1105.exe ...
setTargets
(.\src\MyLib.hs , .\src\MyLib.hs)
[*.\src\MyLib.hs]
modGraph
[ModSummary {
ms_hs_date = 2019-11-16 09:37:02.2444937 UTC
ms_mod = MyLib,
ms_textual_imps = [(Nothing, Prelude)]
ms_srcimps = []
}]
modGraph
[ModLocation {ml_hs_file = Just ".\\src\\MyLib.hs", ml_hi_file = "C:\\Users\\atrey\\AppData\\Local\\haskell-ide-engine\\1c4f925fc9fb40767202021de0bd97c68f3cc0c8\\MyLib.hi", ml_obj_file = "D:\\dev\\ws\\haskell\\stack-test\\.stack-work\\odir\\MyLib.o"}]
hidir
Just [C, :, \, U, s, e, r, s, \, a, t, r, e, y, \, 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, \, 1, c, 4, f, 9, 2, 5, f, c, 9, f, b, 4, 0, 7, 6,
7, 2, 0, 2, 0, 2, 1, d, e, 0, b, d, 9, 7, c, 6, 8, f, 3, c, c, 0,
c, 8]
PS D:\dev\ws\haskell\stack-test> hie-bios.no-stdout.exe check .\src\MyLib.hs
hie-bios.no-stdout.exe: hie-bios.no-stdout.exe: can't find a package database at D:\bin\stack\x86_64-windows\ghc-8.6.5\lib\package.conf.d
PS D:\dev\ws\haskell\stack-test> hie-bios.no-stdout.exe debug .\src\MyLib.hs
Cradle failed to load
Exit Code: ExitFailure 1
Stderr: Failed to parse result of calling cabal
�[0mError parsing targets: Unknown local package: D
Note that to specify options to be passed to GHCi, use the --ghci-options flag�[0m It seems the error is caused by windows paths... |
Some tests using directly the wrapper: D:\dev\ws\haskell\stack-test>C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe
wrapper-0.3.0.exe: HIE_BIOS_OUTPUT: getEnv: does not exist (no environment variable)
D:\dev\ws\haskell\stack-test>set HIE_BIOS_OUTPUT=C:\Users\atrey\AppData\Local\hie-bios\hie.bios.out
D:\dev\ws\haskell\stack-test>C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe
ghc: no input files
Usage: For basic information, try the `--help' option.
D:\dev\ws\haskell\stack-test>C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe src\MyLib.hs
[1 of 1] Compiling MyLib ( src\MyLib.hs, src\MyLib.o )
D:\dev\ws\haskell\stack-test>C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe --interactive src\MyLib.hs
"C:\\Users\\atrey\\AppData\\Local\\hie-bios\\hie.bios.out"
D:\dev\ws\haskell\stack-test>type C:\Users\atrey\AppData\Local\hie-bios\hie.bios.out
D:\dev\ws\haskell\stack-test
--interactive
src\MyLib.hs |
Now all the cradles communicate by reading the value of HIE_BIOS_OUTPUT which is a filepath, and writing the arguments to that temporary file. This makes all the cradles more robust about the build tools spurting things to stdout.
6084098
to
17c48ed
Compare
Thanks, I pushed up a fix if you can try that at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt test it yet by hand, but other than that it looks good!
Yeah, this is fine by me. Thanks for the heads up, @mpickering |
@mpickering: i had to add Note that the rest of paths are readed correctly and the last one has a |
With the last commit, PS D:\dev\ws\haskell\stack-test> hie-bios check .\src\MyLib.hs
pkg_ghc_args["-package-db","D:\\dev\\ws\\haskell\\stack-test\\.stack-work\\install\\33169d5a\\pkgdb","-package-db","C:\\sr\\snapshots\\67a70798\\pkgdb","-package-db","D:\\bin\\stack\\x86_64-windows\\ghc-8.6.5\\lib\\package.conf.d"]
src\MyLib.hs:4:12:• Variable not in scope: putStrLnX :: [Char] -> IO ()
• Perhaps you meant ‘putStrLn’ (imported from Prelude)
PS D:\dev\ws\haskell\stack-test> hie-bios debug .\src\MyLib.hs
pkg_ghc_args["-package-db","D:\\dev\\ws\\haskell\\stack-test\\.stack-work\\install\\33169d5a\\pkgdb","-package-db","C:\\sr\\snapshots\\67a70798\\pkgdb","-package-db","D:\\bin\\stack\\x86_64-windows\\ghc-8.6.5\\lib\\package.conf.d"]
Cradle failed to load
Exit Code: ExitFailure 1
Stderr: Failed to parse result of calling cabal
�[0mError parsing targets: Unknown local package: D
Note that to specify options to be passed to GHCi, use the --ghci-options flag�[0m Both commands are calling |
i've tried d700b2b but the error persists with |
I've added some traces to
It seems you cant pass a path to a directory to
|
@jneira Does |
@mpickering yeah, |
Adding basic tests for the cradle loading and GHC API logic. The tests are far from complete but they have already showed up some issues with #90 We really need to enable CI for windows as well as that has been a very tricky platform to support.
Now all the cradles communicate by reading the value of HIE_BIOS_OUTPUT
which is a filepath, and writing the arguments to that temporary file.
This makes all the cradles more robust about the build tools spurting
things to stdout.