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

Failure on Windows #110

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

Failure on Windows #110

ndmitchell opened this issue Dec 18, 2019 · 12 comments

Comments

@ndmitchell
Copy link
Contributor

If I change ghcide to have a different Stack component, I get:

ghcide.exe: CradleError (ExitFailure 1) ["Failed to parse result of calling stack","'stty' is not recognized as an internal or external command,","operable program or batch 
file.","\ESC[0mghcide> initial-build-steps (lib + exe)\ESC[0m","\ESC[0mConfiguring GHCi with the following packages: ghcide\ESC[0m","\ESC[0mReceived ExitFailure 1 when running","Raw command: \"C:\\\\Users\\\\ndmit_000\\\\AppData\\\\Local\\\\hie-bios\\\\wrapper-0.3.0.exe\" --version","Standard error:","","wrapper-0.3.0.exe: getEnv: invalid argument (The operation completed successfully.)","\ESC[0m"]

My guess is that's because one of the environment variables HIE_BIOS_* is not being set. I have no idea how they are meant to be set.

@mpickering
Copy link
Collaborator

@jneira Can you try to reproduce this please?

@ndmitchell
Copy link
Contributor Author

Reproduction for me was the ghcide repo, changing hie.yaml to cradle: {stack: {component: "ghcide:lib"}}

@mpickering
Copy link
Collaborator

I tested on linux and it works correctly. The variables are set in readProcessWithOutputFile.

@jneira
Copy link
Member

jneira commented Dec 18, 2019

I've installed hie-bios with ec13a98 and i had to use the wrapper cause using hie-bios check give me another error:

PS D:\dev\ws\haskell\stack-test> hie-bios check .\src\MyLib.hs
hie-bios.exe: Cannot decode byte '\xbd': Data.Text.Internal.Encoding.streamDecodeUtf8With: Invalid UTF-8 stream

@jneira
Copy link
Member

jneira commented Dec 18, 2019

I've tested the commit before #97 and it works:

PS D:\dev\ws\haskell\stack-test> D:\bin\hie-bios\0a5cdc\hie-bios.exe check .\src\MyLib.hs
[1 of 1] Compiling Main             ( C:\TEMP\wrapper-0.3.0.hs, C:\TEMP\wrapper-0.3.0.o )
Linking C:\Users\atrey\AppData\Local\hie-bios\wrapper-0.3.0.exe ...
src\MyLib.hs:4:12:• Variable not in scope: putStrLnX :: [Char] -> IO ()
• Perhaps you meant ‘putStrLn’ (imported from Prelude)

@mpickering
Copy link
Collaborator

Anyone know why environmental variables don't work on windows?

@mpickering
Copy link
Collaborator

Is stack modifying the environment somehow to unset these variables?

@fendor
Copy link
Collaborator

fendor commented Dec 18, 2019

I dont think so, otherwise the $HIE_BIOS_OUTPUT env variable wouldnt have been read either.

@mpickering
Copy link
Collaborator

Perhaps there is no difference on windows between setting a variable and setting it to "".

@mpickering
Copy link
Collaborator

Can we use lookupEnv rather than getEnv to gracefully handle this case?

@fendor
Copy link
Collaborator

fendor commented Dec 18, 2019

yeah, that could be.
Of course.

@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

4 participants