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

Fails to compile wrapper with a stack cradle #109

Closed
ndmitchell opened this issue Dec 18, 2019 · 5 comments
Closed

Fails to compile wrapper with a stack cradle #109

ndmitchell opened this issue Dec 18, 2019 · 5 comments

Comments

@ndmitchell
Copy link
Contributor

When I try with 0.3.0 I get:

c:\Neil\ghcide>ghcide Sample.hs
ghcide version: 0.0.5 (GHC: 8.6.5)
Ghcide setup tester in c:\Neil\ghcide.
Report bugs at https://github.com/digital-asset/ghcide/issues

Step 1/6: Finding files to test in c:\Neil\ghcide
Found 1 files

Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/6, Cradle 1/1: Loading .\hie.yaml

Step 4/6, Cradle 1/1: Loading GHC Session
'stty' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\lib\package.conf.d\package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)
ghcide.exe: readCreateProcess: stack "exec" "ghc" "--" "-o" "C:\\Users\\ndmit_000\\AppData\\Local\\hie-bios\\wrapper-0.3.0.exe" "C:\\Users\\NDMIT_~1\\AppData\\Local\\Temp\\wrapper-0.3.0.hs" (exit 1): failed

It seems that somehow stack exec ghc has managed to grab my 8.0.2 version of Stack. That's odd, as when I run stack exec ghc on the command line it works just fine. It's not clear what directory or environment variables you are running it under, but they don't seem happy ones.

@mpickering
Copy link
Collaborator

Where is the hie.yaml file located? @fendor can you take a look please?

@ndmitchell
Copy link
Contributor Author

This was using ghcide as my example, so just in the ghcide repo typing ghcide. It currently reads cradle: {stack} - but adding/removing component didn't seem to help (this is compiling the wrapper before it gets that far).

@fendor
Copy link
Collaborator

fendor commented Dec 18, 2019

The environment variables are all the same for each cradle.
If they arent set via a function parameter, which they never are, and they arent already defined in the environement, they are set to "ghc" and "", respectively for $HIE_BIOS_GHC and $HIE_BIOS_GHC_ARGS.
I thought that this maintained the same behaviour as before.

@fendor
Copy link
Collaborator

fendor commented Dec 18, 2019

The problem, regarding hie-bios picking up the ghc 8.0.2 version, seems to be that the stack exec ghc -- * command, which is used to compile the wrapper_hs, is executed in the directory of the wrapper_hs file, which is in some temporary directory. Therefore, the global project compiler is used.

@fendor
Copy link
Collaborator

fendor commented Dec 19, 2019

This issue ought to be fixed by #112

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

3 participants