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

hie debug fails with the stack cradle #92

Closed
jneira opened this issue Nov 17, 2019 · 3 comments
Closed

hie debug fails with the stack cradle #92

jneira opened this issue Nov 17, 2019 · 3 comments

Comments

@jneira
Copy link
Member

jneira commented Nov 17, 2019

From #90 (comment) (it fails in master too)

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
  • After adding some traces to readProcessWithOutputFile:
PS D:\dev\ws\haskell\stack-test> hie-bios debug .\src\MyLib.hs
readProcessWithOutputFile: fp="stack", args=["repl","--no-nix-pure","--no-load","--with-ghc","C:\\Users\\atrey\\AppData\\Local\\hie-bios\\wrapper-0.3.0.exe","D:\\dev\\ws\\haskell\\stack-test"]
readProcessWithOutputFile: res="", stde=["\ESC[0mError parsing targets: Unknown local package: D","Note that to specify options to be passed to GHCi, use the --ghci-options flag\ESC[0m"], stdo=[]
readProcessWithOutputFile: fp="stack", args=["path","--ghc-package-path"]
readProcessWithOutputFile: res="", stde=[], stdo=["D:\\dev\\ws\\haskell\\stack-test\\.stack-work\\install\\33169d5a\\pkgdb;C:\\sr\\snapshots\\67a70798\\pkgdb;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

It seems you cant pass a path to a directory to stack repl?

PS D:\dev\ws\haskell\stack-test> stack repl  --no-load --with-ghc C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe D:\dev\ws\haskell\stack-test
Error parsing targets: Unknown local package: D
@jneira jneira changed the title hie debug fails in windows with the stack cradle hie debug fails with the stack cradle Nov 18, 2019
@jneira
Copy link
Member Author

jneira commented Dec 13, 2019

The workaround is to use cwd in the project root dir (with 0013516) :

PS D:\dev\ws\haskell\stack-test> hie-bios debug
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
PS D:\dev\ws\haskell\stack-test> hie-bios debug .
Root directory:      D:\dev\ws\haskell\stack-test
GHC options:         -i -odir=D:\dev\ws\haskell\stack-test\.stack-work\odir -hidir=D:\dev\ws\haskell\stack-test\.stack-work\odir -hide-all-packages -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build -iD:\dev\ws\haskell\stack-test\src -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build\autogen -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build\global-autogen -stubdir=D:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build -ID:\bin\stack\x86_64-windows\msys2-20180531\mingw64\include -LD:\bin\stack\x86_64-windows\msys2-20180531\mingw64\lib -LD:\bin\stack\x86_64-windows\msys2-20180531\mingw64\bin -package-id=base-4.12.0.0 -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build\stack-test -iD:\dev\ws\haskell\stack-test\app -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build\stack-test\autogen -iD:\dev\ws\haskell\stack-test\.stack-work\dist\e626a42b\build\stack-test\stack-test-tmp -package-id=bytestring-0.10.8.2 -optP-include -optPD:\dev\ws\haskell\stack-test\.stack-work\ghci\0e0774d4\cabal_macros.h -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
System libraries:    D:\bin\stack\x86_64-windows\ghc-8.6.5\lib
Dependencies:        stack-test.cabal package.yaml stack.yaml

The path without drive letter also works: hie-bios debug \dev\ws\haskell\stack-test

It seems a stack issue. Will fill a ticket upstream.

@mpickering
Copy link
Collaborator

Fixed in latest master as the stack cradle works totally differently!

@jneira
Copy link
Member Author

jneira commented Dec 14, 2019

Uh i thought i had tested with master, i will double check
It works on master

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